Drafting Attributes help
Drafting Attributes help
(OP)
Hi all,
I'm after a little help regarding referencing certain attributes in the drafting table within NX7.5 & Teamcenter 8
I'm trying to automate the standard border we use as much as possible rather than the current method of manual inputs.
Hopefully someone can point me in the right direction.
1. For the owners name I am currently referencing <W@DB_OWNER_NAME>
This returns the following result "Bloggs, Joe"
Is there a way to switch these around with just the first initial and then surname, and also convert them to uppercase? For Example J. BLOGGS
2. For the copyright date, can I somehow use the attribute <W@DB_MODIFIED_DATE> and truncate this to just the year?
For example this would return 07-Feb-2017, but all I require is 2017
Any help is much appreciated.
Thanks,
Don Henderson
I'm after a little help regarding referencing certain attributes in the drafting table within NX7.5 & Teamcenter 8
I'm trying to automate the standard border we use as much as possible rather than the current method of manual inputs.
Hopefully someone can point me in the right direction.
1. For the owners name I am currently referencing <W@DB_OWNER_NAME>
This returns the following result "Bloggs, Joe"
Is there a way to switch these around with just the first initial and then surname, and also convert them to uppercase? For Example J. BLOGGS
2. For the copyright date, can I somehow use the attribute <W@DB_MODIFIED_DATE> and truncate this to just the year?
For example this would return 07-Feb-2017, but all I require is 2017
Any help is much appreciated.
Thanks,
Don Henderson





RE: Drafting Attributes help
attributesexpressions (db_modified_date = "07-FEB-2017" and db_owner = "Bloggs, Joe").Getting the year from the date is pretty easy, make a new string expression with the formula:
CODE
The splitstring function breaks the string at the hyphens and returns a list of (in this case) 3 strings; the last function returns the last item in the list (the year).
Here's the expression for the user name. It also uses the splitstring function, but is a bit more involved because we also want to grab the 2nd character of the last list item, reverse the order, and make everything uppercase.
CODE
The drafting notes can reference these expressions rather than the original attributes.
www.nxjournaling.com
RE: Drafting Attributes help
Rather than creating my own attributes I ended up putting a ug_askPartAttrValue("DB_MODIFIED_DATE") to obtain the info directly from Teamcenter, and likewise for the owner name.
Much appreciated for your assistance.
Don
RE: Drafting Attributes help
Sorry, I didn't mean you needed to create new attributes. I typed "attributes", but meant "expressions"; I edited my post above to correct that.
www.nxjournaling.com
RE: Drafting Attributes help
I'm having some trouble though when someone else brings in the new part template as the border...
There appears to be no live link to the expressions table even when updating. The name on the drawing stays the same as mine.
To get around this I have written inside our setup macro to delete the expression reference (<X0.2@Name'1>), save the part, and then retype in the expression reference. This then updates it to the correct value.
This is fine as long as long as everyone uses the macro, however, out of curiosity, do you know of a way to keep this link 'live'?
So as soon as they press save the drawing then picks up the 'new' name from the expression table.
Thanks,
Don
RE: Drafting Attributes help
The apostrophe in the expression name leads me to believe that you are using file -> import part to get the drawing border into your drawing file. I've not tested this method, but my past experience with NX leads me to believe there may be some updating issues with this workflow.
Finally, what version of NX are you using? Attributes got a major overhaul in NX 8 (and to a lesser extent, expressions). The version you are using may play a part in what gets updated and when it gets updated.
If you are using the master model method with drawing templates, there is a way to pass an attribute from the model file to the drawing file:
https://docs.plm.automation.siemens.com/tdoc/nx/10...
The above link is to the online NX help files (NX 10), it may require a login to access them. If you have the NX help files installed locally, try searching for "drawing template attributes".
www.nxjournaling.com
RE: Drafting Attributes help
We are due to upgrade early next year hopefully, so I guess I'll have to have a look again then.
I cannot get on the link here at work unfortunately, but I shall browse the help files we have on our system to see what I can find.
Thanks Cowski.
RE: Drafting Attributes help
Hi Cowski
I tried your above code on my nx8.5 expressions editor and its work fine.
But when I go to the expressions editor functions dialog I dont see
the string function "splitstring" do you know how I can see it.
Thank you in advanced
RE: Drafting Attributes help
www.nxjournaling.com