×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NX Journal - Creating a Specific BodyCollection
3

NX Journal - Creating a Specific BodyCollection

NX Journal - Creating a Specific BodyCollection

(OP)
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

RE: NX Journal - Creating a Specific BodyCollection

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

 

RE: NX Journal - Creating a Specific BodyCollection

One example of the sorting that Frank mentions can be found in the VB code I posted in thread561-312900: Constrain Assemblies through .NET. 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.

RE: NX Journal - Creating a Specific BodyCollection

(OP)
Thanks guys!  And with this last bit of help I was finally able to complete my Journal.

Until the next one...

Jeff

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources