Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- Creo Parametric
- :
- 3D Part & Assembly Design
- :
- Adding Relations

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-22-2015
04:50 AM

01-22-2015
04:50 AM

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.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-22-2015
01:02 PM

01-22-2015
01:02 PM

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

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-22-2015
01:02 PM

01-22-2015
01:02 PM

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-22-2015
06:07 PM

01-22-2015
06:07 PM

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]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-19-2015
08:40 AM