Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creo 10 Pro/program Problems

Status
Not open for further replies.

pmbov

Mechanical
Apr 5, 2011
28
Hi fellow Creo Users,
I am currently running Creo 10. I have a situation where I need to create a Pro/program. And for some reason I can not get it to function correctly.

I have gone through many examples on this site and via the google with little luck getting this to function correctly.

I have a 3 part assembly, my first part (BASE) is fixed constrained via X, Y, Z. My second part (screw assy) is fully constrained, and a dimension is given called D33=ball_to_ball. My third part is a “spring” that is flexible by a measurement.

I want to create a pro/program that changes the ball_to_ball with 4 different values.

INPUT
Position1 YES_NO
“Do you want position 1?”
Position2 YES_NO
“Do you want position 2?”
Position3 YES_NO
“Do you want position 3?”
Position4 YES_NO
“Do you want position 4?”
END INPUT

RELATIONS
Position1=10.00
Position2=40.00
Position3=30.00
Position4=60.00

BALL_TO_BALL = POSITION1
IF POSITION1 == NO
ELSE

BALL_TO_BALL = POSITION2
IF POSITION2 == NO
ELSE

BALL_TO_BALL = POSITION3
IF POSITION3 == NO
ELSE

BALL_TO_BALL = POSITION4
IF POSITION4 == NO
ELSE

ENDIF
ENDIF
ENDIF
ENDIF

END RELATIONS

What I am trying to accomplish is the user to pick the known position required to represent the assembly they desire. By answering yes or no to the prompts them to move on to the next position. The positions values are fixed by the design.

Sorry for the long explanation. Any help would be greatly appreciated!
 
Replies continue below

Recommended for you

Are you actually using the same variable name for both the yes/no result and the distance?

Also this looks backwards

BALL_TO_BALL = POSITION1
IF POSITION1 == NO
ELSE

should be

IF POSITION1 == YES
BALL_TO_BALL = POSITION1
ENDIF

However, the variable names should be

IF POSITION1 == YES
BALL_TO_BALL = DISTANCE1
ENDIF

and so on.
 
oh darn I did flip them.

Now I am getting errors....

INPUT
POSITION1 YES_NO
!*** ERR: line contains a bad symbol or is otherwise invalid
“DO YOU WANT POSITION1?”
!*** ERR: line contains a bad symbol or is otherwise invalid

Same for the others

RELATIONS
IF POSITION1 == YES
!*** ERR: Relation has an error.
BALL_TO_BALL = POSITION1
ELSE

Same for the others

Are my variables wrong?

not sure I understand where you added distance1, was that a new variable?

My end goal is to have the user pick from 1 of the 4 possible options. Similar to:

if the user does not wont position1 then they select no and it moves to the next option position2 and so on. eventfully looping back to position1 again.

 
If the model already has a parameter called "Position1" and that parameter is already a number, then you cannot reuse it as a boolean (YES_NO) variable.


ProProgram doesn't loop. It won't go back.
 
Ok thank you for taking the time to reply.

I created another work around. But I do see my mistake.

Thanks for your help!!
 
Reusing the variable.

Plus I could not get the inputs (YES_NO) to work so I just did number and the did position1 = 1, position2 = 2, etc.

Then used ball_to_Ball with a value for each position.

First I defined the variables Distance_1 (as you said) = #, etc

If position = 1
ball_to_Ball = Distance 1
else


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor