×
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

Select components and get attributes

Select components and get attributes

Select components and get attributes

(OP)
Hey guys/gals! I am trying to create a journal in NX 8.5 and I am working with ReUse Design Elements. I am guessing these are considered components. I am having trouble figuring out the VBA code to prompt the user to select multiple components and write them to a text file. Links to help or code examples? Thanks!

RE: Select components and get attributes

(OP)
So I got the code to select multiple components and get a certain attribute but one of my attributes is on the Design Element. How can I go from a Component level to a Design Element level?

RE: Select components and get attributes

Well I did this some time ago. I can't remember exactly how I looped through an assembly with each object as a Design Element but I think I do. In order to query the design element you will need to load a subset into NX, and from there you can loop through the subset by doing something like this:

CODE --> Basic

Dim S as Subset = part.ComponentAssembly.RootComponent.Subset 
In this case "part" is equivalent to the work part loaded.

Once you have the subset you can query it for Design Elements:

CODE --> Basic

Dim DesignElements as PDM.DesignSubordinateRevision() = S.GetDesignSubordinateRevisionMembers() 

Then you can loop through DesignElements() and process each one. For the most part they are treated as components when it comes to querying attributes.

Check the NXOpen API docs for the subset class to see other similar calls you can make like the one above.

Sorry I didn't lay out all of the code, but that should be enough to get you started.

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