Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Interpreting control characters in string

Status
Not open for further replies.

PrintScaffold

Mechanical
Joined
Sep 8, 2006
Messages
453
Location
RU
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?
 
Version 8.5 and above.
Not sure I understand "to where". I'm going to show it on the drawing.
 
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
 
If I write this directly - in interprets it like that.
If I try to display a string expression then it does not.
 
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.
 
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?
 
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.
 
 http://files.engineering.com/getfile.aspx?folder=9bc6213a-d6b0-485b-ab11-ee2293ef7e5b&file=Underline-Note_Example-JRB-1.prt
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
 
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."
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top