×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Split part name as automated text on a drawing

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

RE: Split part name as automated text on a drawing

Hi,
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

(OP)
Hi, kapmnit123

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

What version of NX are you running?

www.nxjournaling.com

RE: Split part name as automated text on a drawing

(OP)
NX8.0.3.4 with Bundle NX11110

RE: Split part name as automated text on a drawing

Create a new string expression (any name you choose) and in the formula, type in ug_askcurrentworkpart() and press Apply.

www.nxjournaling.com

RE: Split part name as automated text on a drawing

(OP)
It's works !
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

The way NX works is that ANY KF function which has been registered with the system, whether it was hard-coded by development or is something that was created by a user using the KF toolkit, will be available when creating an Expression. The functions that you see listed under the f(x) menu are just a subset of the full list of KF routines known to the system.

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

(OP)
Thanks John for these precisions.
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

Tools -> Update -> Update for external change will cause the expression to update.

www.nxjournaling.com

RE: Split part name as automated text on a drawing

That's one the weaknesses of KF, unless the original developer explicitly includes an automatic update mechanism, it will need to be manually updated. What you could try the next time that you change the part file name is to go to...

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

Hi SuperQuark ,
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 doing something very similar to what's being discussed here but can't figure out how to remove the suffix from the ug_askcurrentworkpart().

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

There is currently no way to use a "loop" in the expression system. Attached below is one (admittedly ugly) way to get around this limitation. Perhaps someone can improve upon this solution.

The pic may get auto-sized and be hard to read. If so, right-click on it and download the original.

www.nxjournaling.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources