Skip to main content
17-Peridot
May 16, 2017
Solved

Relation in Drawing

  • May 16, 2017
  • 1 reply
  • 3668 views

My requirement is something like below in the drawing:

 

IF PTC_WM_LIFECYCLE_STATE == "Prototype Released"

PART_NUMBER = PART_NUMBER "X"

ENDIF

 

Ex: If state = Prototype Released then Part number is 12345678X

Else 12345678

 

Iam not able to make this work.

Is this possible? Anybody to help me?

Best answer by BenLoosli

Every regen recalculates the relations, so the extra 'X' will get added.

Try this syntax:

IF PTC_WM_LIFECYCLE_STATE == "Prototype Released"

New_part_number = Part_number +'X'

else

new_part_number = Part_number

endif

1 reply

17-Peridot
May 16, 2017

Now I tried the below:

IF PTC_WM_LIFECYCLE_STATE == "Prototype Released"

PART_NUMBER = PART_NUMBER + "X"

ENDIF

Now the funny thing is every time the drawing or model regenerates it adds one X at the end of part number.

Now my part number looks like 12345678XXXXXXXXXXXXX

12-Amethyst
May 16, 2017

Perhaps try 'if it is prototype released, and the part number does not end in X, then add X'?  As I recall, you use string length and extract to check 'ends in X'

17-Peridot
May 16, 2017

The problem is Iam not able to build a working syntax....

How do I use string length in relations?