Highlighted

FEMAP API- element attached to a node

Gears Phenom Gears Phenom
Gears Phenom

Hello,

 

Is there anayway that once I have a node selected, select the elements attached to this node through API?

 

Thanks in advance

 

Jon

2 REPLIES 2

Re: FEMAP API- element attached to a node

Siemens Phenom Siemens Phenom
Siemens Phenom

The easiest way is to use a Set object and the app.feset.FGD_Elem_byNode method.  For example:

 

The HTML Clipboard

Sub Main
    Dim App As femap.model
    Set App = feFemap()

    Dim rc As femap.zReturnCode

    Dim nodeID As Long
    rc = App.feSet.SelectID ( FT_NODE, "Select Node", nodeID )
    If rc <> FE_OK Then
        End
    End If

    Dim elemSet As femap.Set
    Set elemSet = App.feSet
    rc = elemSet.AddRule ( nodeID, FGD_ELEM_BYNODE )
    If rc = FE_OK Then
        App.feAppMessage ( FCM_COMMAND, _
            (Str$(elemSet.Count) + " Elements attached to Node ID" + Str$(nodeID)) )
    Else
        App.feAppMessage ( FCM_ERROR, _
            ("No Elements attached to Node ID" + Str$(nodeID)) )
    End If

    
End Sub

Best Regards,
Chip Fricke
Principal Applications Engineer - Femap Product Development

Re: FEMAP API- element attached to a node

Gears Phenom Gears Phenom
Gears Phenom

Thanks a lot ChipFricke.

 

The problem was that using VBA from excel , FGD_ELEM_BYNODE must be replaced by the correspondig number 25

 

rc = elemSet.AddRule(nMaxID, 25).