Showing results for 
Search instead for 
Do you mean 
Solved! Go to solution

Extracting the Element Type - How to?

To all,


I would like to check as part of macro if (a user specified) element ID is either a CBUSH or a CBEAM? looking at the doc and recording a test journal it seems that the on;ly way is to use the 'NodeElementInfoBuilder'. Is this correct ?


Dim nodeElementInfoBuilder1 As CAE.NodeElementInfoBuilder
nodeElementInfoBuilder1 = caePart1.NodeElementInfoMgr.CreateNodeElementInfoBuilder()


The problem I can see with the Bulder is that I am not sur ehow to access the 'Elment Type' information


using the following


Dim elementIdToMatch As Integer = 1234 '456
Dim theFEElm as CAE.FEElement

Dim femPart As NXOpen.CAE.BaseFemPart = theSimPart.FemPart
Dim elementMap As NXOpen.CAE.FEElementLabelMap = femPart.BaseFEModel.FeelementLabelMap
Dim element As NXOpen.CAE.FEElement = elementMap.GetElement(elementIdToMatch)
If (Not element Is Nothing) Then
	'Dim nodes As NXOpen.CAE.FENode() = element.GetNodes()
	theLW.WriteLine("Elm Shape is:" & element.shape)
End If	


returns a integer (1 in my case)


Any hints, suggestions, ideas, corrections , etc is welcome







Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)
Accepted by topic author selex_ct
‎08-26-2015 04:32 AM

Re: Extracting the Element Type - How to?

CBUSH and CBEAM are only meaningful in the context of the NX Nastran solver language. The elements are stored internally based on shape and order (which are FEElement properties).


You can get the name indirectly by parsing the card name out of the string returned by CAE.FEElement.GetSolverCardSyntax()

Re: Extracting the Element Type - How to?

Thanks. much appreciated

Dim strCardSyntax() As String = theFEElm.GetSolverCardSyntax()
Dim theElmType as String = RTrim(Left(strCardSyntax(4),8))

using RTRIM to remove trailing blank
Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)