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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to write relation

John.Pryal
12-Amethyst

How to write relation

Hi all,

i have been trying to figure out how to write a relation, but without success. I have a parameter P1 which has a string value of 2A. I am trying to make the diameter of a cylinder = 102mm if P1 = 2A, so how do i write this? I tried the following but it did not work

IF(P1==2A)

d233=102

ENDIF

I guess a string value cannot be used in a relation in this way.

Regards

John

1 ACCEPTED SOLUTION

Accepted Solutions

Hello John.

In to relation you can write a parameter with string value - do you need add an apostrophe - in your case: '2A'

For example:

IF(STRING_PARAM=='2A')
d6=d4
ENDIF

string-rel.png

Note: you can not use P1 parameter - this parameter is reserved by system

Best Regards,
Vladimir Palffy

View solution in original post

2 REPLIES 2

Hello John.

In to relation you can write a parameter with string value - do you need add an apostrophe - in your case: '2A'

For example:

IF(STRING_PARAM=='2A')
d6=d4
ENDIF

string-rel.png

Note: you can not use P1 parameter - this parameter is reserved by system

Best Regards,
Vladimir Palffy

Thank you Vladimir, that worked for me.

Best Regards

John

Announcements
Business Continuity with Creo: Learn more about it here.

Top Tags