Skip to main content
1-Visitor
Apr 26, 2017 10:51 AM UTC
Solved

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!

TomU
TomUAnswer
23-Emerald IV
Apr 26, 2017 11:29 AM UTC

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.

6 replies

TomU
23-Emerald IV
Apr 26, 2017 11:17 AM UTC

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

Translate
simran1-VisitorAuthor
1-Visitor
Apr 26, 2017 11:26 AM UTC

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

Translate
TomU
23-Emerald IV
Apr 26, 2017 11:37 AM UTC

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.
Translate
simran1-VisitorAuthor
1-Visitor
Apr 26, 2017 12:23 PM UTC

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

Translate