Normally with an NX assembly, I can use
For Each child As Component In comp.GetChildren()
To get a list of Part available in the assembly. However, when I am dealing with a step file with stucture like the attached email, I have a problem extract the list of bodies (I just want to get Body(1), Body(2), ..., Body(8).
Please help me
Solved! Go to Solution.
First of all, SNAP and VB.NET are complementary, not alternatives. You write VB code that calls SNAP functions. SNAP can't do anything without VB (or some other .NET language).
Reagrding your question ...
You cycle through the bodies in a part named "myPart" using code like
For Each solidBody as Snap.NX.Body in myPart.Bodies
Quite often "myPart" is just the work part, of course, so then it's:
For Each solidBody as Snap.NX.Body in Snap.Globals.WorkPart.Bodies
Thanks - I have another question which is related to the question above (if I need to add another topic, please let me know). I would like to get the the name
Body(1) Body(2) ... Body(8)
However, if I use
solidBody.ToString or SolidBody.Name
Then I get result like "Body 123435" or Blank instead of Body (1). What should I use? I try to play with getStringAttributes with Object Name but it won't help either.
I think what you are after are feature names. Cycle for Features in the part and use GetFeatureName() for each feature.
Thanks - I will try later as the company only has a limited # of licenses so...there is often a person who steals my section.