Skip to main content
3-Newcomer
July 2, 2020
Solved

Pro-Program IF statement question

  • July 2, 2020
  • 1 reply
  • 6218 views

Hello,

Looking for help with Pro-Program IF statement.  I have a part model that has 2 different bolt hole patterns.  I would like to turn off or suppress the larger bolt pattern when the diameter is below a certain size.  For instance;

If diameter d37 <= 5.500, turn off or suppress pattern 2, else leave pattern 2.

I greatly appreciate the help,

Steve

Best answer by avero

First you should create a real number parameter called something like PART_DIAMETER and attach it to the diameter using relations. In relations you would either type PART_DIAMETER=dxxx or dxxx=PART_DIAMETER (you will find the dxxx value by clicking on the extrude sketch while in relations), depending on whether you want to control the diameter by changing the parameter or have the parameter change based on whatever value you put in the extrude sketch.

 

After that you open Pro-Program, locate the larger bolt hole pattern and type IF PART_DIAMETER<=5500 right before the ADD FEATURE (initial number xx) text that Creo has generated. Finally you locate END ADD and type in END IF after that. Make sure you get both the hole and the pattern you want to suppress in between the IF statement and END IF.

 

It should look something like this:

 

IF PART_DIAMETER<=5500

ADD FEATURE (initial number xx)

feature ID, parents, dimensions etc.

END ADD

END IF

1 reply

avero1-VisitorAnswer
1-Visitor
July 3, 2020

First you should create a real number parameter called something like PART_DIAMETER and attach it to the diameter using relations. In relations you would either type PART_DIAMETER=dxxx or dxxx=PART_DIAMETER (you will find the dxxx value by clicking on the extrude sketch while in relations), depending on whether you want to control the diameter by changing the parameter or have the parameter change based on whatever value you put in the extrude sketch.

 

After that you open Pro-Program, locate the larger bolt hole pattern and type IF PART_DIAMETER<=5500 right before the ADD FEATURE (initial number xx) text that Creo has generated. Finally you locate END ADD and type in END IF after that. Make sure you get both the hole and the pattern you want to suppress in between the IF statement and END IF.

 

It should look something like this:

 

IF PART_DIAMETER<=5500

ADD FEATURE (initial number xx)

feature ID, parents, dimensions etc.

END ADD

END IF

24-Ruby III
July 3, 2020

Hi,

it is not necessary to create a parameter.

1.] user can use IF dxxx<=5500 notation

2.] user can rename dimension symbol from dxxx to PART_DIAMETER and use IF PART_DIAMETER<=5500 notation

 

1-Visitor
July 3, 2020

Ok, then I learned something myself, thanks!