Skip to main content
12-Amethyst
July 11, 2023
Solved

counter in relations

  • July 11, 2023
  • 3 replies
  • 1795 views

Hello everyone,
I have a question about how relationships work,
I can't find a counter / value increment function.
The ideal in my case would have been a FOR or WHILE function unfortunately there is no WHILE or FOR function in CREO relatio,ns.
My question is, is there a function that could be an alternative?
I have about 50 units and doing a 1 by 1 program doesn't suit me.

Thank you for reading.

find attached my relation I want to change

 

 

Best answer by KenFarley

Relations are a "single pass" type of processing. The relations you define are evaluated in the order in which you define them, once, every time the model is regenerated. There is no looping functionality, like DO WHILE,  FOR, or REPEAT UNTIL, etc. As a result, trying to calculate something like the appropriate "old style" fraction for a dimension (0.125 -> 1/8, etc.) requires a really tedious bunch of IF statements.

It's not so much a programming "language" as an instruction queue, I guess.

3 replies

tbraxton
22-Sapphire II
July 11, 2023

You will need to use functionality other than relations to loop. Creo is capable of calling external scripts or you can use one of the Creo APIs (Toolkit). Visual Basic, C , & Java are supported to various degrees in the APIs.

KenFarley
KenFarley21-Topaz IIAnswer
21-Topaz II
July 11, 2023

Relations are a "single pass" type of processing. The relations you define are evaluated in the order in which you define them, once, every time the model is regenerated. There is no looping functionality, like DO WHILE,  FOR, or REPEAT UNTIL, etc. As a result, trying to calculate something like the appropriate "old style" fraction for a dimension (0.125 -> 1/8, etc.) requires a really tedious bunch of IF statements.

It's not so much a programming "language" as an instruction queue, I guess.

12-Amethyst
July 13, 2023

Hi, sometimes you can solve this using patterns. Relations that involve pattern dimensions can be propagated through the pattern.

How do you want to apply the RLX parameters?