Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX 10 extract expression from part name 1

Status
Not open for further replies.

tariq89

Mechanical
Jul 3, 2013
14
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
 
hello tariq89,
have you managed to change the values of the part by naming it part name 100x50?
thank you very much
 
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
 
you could put an image, with an example,
a piece that is 100 long, 60 wide and 20 high?
thank you very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor