Hello All,
I am trying to add following relation in a model.
THICKNESS=D4
WIDTH=D5
LENGTH=D6
Where D4, D5 & D6 are the dimension IDs of the plate thickness and widths respectively.
Now I want to add one more relation which should give me the result as:
PLATE_SIZE = THICKNESS x WIDTH x LENGTH
For this I have to convert the THICKNESS, WIDTH and LENGTH variables into the STRING types.
How to get the values converted into sting type?
There is one function available called "itos" but it converts the decimals into the nearest integer.
I want the exact number with decimals to be converted in the string, so that I can write the required relation by concatenating following things :
PLATE_SIZE = string(THCKNESS) + "x" + string(WIDTH) + "x" + string(LENGTH)
Can someone please help me in converting the values into strings, or any work around for my requirement of PLATE_SIZE?
Thanks in advance,
Sachin Mahajan
Solved! Go to Solution.
The function you need to use is ITOS (integer to string). For real numbers, it becomes a bit more complicated. Here are some links:
http://communities.ptc.com/thread/34257
The function you need to use is ITOS (integer to string). For real numbers, it becomes a bit more complicated. Here are some links:
http://communities.ptc.com/thread/34257
In your annotation, add "[.2]" if you want 2 place decimals. This way you can use the numbers and have rounded values...
you can try x=.123456789 in relations and create an annotation &x[.4] will return a number .1235
So you can create relation plate_size=d4*d5*d6 and annotion &plate_size[.1] sq in
or... set thickness=d4, width=d5, and length=d6 in relations and make the annotation string "PLATE SIZE = &THICKNESS[.1] x &WIDTH[.1] x &LENGTH[.1]