Creo NC 판금 > CL Command Syntax Menus > Creating Definition Files
Creating Definition Files
The rules for creating a menu definition file are:
Each entry (except the first) must contain a valid APT syntax string, starting with the word begin and terminated with the word end.
The first entry, also contained between begin and end, must be the "topic name", which will appear in the topic index cmd edit menu.
The syntax string must start with a major keyword (such as CYCLE, GOTO, etc.). If parameters (minor keywords or user input) are required, they must follow after the slash (the slash may be replaced by a blank space).
Example: CYCLE/BORE
If the parameter is a value that should be input at run time, it must be preceded with a pound sign (#).
Example: CLDIST/#CLDIST
Normally, the major keyword will appear as the second-level cmd edit menu option. However, you can specify a different word for the menu option, by inserting it in curly brackets { } between the major keyword and the slash. For example:
All optional parameters should be included in square brackets [ ]. If an optional parameter has attributes, they must be included in the same brackets.
For example: CYCLE/BORE [,RAPTO,#RAPTO_r]
If some of the options are mutually exclusive, they must all be included in the same brackets, and separated by pipe "|".
For example: CYCLE/BORE [,IPM|,MMPM|,IPR|,MMPR,#FEDRAT_f]
To specify multiple input, use "...". Any value followed by "..." will be prompted for repeatedly, until you enter <CR> without supplying a value.
For example: CYCLE/AUTO,DEEPBK,#FEDTO_z,#FEDRAT_f[,INCR,#INCR_d...]
To change the order of precedence when parsing the parameters, use parentheses. The default order of precedence is from left to right.
For example: CYCLE/BORE[,IPM|,MMPM|,IPR|,(MMPR,#FEDRAT_f)]
results in specifying the FEDRAT_f value only for MMPR, whereas without the parentheses each of the mutually exclusive options will have the FEDRAT_f attribute.
Syntax Reference Table
The following is a quick syntax reference table. See the set of rules above for detailed usage explanations and examples.
Symbol
Usage
/
Separates the major command word from the parameters (minor keywords or user input). May be replaced by a blank space.
,
Separates the parameters.
[]
Encloses optional parameters.
|
Separates mutually exclusive parameters.
()
Changes the order of precedence when parsing the parameters.
{}
Used to specify a menu option name other than the major keyword.
# label
Precedes a parameter value that must be input at run time. Label is used in the prompt.
<>label
Precedes a string of text that must be input at run time. Label is used in the prompt.
...
Designates multiple input. The previous label will be prompted for until a blank line is entered.
Menu Syntax
When creating your own definition files, keep in mind that the words appearing in the cmd edit menus must comply with the Creo Parametric menu syntax. Each item must be unique in the menu. For example, if you have two different commands with the same major keyword, specify an alternate name in the curly brackets { } for at least one of them.
The maximum number of characters in a menu item allowed by the system is 19. You may want to use only 12 characters to fit in the standard Creo Parametric menu, or modify your menu width.
* 
Because of proportional text width on SUN workstations, the number of uppercase characters that will fit in the standard Creo Parametric menu may be less than 12.
Compiling Definition Files
When all the definition files are created, they must be compiled to transfer them to the .syn files. The command to compile a definition file is:
pro_mcs_comp < filename.def
options:
-p
print the results. The menu tree of the compiled file will be output on the screen. If there are any errors, the compiler will inform you, otherwise a message: Finish (reading) NO ERRORS will be output to the screen before the menu tree creation.
-i
specify the filename,pro_mcs_comp -i filename.def
The compiler creates the corresponding .syn file in your current directory.
* 
The pro_mcs_comp command is located in the obj subdirectory of the machine-specific directory under the Creo Parametric loadpoint, for example creo/sun4/obj/pro_mcs_comp.
Index File
The index file cmdsyn.ndx must contain the names (including the extension) of all the .syn files created. This file basically defines the contents of the first, index, cmd edit menu. The first entries of the files included in the cmdsyn.ndx file will appear as options in the index cmd edit menu, and as you select an option, the appropriate second-level cmd edit menu will be displayed.
도움이 되셨나요?