Skip to main content
1-Visitor
November 19, 2013
Solved

Model Parameters

  • November 19, 2013
  • 9 replies
  • 2565 views

I'm pretty sure I know the answer to this, but I'm going to ask anyway, hoping someone knows a way. Is there a way to have a string parameter look at a real number parameter.

For example I have a string parameter called "PART_DESC" the value is "1/4x4 SQ TUBE M@X". the "M@X" is for the miter angle of the tube. I want this to auto populate based on the angle parameter used to control the cut in the part.

I would appreciate any ideas on how to do this.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
Best answer by JonathanHodgson

In Relations:

string_param = "1/4x4 SQ TUBE M@" + itos(angle_param) + "°"

assuming I've understood your requirement correctly (although you might have to use Symbol Palette in a drawing to get the degree sign, and clipboard it into the relation).

If it's not an integer it will, in fact, round up or down - I thought it only rounded down but I've just tested it (WF4) and itos(3.7) is "4"!

9 replies

13-Aquamarine
November 19, 2013

There's a function called "itos" - Integer TO String - which pretty much does what it says.

Getting it to round up is a little trickier (though entirely possible) but if your angle is an integer to start with, it should present no problem.

1-Visitor
November 19, 2013

I can make the angle parameter an integer. How would I write the string parameter to use the integer parameter? Remember I want the integer to replace the X at the end of the string. "4 X 1/4 SQ TUBE M1@X"

13-Aquamarine
November 19, 2013

In Relations:

string_param = "1/4x4 SQ TUBE M@" + itos(angle_param) + "°"

assuming I've understood your requirement correctly (although you might have to use Symbol Palette in a drawing to get the degree sign, and clipboard it into the relation).

If it's not an integer it will, in fact, round up or down - I thought it only rounded down but I've just tested it (WF4) and itos(3.7) is "4"!