Split part name as automated text on a drawing
Split part name as automated text on a drawing
(OP)
Hello everybody,
I have some part names in the following format :
xxx.xxx.xxx - description.prt
In the title block of the drawing I would like to have :
One note with the part number (xxx.xxx.xxx)and another note with the specification (description)
I can add the whole to a note with the automated text <W@$SH_PART_NAME> but I cannot figure out how to split it.
Anybody have an idea how to to this ???
Thanks a lot in advance
SuperQuark
I have some part names in the following format :
xxx.xxx.xxx - description.prt
In the title block of the drawing I would like to have :
One note with the part number (xxx.xxx.xxx)and another note with the specification (description)
I can add the whole to a note with the automated text <W@$SH_PART_NAME> but I cannot figure out how to split it.
Anybody have an idea how to to this ???
Thanks a lot in advance
SuperQuark





RE: Split part name as automated text on a drawing
You can create expressions to store these values seperately.Generally using a substring function you can get these string values seperately.
I am detailing out a probable process you can follow.
Use ug_askCurrentWorkPartr() to get the part file name first and store it in a string expression.
Now use the function subString two times to get the values stored (as per your wish) in two different expressions.
Once you get these seperate expressions then you can insert these in your notes using relationship.
I generally do it a KF code i wrote sometime back but you can follow the manual method i furnished above also.
Best Regards
Kapil Sharma
RE: Split part name as automated text on a drawing
Thanks a lot for your reply ...
But, just a problem, I don't have the ug_askCurrentWorkPartr() into my Expressions Functions list (Tools, Expressions, Functions f(x), Insert Functions).
I just have this one only ug_askExpressionValueAsString !
What can I do ???
Many Thanks
SuperQuark
RE: Split part name as automated text on a drawing
www.nxjournaling.com
RE: Split part name as automated text on a drawing
RE: Split part name as automated text on a drawing
www.nxjournaling.com
RE: Split part name as automated text on a drawing
Many thanks for your help cowski !
I did not know this method to create expression.
Please, do you have a list of functions that I can use with the same method ?
Thank you again.
SuperQuark
RE: Split part name as automated text on a drawing
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Split part name as automated text on a drawing
Now I'm a little bit disappointed because the expression created in this way ( ug_askcurrentworkpart() ) does not be updated automaticaly if the part name is changed !
But with <W@$SH_PART_NAME> it does !
Do you know that ?
Is there a solution ?
RE: Split part name as automated text on a drawing
www.nxjournaling.com
RE: Split part name as automated text on a drawing
Tools -> Update -> Update for External Change
This is a sort of 'catch all' which will look at everything in your model and if anything is out-of-date it will try and force a refresh. I use it often enough that I've added a user command to one of my toolbars which performs this operation with a single button-push.
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Split part name as automated text on a drawing
Sorry for a very late response. And also for typo ug_askCurrentWorkPartr() i meant to say ug_askCurrentWorkPart() :(
But no issues Cowski and John have already helped you out with this. I must admit Tools -> Update -> Update for External Change is the way out if you want to update the expression value when the part name changes.however if you wish you can try using DemandValue () in KF also but still it would be add more steps (adding an attribute in KF also )to your process so i will stay with what Cowski and John stated as i find it more reliable and coherent for updation.
Thanks and Best Regards
Kapil Sharma
RE: Split part name as automated text on a drawing
I'm close... I've used length(list) to tell me the number of the last item in the list. Then, I've split the last item using splitstring('last.in.list',"."). I need to bring it back together somehow.
I need to use a range for nth() but I haven't been successful. Below is where I'm at...
Name FormulaValue
A_Description I want to show Range (4:('Number_Of'-1)) from 'List List_OSName' & 'Remove_Suffix'
A_Number =first(List_NumberWRev) 5678
A_Project =first(List_OSName) A12345
A_Rev =second(List_NumberWRev) A
A_System =second(List_OSName) 12.34
Last_Word "=nth(Number_Of,List_OSName)" description.prt
List_LastWord "=splitstring(Last_Word,""."")" "{""description"",""prt""}"
List_NumberWRev "=splitstring(OS_NumberWRev,""-"")" "{""5678"",""A""}"
List_OSName "=splitstring(OS_CallCompleteName,"" "")" "{""A12345"",""12.34"",""5678-A"",""This"",""is"",""a"",""variable"",""length"",""description.prt""}"
Number_Of =length(List_OSName) 9
OS_CallCompleteName =ug_askcurrentworkpart() A12345 12.34 5678-A This is a variable length description.prt
OS_NumberWRev =third(List_OSName) 5678-A
Remove_Suffix =first(List_LastWord) description
Apparently, I also need to know how to best past my expressions into this forum
RE: Split part name as automated text on a drawing
The pic may get auto-sized and be hard to read. If so, right-click on it and download the original.
www.nxjournaling.com