Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Any way to update labels that are referencing the component it is attached to?

Status
Not open for further replies.

cmick31

Mechanical
Jun 1, 2021
19
0
0
US
Hi all,

I am looking for guidance from anyone that's willing to answer/has experience with this. For some context, I have a program running where part of it's purpose is to pull assembly labels from components in drafting, and that labels string value is encoded from the component's specific attribute. For example the value will be something like <WRef1*0@THE_ATTRIBUTE>. This works great and all, but I seem to have an issue that's stopping this workflow..

Another process of the program is having the user change the attribute that we reference, and when they do that it maps to all instances of this component. So for example we have the master file the user performs the change in, the assembly part nested, the nested unit part - each instance of the component updates the attribute, so 3 times in this case. Now each level has a label referencing the attribute value and the attribute value updates correctly. Great! However, the encoded reference for the labels seems to not update, so the label value never changes. It will change in the master file, but not anywhere else that's nested. If I place a new label it comes in correct.

I've tried to make it open each level's drafting sheets before I change the value to maybe force the update, but it only sometimes works? I also cannot change the main part file's attributes as this only needs to be on the Component level as it changes every tool.

Could anyone point me in the direction to consistently update label values throughout all levels of the assembly? Would implementing a string expression work better here?

Thanks for any help on this, and let me know if you need more info/code snippets to help me out.

Thanks
- Chris
 
Replies continue below

Recommended for you

Do you update the model after changing the attribute value? I'd suggest performing an "update for external change" after running your code to see if anything changes. If it does, your code will need to kick off some sort of model update (hopefully not a full "update for external change") after changing the values.

www.nxjournaling.com
 
Status
Not open for further replies.
Back
Top