×
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

Removing the last 2 charters of a part attribute

Removing the last 2 charters of a part attribute

Removing the last 2 charters of a part attribute

(OP)
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 sad

RE: Removing the last 2 charters of a part attribute

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

RE: Removing the last 2 charters of a part attribute

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

RE: Removing the last 2 charters of a part attribute

(OP)
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!

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