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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

How can I use greater than/less than symbol in Creo relations?

simran
6-Contributor

How can I use greater than/less than symbol in Creo relations?

Hello all,

(Image is attached for clarification)

 

I am having a problem in using creo relations, I want to display overall dimension of a part in a specific way, that if lets say Length(Lg) is greater than Width(Wi) then it shoudl be display like this in drawing when the dimension display parameter is called; Ti x Wi x Lg and if width is greater than length then; Ti x Lg x Wi. In short greater value should be in the last. For that purpose I am using if statement and applying greater than and less than symbol. Can someone please help me understand what am i doing wrong?

Please refer to the image for clarification.

 

also please let me know how can i call current date into drawing? and its format too. My parameter defined for date in title block table is &BEARB_DAT, for now I am manually inputting date in the table, but I want to enter it automatically.

PLEASE HELP!

1 ACCEPTED SOLUTION

Accepted Solutions
TomU
23-Emerald IV
(To:TomU)

Lg = itos(L)
Wi = itos(W)
Ti = itos(T)

IF L >= W
    ABMESSUNG = "BI " + Ti + "x" + Wi + "x" + Lg
ELSE
    ABMESSUNG = "BI " + Ti + "x" + Lg + "x" + Wi
ENDIF

Keep in mind that the ITOS function automatically rounds fractional values.  If you need to keep the decimal place, see Converting Real Numbers to Strings.

View solution in original post

6 REPLIES 6
TomU
23-Emerald IV
(To:simran)

These comparison operators do not works for strings.  You need to evaluate them before you use the ITOS function (and convert them to strings.)

simran
6-Contributor
(To:TomU)

and how to do that? I am sorry i am quite new in relations

TomU
23-Emerald IV
(To:TomU)

Lg = itos(L)
Wi = itos(W)
Ti = itos(T)

IF L >= W
    ABMESSUNG = "BI " + Ti + "x" + Wi + "x" + Lg
ELSE
    ABMESSUNG = "BI " + Ti + "x" + Lg + "x" + Wi
ENDIF

Keep in mind that the ITOS function automatically rounds fractional values.  If you need to keep the decimal place, see Converting Real Numbers to Strings.

simran
6-Contributor
(To:TomU)

ok thanks alot,that seemed to work fine...:)

can u also tel me about the date question i asked at the end?

TomU
23-Emerald IV
(To:simran)

Date is trickier.  There is currently no method that will allow you to pull the current date into a parameter in Creo.  There are only three options that I know of:

  1. Manually enter the date like you are doing now.  This is the only way to get a static value that is guaranteed to not change.
  2. Use &todays_date in a table cell on the drawing format or drawing template.  When the drawing is first created it will automatically resolve to the current date.  Keep in mind that after it's resolved it becomes plain text.  If the format is reapplied and the tables overwritten, this will revaluate again to the current date.
  3. If you are using a PDM system like Windchill, there will be system level parameters that you can use to display the date.  The problem with these though is that they will automatically change based on and new revision creation.
simran
6-Contributor
(To:TomU)

ok that helped alot..thank you so very much Tom...:)

Top Tags