Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

how to use Regular Expressions (regex) inside NX Expressions?

Status
Not open for further replies.

potrero

Mechanical
Aug 30, 2007
516
NX8.0.1 MP1

I have a situation in which I have an NX expression which evaluates to a string, such as the following filename:

partname = "123456.2.10.prt"

My goal is to create another string from this one, pulling out portions of the original string.

For example:
partrevision = "2.10"

or:
partnumber = "123456"

Can anyone advise on how to accomplish this? I think Regular Expressions (regex) would be a good way to do this if possible to implement within the NX Expressions Editor, but I haven't done this before and can't seem to find any useful advice in the NX Documentation.

Thanks in advance.
 
Replies continue below

Recommended for you

Open up the Expression editor and in the lower left corner there is an icon labeled 'f(x)'. Select it and from the drop-down list under 'Choose a Category' select the 'String' item.

You will now see a list of 'string' functions which includes functions to extract sub-strings. To see how to use a certain function, just select it from the list and then select the icon labeled '?' near the bottom of the list box at the right.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor