×
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

Truncate an Attribute in a Title Block

Truncate an Attribute in a Title Block

Truncate an Attribute in a Title Block

(OP)
Hi All,

I've gone through the forums with various search keywords and as well as Google searches (Eng-Tips still comes up top bigsmile) and I've learned quite a bit of very useful info from a lot of threads, but can't find a similar post.

Our company runs NX7.5.4.4 with Teamcenter 8.3.3. We're looking at automating drawing title blocks with attribute information from Teamcenter. For material finishes on Teamcenter we have a two digit code, hyphen and descriptive text, e.g. "00 - NATURAL".

The question is how do you truncate an attribute value in a title block to only show the first two digits? E.g. only show "00" in the finish of the drawing, instead of "00 - NATURAL"? Or to specify to only show specific characters from an attribute, e.g. 1 and 2; or even characters 6 to 12 if we wanted to show "NATURAL".

A particular attribute hasn't been defined yet, but I assume it will be a custom one instead of a built in one (haven't seen finish attributes yet). I've played around with a custom attribute MATERIAL_FINISH ("MATERIAL_FINISH"=(string)"00 - NATURAL"), and tried variations of <W@MATERIAL_FINISH<1,2>>, <W@MATERIAL_FINISH(1,2)>, <W@MATERIAL_FINISH,1,2>, etc. but all come up with errors.

Can it be done?

Any help would be great, thanks!

Cobus

RE: Truncate an Attribute in a Title Block

Create a string expression and set the formula to:

CODE

subString( ug_askPartAttrValue( "[your finish attribute title]" ), 2, 3 ) 

Now reference this expression in your title block note.

www.nxjournaling.com

RE: Truncate an Attribute in a Title Block

(OP)
Thanks Cowski! That did it!
smile

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