Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Removing the last 2 charters of a part attribute 1

Status
Not open for further replies.

CADMANSOUTH

Mechanical
Aug 2, 2006
43
Is the are was to remove or replace the last 2 charters of a part attribute.

For example in Excel I can use the SUBSTITUTE command like this:
=SUBSTITUTE("DRAWING_D10",10,20)
and the value in the cell would be DRAWING_D10

I am using NX8.5 :-(

 
Replies continue below

Recommended for you

Depends on how you are doing it.
In GRIP, you could read the attribute, then use substr to get a substring of the attribute, add your new characters and then resave the attribute to the file.
I'm sure it can be done in a journal, too.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Create a string expression that uses the "charReplace" command and references the existing attribute. This will result in an expression that you can reference on your drawing.

www.nxjournaling.com
 
Thanks, cowski!

I think this is just what I needed. I went

Expressions is set the TYPE = STRING

Then tried this:

charReplace("YYYnXX" , "n", "-")

The expression now = YYY-XX

I have to play with it some more, but this was just what I was looking for.

Thanks, cowski!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor