Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations The Obturator on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX Journal - Creating a Specific BodyCollection 3

Status
Not open for further replies.

jmarkus

Mechanical
Jul 11, 2001
377
Thanks Everyone, (especially Frank) whose been helping me with my "trial by fire" NX Journal programming.

Now I want to create a BodyCollection with specific bodies in it (not all the bodies in the part). I thought I could use BodyCollection.Add(newbody) to add a body, but it seems BodyCollection doesn't work that way. So how can I create a bodycollection (not just an array of tags - cause I still don't get how to convert those back to objects) which I can process later?

Thanks,
Jeff
 
Replies continue below

Recommended for you

To answer the second question first use

object = NXObjectManager.Get(objectTag)

here objecttag is the tag for the object. Note you must also include the necessary import

Imports NXOpen.Utilities

On the first question the most common programming method is to copy to an array from the original body collection those bodies that meet your specific requirements.

Frank Swinkels

 
One example of the sorting that Frank mentions can be found in the VB code I posted in thread561-312900. Here the user is allowed to select as many faces and edges as he wants; the code then sorts them into a 'myFaces' array and a 'myEdges' array. It later iterates over those arrays to show that the objects can still be accessed normally.
 
Thanks guys! And with this last bit of help I was finally able to complete my Journal.

Until the next one...

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor