About an Interactive C Program
You can create your own interactive program to drive model geometry through relations. Consider the following information on creating user programs:
The User Prog command is available only in Part and Sketcher modes.
Only one user program may be edited or run at a time. However, you can write multiple programs for each part and then run them sequentially.
Each program is limited to a single entry subroutine, called "USRMAIN ()." The entry subroutine can call other subroutines in that program file.
Creo Parametric provides a C file template usermain.c to help you write and use user programs.
You must capitalize Creo Parametric dimensions in user programs.
Use D[i] to refer to a dimension on the screen. This symbol corresponds to di in Part or Assembly mode or to sdi in Sketcher mode. The system does not accept a user-assigned symbol name, such as width, instead of the system-assigned dimension symbol.
Do not use exit statements in any of your routines. To build error handling into your program, use printf or fprintf statements.
You cannot drive assembly dimensions or pattern instance numbers using user programs.
To use an interactive program, you must complete the following steps:
1. Create a program. Alternatively, you can create a program by editing an existing program.
2. Compile and link the program.
3. Run the program to implement the changes.
4. When the program is finished running, regenerate the model to update geometry.