Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

NX 10 extract expression from part name 1

Status
Not open for further replies.

tariq89

Mechanical
Jul 3, 2013
14
0
0
OM
Hello everybody,

is there a way to extract expressions in NX 10 from the part name?
for example, I want to model a rectangle in NX:
L=100
W=50
I want these two numbers to be extracted from Part name "part name 100x50.prt"
By changing part name to "part name 200x150.prt", L and W should be updated in the expression list automatically and should be L=200, W=150.
So the size of the rectangle depends on the file name.

Thanks in advance
 
Replies continue below

Recommended for you

I don't think that expressions can do this. If I have to do similar task, I will create journal which read file name and create those attributes, then in expressions I will linked them to those values. Every file change, You have to run journal to update values in attributes and then in expressions.

With best regards
Michael
 
Hello, this string show the partname on expressions:
ug_askCurrentWorkPart()

you will need a 'first(SplitString(ug_askCurrentWorkPart(),"."))' statemente to remove '.prt' from file name

Gelson Z. Nicoletto
Eng. Supervisor
Mould Desing
Brazil
 
You would need to run "update for external change" after renaming the file to get the expressions to update; but, in theory, it should work. However, from the little information given, it would seem that a part family would be the better option.

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