Showing results for 
Search instead for 
Did you mean: 

FEM Part vs AFEM to extract Element ID?

Gears Phenom Gears Phenom
Gears Phenom

To all,


I am testing a macro which is working OK in a simple .fem. I have the following line of codes to check the element ID specified by the user exists;


'check the element specified by user exists
Public Dim theSimPart As NXOpen.CAE.SimPart = theSession.Parts.BaseWork

Dim lngElemID as Long 'The element ID
Dim femPart As NXOpen.CAE.BaseFemPart = theSimPart.FemPart
Dim elementMap As NXOpen.CAE.FEElementLabelMap = femPart.BaseFEModel.FeelementLabelMap
Dim theFEElm As NXOpen.CAE.FEElement = elementMap.GetElement(lngElemID)
Dim destinationElements1(0) As CAE.FEElement

 It seems that if one works in an assembly fem (afem) these lines do not work (I know the element exists in my dummy assembly!). Does this means that one needs to get an FEModelOccurrence Class and/or an AssyFEModel Class to make it works?


Any pointers would be welcome







Production: NX.CAE, NX.CAE
Development: VB.NET (amateur level !)