Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Passing User Attributes Down 1

Status
Not open for further replies.

cmick31

Mechanical
Jun 1, 2021
19
Evening all,

Quick run through of my issue at hand:

I have a Tool - That tool has Units - Those Units have specific components

Program I'm writing processes through components on the assembly level & prompts user input to apply attribute to the component.

It applies to the component on assembly level, but if I go to the unit (parent of component) it won't be applied in there, and I need it shown on both levels.

Now I would simply get the Part of the component and apply on that level, which would then pass that attribute up to all levels, but parts are locked and cannot be altered.

Asking for the more experienced on guidance on how to handle this.

My initial thought is setting Parent of the component to Display and applying attribute, going back to assembly & applying attribute once more, but how can I make sure its the same instance on assembly level? Does Component Tag remain consistent throughout the tree of assembly?

Any guidance or boilerplate to get me started would be much appreciated, I've got the rest figured out.
 
Replies continue below

Recommended for you

Try applying the attribute to the reference set of the component.

Try this in interactive NX first to see if its behavior will solve your issue. In the top level assembly right click on a component -> properties -> attributes change the "apply to" option to "reference set" and create your desired attribute. This should be inherited to the component level and show up at every level in your assembly (assuming the same ref set is used in each). The attribute won't show up at the part level, of course.

Note: I've never used this technique on production parts, so there may be some drawbacks that I'm not aware of.

www.nxjournaling.com
 
Thanks for the reply Cowski.

I've went ahead and tried this - both on going inside the unit and applying, as well as applying on assembly level. The issue is it doesn't persist if you save - close out & reopen. I had also noticed it applies that attribute to all the same component in the assembly (the units sometimes have the same component).

A rough example of what I'm looking to do:


Assembly (right click on each component and see their respective attributes)

-Unit 2 (right click on component and see Attribute "Apple")
--Component("Apple" applied at Assembly)​

-Unit 3 (right click on component and see Attribute "Banana")
--Component("Banana" applied at Assembly)​

Doing my own digging, I found that if I apply a user attribute to the component on the Unit level, when I go back to the Assembly and right click the Unit > Properties > Assembly Tab - There is an option to "Synchronize Subassembly Properties" that push the components applied attribute to Top Level.

Am I able to access this feature through the NX Open API?

 
Thanks Cowski.

Thinking the process out more, the user would need to remain in the assembly while applying the attributes.

Briefly Put:
- User applies to component on assembly
- This needs to pass down and be shown on the component's parent (unit)

Where I'm running in to trouble - Synchronize passes it up, not down. So I need to:
- Set Display of Unit
- Apply to component there
- Kick back to the assembly view and run synchronize

However, sometimes a unit could have more than one of the same component, and I'm also not sure how a component works when you're changing display/work parts

What it comes down to, is there a unique key/id that persists throughout assembly/unit so that it can be sure that it's applying attribute to the correct component that was prompted at assembly?

Would greatly appreciate any input, I'm pretty stumped at this point.. If you need any more info I'm happy to provide
 
Look up the "MapComponentFromParent" function in the programming help. This will allow you to match a given component in the top level assembly to its counterpart in the subassembly. They are technically different components, so the tags and journal ID's will be different.

The link above has a code sample from GTAC; there are probably other samples on GTAC if you search on the right command names (I'd suggest starting with MapComponentFromParent and MapComponentsFromSubassembly).

www.nxjournaling.com
 
This is perfect - I can work with this. Thanks for always having the answer Cowski!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor