cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Relations

SOLVED
Sachin
Newbie

Adding Relations

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


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.
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Adding Relations

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

http://communities.ptc.com/thread/39345

http://www.eng-tips.com/viewthread.cfm?qid=322989

View solution in original post

3 REPLIES 3

Re: Adding Relations

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

http://communities.ptc.com/thread/39345

http://www.eng-tips.com/viewthread.cfm?qid=322989

View solution in original post

Re: Adding Relations

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]

Re: Adding Relations

The following picture explains how to get around not having a rtos function.

Announcements