Cancel
Showing results for 
Search instead for 
Did you mean: 

pick by faces API

Creator
Creator

Hello,

 

I want to use the "entity selction / pick / by faces ..." method in an api script.

Does anyone know how to access this method?

 

regards

Wolfgang

3 REPLIES 3

Re: pick by faces API

Siemens Phenom Siemens Phenom
Siemens Phenom

What type of entity are you selecting? If it's elements, try using the .feGetElementFaces(....) method.

 

feGetElementFaces.JPG

Highlighted

Re: pick by faces API

Siemens Phenom Siemens Phenom
Siemens Phenom

Use the app.feGetElementFaces method.  Example code shown below

 

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

    Dim rc As femap.zReturnCode

    Dim elSet As femap.Set
    Set elSet = App.feSet

    Dim initCount As Long
    Dim origElIDs As Variant
    Dim origFaceIDs As Variant
    Dim elCount As Long
    Dim elIDs As Variant
    Dim faceIDs As Variant

    rc = App.feGetElementFaces ( "Select Element Faces", initCount, origElIDs, origFaceIDs, _
        elCount, elIDs, faceIDs )
    If rc = FE_CANCEL Then
        End
    End If

    'Test to Show What Element Face IDs Where Selected
    initCount = elCount
    origElIDs = elIDs
    origFaceIDs = faceIDs
    rc = App.feGetElementFaces ( "Select Element Faces", initCount, origElIDs, origFaceIDs, _
        elCount, elIDs, faceIDs )


    'Add the Array of Selected Elements into a Set
    rc = elSet.AddArray ( elCount, elIDs )
    If rc = FE_OK Then
        App.feAppMessage ( FCM_HIGHLIGHT, (Str$(elSet.Count) + " Elements where added to Set ID" + Str$(elSet.ID)) )
    Else
        App.feAppMessage (FCM_ERROR, "No Elements added to the Set" )
    End If

    App.feViewRegenerate ( 0 )

End Sub

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

Re: pick by faces API

Creator
Creator

Dear Chip and Giampietro,

 

Many thanks for your hint!

since I work on a program without user interaction I'll try the feGetElementAdjacentFaces Method instead.

 

regards

Wolfgang