Hello everyone, I am relatively new to using the pro/program within Creo assemblies and I have having a lot of trouble to accomplish what I feel is a simple task. Below is what I have written in the input & relations sections of the upper level assembly Pro/Program.
INPUT
DEFAULT_LOCATIONS YES_NO
"Place all components in locations used for MPIs (ANSWER YES BEFORE SAVING!)?"
IF DEFAULT_MPI_LOCATIONS = YES
GANTRY_X_DISTANCE:3 = 757.2552
CAMERA_Y_DISTANCE:269 = 350.000
Z_HEIGHT:273 = 313
ELSE
GANTRY_X_DISTANCE:3 NUMBER
"Enter Gantry X-Direction [mm]"
CAMERA_Y_DISTANCE:269 NUMBER
"Enter Camera Y-Direction [mm]"
Z_HEIGHT:273 NUMBER
"Enter the Camera Z-Height [mm]"
END IF
END INPUT
I am wanting the following to take place: When the assembly is regenerated and I click “Select All” from the “Input Selection Menu Manager” A prompt will come up asking the yes or no question: “Place all components in locations used for MPIs (ANSWER YES BEFORE SAVING!)?”. If I select “Yes”, I want the following variables (dimensions) to have the values as shown:
GANTRY_X_DISTANCE:3 = 757.2552
CAMERA_Y_DISTANCE:269 = 350.000
Z_HEIGHT:273 = 313
If I select No, I want to be able to enter the dimension value for the three variables listed above. This seems very straight forward, but when I run the code as shown above and answer YES to the “DEFAULT_MPI_LOCATIONS” question, it WILL NOT assign the values as the coding says it should. After doing this, when I go back and look at the Pro/Program coding, Everything I have shown in red text above disappears from the pro/program coding. When I regenerate and answer NO to the “DEFAULT_MPI_LOCATIONS” question, I can enter the variable (dimension) values individually, as intended.
I have tried playing with the “MODIFY” command, I have tried using different variables to assign the default location values, and have tried defining the default location values in the “Relations” section of the coding with no luck.
Can someone please help me find a way for the three variable to have an assigned value when the DEFAULT_MPI_LOCATIONS = YES, and be able to input the values when DEFAULT_MPI_LOCATIONS = NO???
Thank you all for your time and for your replies.
-Cameron
INPUT
DEFAULT_LOCATIONS YES_NO
"Place all components in locations used for MPIs (ANSWER YES BEFORE SAVING!)?"
IF DEFAULT_MPI_LOCATIONS = YES
GANTRY_X_DISTANCE:3 = 757.2552
CAMERA_Y_DISTANCE:269 = 350.000
Z_HEIGHT:273 = 313
ELSE
GANTRY_X_DISTANCE:3 NUMBER
"Enter Gantry X-Direction [mm]"
CAMERA_Y_DISTANCE:269 NUMBER
"Enter Camera Y-Direction [mm]"
Z_HEIGHT:273 NUMBER
"Enter the Camera Z-Height [mm]"
END IF
END INPUT
I am wanting the following to take place: When the assembly is regenerated and I click “Select All” from the “Input Selection Menu Manager” A prompt will come up asking the yes or no question: “Place all components in locations used for MPIs (ANSWER YES BEFORE SAVING!)?”. If I select “Yes”, I want the following variables (dimensions) to have the values as shown:
GANTRY_X_DISTANCE:3 = 757.2552
CAMERA_Y_DISTANCE:269 = 350.000
Z_HEIGHT:273 = 313
If I select No, I want to be able to enter the dimension value for the three variables listed above. This seems very straight forward, but when I run the code as shown above and answer YES to the “DEFAULT_MPI_LOCATIONS” question, it WILL NOT assign the values as the coding says it should. After doing this, when I go back and look at the Pro/Program coding, Everything I have shown in red text above disappears from the pro/program coding. When I regenerate and answer NO to the “DEFAULT_MPI_LOCATIONS” question, I can enter the variable (dimension) values individually, as intended.
I have tried playing with the “MODIFY” command, I have tried using different variables to assign the default location values, and have tried defining the default location values in the “Relations” section of the coding with no luck.
Can someone please help me find a way for the three variable to have an assigned value when the DEFAULT_MPI_LOCATIONS = YES, and be able to input the values when DEFAULT_MPI_LOCATIONS = NO???
Thank you all for your time and for your replies.
-Cameron