×
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

Interpreting control characters in string

Interpreting control characters in string

Interpreting control characters in string

(OP)
Greetings all!

Is it possible while displaying contents of a string expression to interpret control characters included in that string?
Example: string expression with a value of "<U>0<U>" will be shown as <U>0<U>. Is it possible to display it as a underlined zero?

RE: Interpreting control characters in string

What version of NX, and to where are you going to display this string?

www.nxjournaling.com

RE: Interpreting control characters in string

(OP)
Version 8.5 and above.
Not sure I understand "to where". I'm going to show it on the drawing.

RE: Interpreting control characters in string

NX should interpret the string '<U>o<U>' as an underlined O when placed on a drawing.

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

Ben Loosli

RE: Interpreting control characters in string

(OP)
If I write this directly - in interprets it like that.
If I try to display a string expression then it does not.

RE: Interpreting control characters in string

The best that you can do is create the expression with a string value of "O" and then when you place it on your Drawing using the Text editor format your 'statement' as...

<U><X0.2@text><U>

...where text is the name of the expression with the value of "O".

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.

RE: Interpreting control characters in string

(OP)
John,

I used this only as an example. I'm trying to figure out the possibility to interpret control characters in strings. The strings themselves could be changed according to the values of some other expressions, and control charcters therefore could come and go. For example:

Case 1. ATTR string has value of 1. Displays 1
Case 2. ATTR string has value of 1 <U>0<U>. Displays 1 0

Perhaps it's too much to ask?

RE: Interpreting control characters in string

OK, this is a bit of a 'kludge' but it will give you what you want.

Open the attached Drawing file and go to the Expression dialog and change the value of underline from true to false (this is not a string expression so no double-quotes are needed) and hit OK and your note will change from 1 O to 1 O.

This was accomplished by creating TWO notes superimposed over each other, one with the 'underline' as I suggested in my previous post and the other without. I then went into...

Edit -> Suppress Drafting Object...

...and assigned one of the notes to one of the mod_X expressions and the other to the other. Now the 0 and 1 values of these two mod_X expressions are controlled by the value of the underline expression.

Now you can change the content of the 'note' by simply editing the num and text expressions.

Anyway, take a look and see if this will work for you.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.

RE: Interpreting control characters in string

(OP)
John!

Thanks for the hint! Yes, it works.

RE: Interpreting control characters in string

Another solution:
Create a part attribute (type string) that refers to your string expression. Add a note to your drawing referencing the new part attribute. It will fill in the note text something like:
<WRef1*0@theexpname>

Edit the text to add an ampersand character (&) after the W, so it looks like:
<W&Ref1*0@theexpname>

The text control characters will now be interpreted correctly.

www.nxjournaling.com

RE: Interpreting control characters in string

Oops, theexpname above should be theAttributeName instead...

www.nxjournaling.com

RE: Interpreting control characters in string

John,
Would be wonderfull if this "Suppress drafting object" could also supress a view.
BTW, where, after creating this "rule", can we delete it ?
Thank you

"My english is bad ? That's why i'am french."

RE: Interpreting control characters in string

What 'rule' are you talking about?

As for the suppress a view option, yes that would be useful. Please contact GTAC and have them open an ER (Enhancement Request) to that effect and it will be given consideration.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.

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