Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Macro to query part in assembly attributes then add new attribute depending on result

Status
Not open for further replies.

Jim Brzez

Electrical
Jan 16, 2020
4
0
0
US
I am trying to figure out how in an assembly (NX11) that I can build a macro to do the following:
Look at a particular child part property and depending on the result (can be compared to a specific list of results) then add a new property (all the same kind) with a choice of values depending on the initial property.

Example:
My assembly contains:
5 Clips
3 Brackets
2 Troughs
## of other others I don't need to add values to

I want to write something to look in the entire assembly while I have the model up at each child in a particular field; let's say GEN-INFO that for the Clips says CLIP, Brackets says BRKT and Trough says TROUGH. If there is nothing in the field or it doesn't match those items then move on to the next item.

Once it finds one of these items I then want it to add a new property; Say NOTE but for each instance I want a specific value.
When it finds a Clip then I want it to add the NOTE property with a value of CLIP-MANUAL
When it finds a Bracket then I want it to add the NOTE property with a value of BRKT-INSTALL
When it finds a Trough then I want it to add the NOTE property with a value of TROUGH-PURCHASE

I found the Attribute - Template thread but can't figure it out on how to apply this to my issue.
I have multiple small/large assemblies that I want to quickly add a set of attributes to the children so other processes can use that data. I can do it manually by sorting and multi-selecting the children and adding the new property manually but want to insure I don't miss something.

I need specifics (step-by-step) as I am not a programmer just a tube-jockey.
 
Status
Not open for further replies.
Back
Top