You are on page 1of 8184

Admin Guide

Release 9.0 (for Creo 4.0 - 9.0)


Introduction
This documentation focuses on the customization of SmartAssembly and
on the implementation of customer specific components. It is
recommended to read the User Guide first, to become experience with
capabilities and graphical elements of SmartAssembly.
The Admin Guide includes a description of template parts and all
about the description language for components.
Contents
Template parts
Structure of Component Library
Scripting language
Release Notes SmartAssembly 9.0
This topic reflects the enhancements in description language. More
information about the latest work is available at:
https://dl.buw-soft.de/smartassembly/9.0/Changelog.html
Latest dll: 2022-07-21-01.
Customizing Project Templates
Project template parts are stored in the folder
<SmartAssembly>\Library\parts.
The sub-folder default contains project templates consisting of a
main model with sub models. This is used for creating a new project
by the option for creating projects based on a Creo Elements/Pro
model.
In case the complete content of a folder should be used as a project
template the button offer a dialog to specify the complete sub
folder inside <SmartAssembly>\Library\parts.
The button can be used to retrieve templates from a connected
Pro/INTRALINK or PDMLink session. With the radio button Copy folder
or Copy model, you can decide if the complete folder is to be copied.
By use of the configuration option TEMPLATE_PATH the templates could
be located in another directory. See the User Guide for more
information.
The main model should contain the string parameters BUW_PROJECT_SHORT
and BUW_PROJECT_NAME.
Project Name declares the new project name and Project Short provides
a mechanism for naming convention of components which will be
assembled to the project.
To Create a new template with the requires parameter the following
procedure is useful:
Create the required assemblies, parts and drawings in Creo
Elements/Pro
Rename the top level assembly or part to the desired project name.
Rename all components in the top level model which should be
renamed when using the project template. They should contains the
project short. For example proj_clamp.prt, proj_lifter.prt etc.
Rename all the drawings to have the same name as the model which
shows up in the drawing.
Click SmartAssembly > Project > Create and activate the option
Use current part or assembly.
Specify Project Name and Project Short according to the names used
in the previous steps.
Save the models to the project folder.
<SmartAssembly>\Library\parts\udf contains standard UDFs. It is not
recommended to change these UDFs. New UDFs which should be used by
different library components, could be stored to this folder.
Content of library structure
The complete component library is stored in
<SmartAssembly>\Library\component_engine. All components are either
stored directly in these folders or in subfolders. The component
description consists of the following files:
Creo Elements/Pro models like parts, assemblies, drawings, MFGs,
UDFs, ...
These are used as templates for the components that should be
created.
Drawings what should be associated with a part or assembly needs
to have the same name.
UDFs which could inserted by the description language.
UDFs could also be stored in <SmartAssembly>\Library\parts\udf
for use as standard UDFs.
Graphic files (.gif, in case the configuration option
IMAGE_GRAPHICS is set to GDIPLUS, also .bmp, .jpeg, .jpg, .tif,
.tiff)
Image files are displayed in the graphical interface.
Component description files (.tab)
Assembling description
Dimension tables
Component description
Interface description
Dependency description
Selection list (sel_list.txt)
Describes structure of library and the way the component
description files are interpreted.
To get unique names the name of the directory can be added in
front. For example 'sample_sel_list.txt' in case the file is
located in the directory 'sample'.
Bill of material (param_relation.txt)
Describes parameters for bill of material.
Graphic files
Graphics files are regular gif images (in case the configuration
option IMAGE_GRAPHICS is set to GDIPLUS, also .bmp, .jpeg, .jpg,
.tif, .tiff ), created by arbitrary third party software packages.
These Graphic files could be used in the GUI when assembling the
component or as thumbnail while navigating through the components.
Thumbnails are scaled to a specific width. For avoiding quality loss
in re-scaling it is recommended to create the thumbnail in expected
width.
Thumbnail for directories: re-scale to width of 80 pixels
Thumbnail for components: re-scale to width of 100 pixels
Image size in the component interface: no re-scale.
Component description files
Component description files have the file extension .tab. The are
structured in five different blocks – assembly description, graphical
user interface, table description, component description and
dependency description. Each block is introduced and completed by
specific tags which are shown below:
Assembly description block: BEGIN_ASM_DESCR ... END_ASM_DESCR
Graphical user interface block: BEGIN_GUI_DESCR ... END_GUI_DESCR
Table description block BEGIN_TAB_DESCR ... END_TAB_DESCR
Component description block: BEGIN_COMP_DESCR ... END_COMP_DESCR
Dependency description block: BEGIN_DEP_DESCR ... END_DEP_DESCR
The assembly description block is required for a main component since
it defines the start point where the file is executed. Assembling
description block and graphical user interface block are build up
with a special scripting language which provides mechanisms to access
and modify Creo Elements/Pro parameters, create UDFs, place
components, add items on drawings etc.
The table description block defines tables for the graphical user
interface which could be selected by the user. As example valid
dimensions or the name of a family table instance could be driven by
these tables.
In case a main assembly should be configured together with different
parts / sub assemble the component description block provides the
required mechanism. It links the component description file of the
main component to the one from the sub component. Information could
be passed to the sub component and retrieved after this was
processed. It is also possible to delete non required sub components.
In some situations it is required to copy additional files which are
not dependent from the main component to the current project.
Examples for this are manufacturing models or other files like word
documents or excel spread sheets. This information is described in
the dependency description block.
More information about these blocks is provided in the script
language chapter.
Version mechanism
Component description files can also be supplied in different
versions. This is important for the modification functionality of old
components. Compared with Creo Elements/Pro, the version number is
before the extension. For example sample.2.tab.
When creating new components, always the highest version number is
used. For modification the original version is used, in case it is
available. Otherwise it falls back to previously available versions.
Selection list
Each folder contains the selection list sel_list.txt which defines
either how a component description file should be interpreted or
declares new sub directories.
The following options are supported:
<directory_name> dir
Defined a sub directory called <directory_name>
In case an image <directory_name> is available, it will be shown
in the interface.
Make sure the directory is existing!
<component_name> part
This option is used for standard parts. In case the program is
executed several times, the same Creo Elements/Pro part will be
assembled multiple.
A component description file with name <component_name>.tab will
be executed.
<component_name>.prt is required as template for then main
component.
In case an image <component_name> is available, it will be shown
in the interface.
If a drawing called <component_name>.drw is available, it is
renamed according the part and copied to the project.
<component_name> part_copy
This option is used for non-standard parts. In case the program
is executed several times, different Creo Elements/Pro parts will
be assembled.
A component description file with name <component_name>.tab will
be executed.
<component_name>.prt is required as template for then main
component.
In case an image <component_name> is available, it will be shown
in the interface.
If a drawing called <component_name>.drw is available, it is
renamed according the part and copied to the project.
<component_name> asm
This option is used for standard assemblies. In case the program
is executed several times, the same Creo Elements/Pro assembly
will be assembled multiple.
A component description file with name <component_name>.tab will
be executed.
<component_name>.asm is required as template for then main
component.
In case an image <component_name> is available, it will be shown
in the interface.
If a drawing called <component_name>.drw is available it will be
renamed according the model and copied to the project. In case a
drawing with an equal name to a sub assembly / sub part exists it
will also be considered.
In case a manufacturing model is available, this is be used
instead of the assembly.
<component_name> asm_copy
This option is used for non-standard assemblies. In case the
program is executed several times, different Creo Elements/Pro
assemblies will be assembled.
A component description file with name <component_name>.tab will
be executed.
<component_name>.asm is required as template for then main
component.
In case an image <component_name> is available, it will be shown
in the interface.
If a drawing called <component_name>.drw is available it will be
renamed according the model and copied to the project. In case a
drawing with an equal name to a sub assembly / sub part exists it
will also be considered
Sub components inside a asm_copy program could be defined as
standard components by applying the Creo Elements/Pro component
string parameter BUW_NO_COPY with content y.
in case a manufacturing model is available, this will be used
instead of the assembly.
<component_name> mfg
This option is used for manufacturing models. In case the program
is executed several times, the same Creo manufacturing model will
be assembled multiple.
A component description file with name <component name>.tab will
be executed.
<component_name>.mfg or <component_name>.asm is required as
template for the main component.
In case an image <component_name> is available, it will be shows
in the interface.
If a drawing called <component_name>.drw is available it will be
renamed according the model and copied to the project.
<component_name> mfg_copy
This option is used for manufacturing models. I case the program
is executed several times, different Creo manufacturing models
will be assembled multiple.
A component description file with name <component name>.tab will
be executed.
<component_name>.mfg or <component_name>.asm is required as
template for the main component.
In case an image <component_name> is available, it will be shows
in the interface.
If a drawing called <component_name>.drw is available it will be
renamed according the model and copied to the project.
<component_name> mfg_asm
Similar behavior as asm. In case of a manufacturing model, the
assembly will be used and not the manufacturing model.
<component_name> mfg_asm_copy
Similar behavior as asm_copy. In case of a manufacturing model,
the assembly will be used and not the manufacturing model.
<udf_name> udf
This option is used for all situation where no model should be
retrieved from the library. The most common application is to
insert UDFs.
A component description file with name <component_name>.tab will
be executed
In case an image <component_name> is available, it will be shown
in the interface.
<drawing_name> drw
This option is used for creating drawing details.
The current project model where the component description file
should work on must be a drawing.
A component description file with name <component_name>.tab will
be executed
In case an image <component_name> is available, it will be shown
in the interface.
In case drawings associated to a part or assembly library
component should be processed, special script commands allow to
enable this is a part, part_copy, asm or asm_copy program.
<link_name> link
This option is used to set a link to another tab file or
directory.
Links to other links are not allowed.
Links to tab files must include the .tab extension (e.g.
sample\sample.tab link).
exclamation mark (!)
An exclamation mark specifies a comment. This line is not executed
by the system.
hide
hide as keyword following a normal entry makes this entry
invisible. This could be used to avoid that users select program
files directly which only should be executed by CALL statements.
package
package as a keyword following a normal entry determines that a
called tab file runs separately in a modification command.
Bill of material
Bill of material information could be configured by the file
param_relations.txt in <SmartAssembly>\library\component_engine. This
file determines the bill of material parameters SAS_PART_NAME and
SAS_ORD_NUMBER.
Typically they are configured in the following manner:
SAS_PART_NAME = BUW_NAME
SAS_ORD_NUMBER = BUW_TYPE + BUW_SIZE
BUW_NAME, BUW_TYPE and BUW_SIZE are considered as parameter of the
library components. In case these parameters are not defined
SAS_PRT_NAME and SAS_ORD_NUMBER.
Beneath param_relations.txt in
<SmartAssembly>\Library\component_engine further param_relation.txt
files for specific sub directories in the library could be defined.
Localization of Graphical User Interface
Elements in the graphical user interface may be used in different
countries with different languages. Also it is often more user
friendly to provide names which differ from the internal variable
names and may include spaces. Therefor files with the name
component_engine.txt can be used to facilitate the localization.
Location of component_engine.txt
There are two different positions where to store the file
component_engine.txt for using it either globally for all components
in the library or only for components of a specific folder.
<Installation dir>\text\<language>\component_eninge.txt: for using
the translation for all components.
<library folder>\text\<language>\component_engine.txt: for using
the translation only for one library folder. This file has priority
over the global file.
As language the standard languages for Creo Elements/Pro are
supported. These are:
chinese_cn
chinese_tw
french
german
italian
japanese
korean
spanish
usascii
In case the current language is not available usascii will be used
instead.
Format of component_engine.txt
The format of the files is conform to the standard PTC file format
for translation.
Tag line to identify the word which is to be translated
Description line of the content. Often identical to the usascii
translation.
Translation line
<empty line>
Tag line
Description line
Translation line
...
Example
The following graphical user interface should be translated in
different languages:
BEGIN_GUI_DESCR
USER_INPUT_PARAM DOUBLE SCREW_LENGTH
USER_INPUT_PARAM DOUBLE SCREW_DIAMETER
END_GUI_DESCR
For translation in English language the following
component_engine.txt is available in <current folder>\text\usascii:
SCREW_LENGTH
Length of screw
Length of screw

SCREW_DIA
Diameter of screw
Diameter of screw
For translation in German language the following component_engine.txt
is available in <current folder>\text\german:
SCREW_LENGTH
Length of screw
Schraubenlänge

SCREW_DIA
Diameter of screw
Schraubendurchmesser
The dialog mask shows up in the following was depending on the
availability of component_engine.txt file and the language used for
Creo Elements/Pro.

Without translation files


With translation file and
Creo Elements/Pro running
in English language.

With translation file and


Creo Elements/Pro running
in German language.
Overview
The script language consists of commands, information elements and
control structures.
Commands
Commands are the main part of the description language. They start
with a keyword indicating the command name. Specific for each command
different arguments with options, input and output variables and
references follow.
Commands are available for the following tasks:
Retrieve information from Creo Elements/Pro
Process drawings
Create components, UDFs, cross sections, notes, etc.
...
Control structures
The flow of processing could be influenced by conditional statements,
loops and
via IF ... END_IF

and by loops FOR ... END_FOR, WHILE ... END_WHILE


Variables
The scripting language could handle different types of variables.
Parameter variables
Contain integer, double or string values. Boolean YES/NO parameters
in Creo Elements/Pro are handled as integer parameters with 0 for
NO and 1 for YES.
Reference variables
Describe references to entities in Creo Elements/Pro as surfaces,
edges, features, parts etc.
File descriptor variables
Describe file descriptors for reading and writing.
Array variables
Are a collection of variables. They can be accessed by specifying
an index of the element which should be accessed.
Map variables
Are a container for variable which are stored to a key name. They
can be accessed by specifying a key name. In case a variable of the
same key name already exists, this will be overwritten.
General variables
A general variable is either of type parameter, reference, file
descriptor or array. Therefor it is possible to store an array as
element of an array to get a 2 dimensional array. This is called a
sub array.
Structure variables
Structures are collections of variables which a specific name. Each
variable is a element of the structure and could have any of the
existing variable types. To access a element of the structure a dot
'.' is required. See the section Specify structures for more
information about the build in structures.
Terminology
Components and UDFs which are created by the same script file have a
common set of management data. These are called a SmartComponent.
Conventions
For a clear description of the different scripting language the
following typographic conventions are used
syntax meaning

Specifies that a reference, a parameter, a file or an


array, is used as an input value. That means they must be
<:in>
defined by a previous command. For some commands NULL is
allowed as empty value.
Specifies that a reference, a parameter, a file or an
array, is used as output value. After the command is
<:out> executed successfully the reference or parameter contains
a value. In case the reference or parameter is not
already existing, it will be created now.
Optional part of a command. The argument or clause could
[ ... ]
be specified, but is not mandatory.
... | ... |
Use one of the possibilities separated by | sign.
...
Double quotes: Textual expression. Could also be
"..."
specified by a string parameter or a string expression.
Ampersand: Only string parameter which a leading
&... ampersand are considered. Otherwise it will be regarded
as text. No string expression is evaluated.
Single quotes: Only text. No string parameter or string
'...'
expression is regarded.
Integer value. Could be specified by a math expression.
valueINT Double values will be rounded down to integer values.

valueDOUBLE Double value. Could be specified by a math expression.

valueBOOL Boolean value. Could be specified by a math expression.

Text, integer or double value. Could be specified by math


valueSTRNUM or string expressions.
A text word is either a text or a text parameter. It is
textWORD not build up as string expression. An ampersand & must be
used to indicate the parameter.
A value word is either a value or a value parameter. It
valueWORD is not build up as math expression.
A parameter word is either a parameter, a string or a
paramWORD value. It is not build up as math or string expression.
Any variable, either of type reference, parameter or
valueVAR array.
BOLD Keywords are written in bold capitals.

Keywords must be written in capitals, otherwise they will not be


detected. Even though upper and lower cases are not distinguished for
variables is it recommended to use lower cases. This will make a tab
program easier to understand for the user.
Modifiers
Modifiers in the component description file allow to enable or
disable parts of the program, to add information for the user and to
format the commands in a way to make is more readable for the users.
Supported modifiers are comments and line connectors.
Comments
In the different blocks of the component description files different
commands and specifications could be configured. The following
chapters provide a collection of all the commands of the scripting
language.
In any block the exclamation mark (!) introduces a command. The rest
of the line is just as information for the developer. It will not be
processed.
Commands covering an area which may include several command lines are
introduced by /* and terminated by */.
Line connectors
In some situations a single line in the component description file
could be come very long and hard to read. Therefor a backslash as the
end of a line could be used to indicate that two lines are connected.

example
The following statements have the same meaning:
Conventional way to write the command:
line1: MAPKEY " ~ Select `main_dlg_cur` `PHTLeft.AssyTree`1
`node5`;~ Activate `main_dlg_cur` `ProCmdDatumCsys.datum`;~
Activate `Odui_Dlg_00` `stdbtn_1`;"
Using line connectors to write the command:
line1: MAPKEY " ~ Select `main_dlg_cur` `PHTLeft.AssyTree`1
`node5`;\
line2: ~ Activate `main_dlg_cur` `ProCmdDatumCsys.datum`;\
line3: ~ Activate `Odui_Dlg_00` `stdbtn_1`;"
General Notes
Length restrictions for strings in Pro/ENGINEER / Creo
There are several length restrictions in Pro/ENGINEER / Creo about
strings.
31 characters: Model names, parameter names, ...
80 characters: String parameter content, ...
260 characters: max path size, ...
In case a string variable exceeds the limit it is automatically
shortened to the maximum length.
About the Assembly Description Block
The assembly description block is surrounded by the BEGIN_ASM_DESCR
and END_ASM_DESCR keywords. The first line is the start of the
complete script file processing. The commands are executed line by
line. When the last line is reached, the processing of the script
file is finished.
The assembly description block offers commands to the following
topics.
User input — commands for requesting information from the user.
Searching — commands for searching references, parameters and
dimension values.
Feature operations — commands for creating, removing and
manipulating features and UDFs.
Models — commands for assembling, regenerating, removing and
modifying models.
Data Sharing and Flexibility — commands to create data sharing
features and to make components flexible.
Measurement and Calculation — commands for measurement and
calculation, similar to the analysis functionality in Creo
Elements/Pro.
Retrieving information from Creo Elements/Pro — commands for
retrieving different types of information like names, types,
dependencies.
Writing information to Creo Elements/Pro — commands for writing
information to Creo Elements/Pro models, features, and dimensions.
Selection buffer — command to read and manipulate currently
selection in the selection buffer.
Data handling — commands for data handling via program variables.
Arrays — commands for declaration, reading from and writing to
arrays.
Maps — commands for declaration, reading from and writing to maps.
Output — commands for showing information for the user.
Modifying geometry — commands for modifying existing geometry.
Graphics and display — commands for modifying graphics and display
mode of a model.
File handling — commands for accessing and selecting files.
Relations — commands for creating feature or model relations.
Patterns — commands for reading and writing pattern information and
for creating reference patterns.
Family tables — commands for manipulating and to retrieving
information from family tables.
Drawing support — commands for automating drawing creating.
Control structures — commands for applying conditional elements of
a program, launching the graphical user interface, debug support
and error handling.
Runtime information — commands for runtime information of the
current program file execution.
Pro/NC — Commands for retrieving and setting information from and
to Pro/NC models.
Pro/PIPING — commands to read information from Pro/PIPING models.
Pro/SHEETMETAL — commands for Pro/SHEETMETAL models
Pro/PROGRAM — commands to retrieve, add and remove information from
Pro/PROGRAM models
Multi Body Support — commands for multi body support. These require
Creo 7.0 and above.
Inseparable Assembly Support — commands for inseparable assembly
support. These require Creo 8.0 and above.
Post Execution Functions — commands which are executed when the
control comes back to Creo.
Identifiers — commands to identify components and UDFs created by
the same program.
External Data — command to read, write and delete external data of
a model.
Interfaces — commands for launching mapkeys and starting external
applications.
About Commands for User Input
User input elements are typically placed in the graphical user
interface block to provide them in a dialog mask with graphical
elements. In some situations — for example when placing an existing
components — they are also used in the assembly description block.
The following commands are available.
USER_SELECT — to select a reference in Creo Elements/Pro and
storing the information to a variable of type reference.
USER_SELECT_OPTIONAL — to let the user decide if the selection is
required or not.
USER_SELECT_MULTIPLE — to select multiple of reference in Creo
Elements/Pro and storing the information to an array of references.
USER_SELECT_MULTIPLE_OPTIONAL — to let the user decide if the
multiple selection is required or not.
USER_COLLECT — to select surface sets and edge or curve chains by
the help of the collection interfaces.
USER_INPUT_PARAM — to request a number or string input from the
user and storing the information to a variable of type parameter.
USER_YESNO_PARAM — to request a boolean decision from the user and
store it to a variable of type parameter.
GET_MOUSE_POINT — to let the user pick on the screen for a
position.
PASSWORD_DIALOG — to request login and password information.
USER_SELECT
Prompts the user to select a reference in the Creo Elements/Pro
model.
Syntax
USER_SELECT &type reference<:out> [options] ["tag"]
Arguments

type
The specified reference type. In case different types are allowed,
these should be concatenated by a pipe symbol '|'. String variables
introduces by the ampersand symbol & can also be used. See also the
information about parameter related reference types.

reference
Name of the reference which should receive the information.

options
FILTER_MDL refMdl<:in> | arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_FEAT reffeat<:in> | arrayFeats<:in> — to restrict the
selection to the specified features
FILTER_GEOM ref<:in> | arrayRefs<:in> — to restrict the selection
to items which are related to the specified geometry.
FILTER_REF ref<:in> | arrayRefs<:in> — to restrict the selection to
specified items.
FILTER_IDENTIFIER "identifier" — to restrict the selection to items
with a component engine identifier. Use "*" to accept all
identifiers.
SELECT_BY_BOX — to allow selecting by boxes. This is limited to
geometrical items and does not work on drawings.
SELECT_BY_MENU — to allow selecting by menu.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.

tag
Obsolete argument. This is just available to maintain backward
compatibility.
Error handling
The program execution will be canceled if the selection is canceled,
unless errors are handled by BEGIN_CATCH_ERROR.
In case errors are handled the behavior is identical to
USER_SELECT_OPTIONAL.
Note
Use a pipe '|' symbol to concatenate different selection types and
figure out by the command GET_REF_TYPE which is the selected type.
The following types can currently not be connected, since they
require a special handling:
PART
ASSEMBLY
INTENT_EDGE
INTENT_SURFACE
Example
USER_SELECT POINT placement_point
USER_SELECT AXIS | PLANE placement_orientation
USER_SELECT_OPTIONAL
Prompts the user to select a reference in the Creo Elements/Pro
model. The selection could be skipped.
Syntax
USER_SELECT_OPTIONAL &type reference<:out> [options] ["tag"]
Arguments

type
The specified reference type. In case different types are allowed,
these should be concatenated by a pipe symbol '|'. String variables
introduces by the ampersand symbol & can also be used. See also the
information about parameter related reference types.

reference
Name of the reference which should receive the information.

options
FILTER_MDL refMdl<:in> | arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_FEAT reffeat<:in> | arrayFeats<:in> — to restrict the
selection to the specified features
FILTER_GEOM ref<:in> | arrayRefs<:in> — to restrict the selection
to items which are related to the specified geometry.
FILTER_REF ref<:in> | arrayRefs<:in> — to restrict the selection to
specified items.
FILTER_IDENTIFIER "identifier" — to restrict the selection to items
with a component engine identifier. Use "*" to accept all
identifiers.
SELECT_BY_BOX — to allow selecting by boxes. This is limited to
geometrical items and does not work on drawings.
SELECT_BY_MENU — to allow selecting by menu.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.

tag
Obsolete argument. This is just available to maintain backward
compatibility.
Note
Use a pipe '|' symbol to concatenate different selection types and
figure out by the command GET_REF_TYPE which is the selected type.
The following types can currently not be connected, since they
require a special handling:
PART
ASSEMBLY
INTENT_EDGE
INTENT_SURFACE
Example
USER_SELECT_OPTIONAL POINT placement_point
USER_SELECT_OPTIONAL AXIS | PLANE placement_orientation
§
USER_SELECT_MULTIPLE
Prompts the user to select an array of reference in the Creo
Elements/Pro model.
Syntax
USER_SELECT_MULTIPLE &type max_selINT array<:out> [options] ["tag"]
Arguments

type
The specified reference type. In case different types are allowed,
these should be concatenated by a pipe symbol '|'. String variables
introduces by the ampersand symbol & can also be used. See also the
information about parameter related reference types.

max_sel
Maximum number of references to select. A negative number means an
arbitrary number of references can be selected.

array
Name of the array which should receive the information.

options
FILTER_MDL refMdl<:in> | arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_FEAT reffeat<:in> | arrayFeats<:in> — to restrict the
selection to the specified features
FILTER_GEOM ref<:in> | arrayRefs<:in> — to restrict the selection
to items which are related to the specified geometry.
FILTER_REF ref<:in> | arrayRefs<:in> — to restrict the selection to
specified items.
FILTER_IDENTIFIER "identifier" — to restrict the selection to items
with a component engine identifier. Use "*" to accept all
identifiers.
SELECT_BY_BOX — to allow selecting by boxes. This is limited to
geometrical items and does not work on drawings.
SELECT_BY_MENU — to allow selecting by menu.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.

tag
Obsolete argument. This is just available to maintain backward
compatibility.
Error handling
The program execution will be canceled if the selection is canceled,
unless errors are handled by BEGIN_CATCH_ERROR.
In case errors are handled the behavior is identical to
USER_SELECT_OPTIONAL.
Note
Use a pipe '|' symbol to concatenate different selection types and
figure out by the command GET_REF_TYPE which is the selected type.
The following types can currently not be connected, since they
require a special handling:
PART
ASSEMBLY
INTENT_EDGE
INTENT_SURFACE
Example
USER_SELECT_MULTIPLE POINT 2 arrayPoints
USER_SELECT_MULTIPLE AXIS | PLANE -1 arrayAxisOrPlanes FILTER_MDL
refMdl
§
USER_SELECT_MULTIPLE_OPTIONAL
Prompts the user to select an array of reference in the Creo
Elements/Pro model. The selection could be skipped.
Syntax
USER_SELECT_MULTIPLE_OPTIONAL &type max_selINT array<:out> [options]
["tag"]
Arguments

type
The specified reference type. In case different types are allowed,
these should be concatenated by a pipe symbol '|'. String variables
introduces by the ampersand symbol & can also be used. See also the
information about parameter related reference types.

max_sel
Maximum number of references to select. A negative number means an
arbitrary number of references can be selected.

array
Name of the array which should receive the information.

options
FILTER_MDL refMdl<:in> | arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_FEAT reffeat<:in> | arrayFeats<:in> — to restrict the
selection to the specified features
FILTER_GEOM ref<:in> | arrayRefs<:in> — to restrict the selection
to items which are related to the specified geometry.
FILTER_REF ref<:in> | arrayRefs<:in> — to restrict the selection to
specified items.
FILTER_IDENTIFIER "identifier" — to restrict the selection to items
with a component engine identifier. Use "*" to accept all
identifiers.
SELECT_BY_BOX — to allow selecting by boxes. This is limited to
geometrical items and does not work on drawings.
SELECT_BY_MENU — to allow selecting by menu.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.

tag
Obsolete argument. This is just available to maintain backward
compatibility.
Error handling
The program execution will be canceled if the selection is canceled,
unless errors are handled by BEGIN_CATCH_ERROR.
In case errors are handled the behavior is identical to
USER_SELECT_OPTIONAL.
Note
Use a pipe '|' symbol to concatenate different selection types and
figure out by the command GET_REF_TYPE which is the selected type.
The following types can currently not be connected, since they
require a special handling:
PART
ASSEMBLY
INTENT_EDGE
INTENT_SURFACE
Example
USER_SELECT_MULTIPLE_OPTIONAL POINT 2 arrayPoints
USER_SELECT_MULTIPLE_OPTIONAL AXIS | PLANE -1 arrayAxisOrPlanes
FILTER_MDL refMdl
§
USER_COLLECT
Allows to select surface sets and edge or curve chains by the help of
the collection interfaces.
Syntax
USER_COLLECT &type &method array<:out> [options]
Arguments

type
The specified collection type. String variables introduces by the
ampersand symbol & can also be used.

method
The specified collection methods. In case different methods are
allowed, these should be concatenated by a pipe symbol '|'. String
variables introduces by the ampersand symbol & can also be used.

array
Name of the array which should receive the information.

options
FILTER_MDL refMdl<:in> | arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_FEAT reffeat<:in> | arrayFeats<:in> — to restrict the
selection to the specified features
FILTER_GEOM ref<:in> | arrayRefs<:in> — to restrict the selection
to items which are related to the specified geometry.
FILTER_REF ref<:in> | arrayRefs<:in> — to restrict the selection to
specified items.
FILTER_IDENTIFIER "identifier" — to restrict the selection to items
with a component engine identifier. Use "*" to accept all
identifiers.
OPTIONAL — it is not required to select something.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.
Error handling
The program execution will be canceled if the selection is canceled,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_COLLECT SURFACE SURFACE_ALLOW_ALL arraySurfaces
USER_COLLECT EDGE CHAIN_ONE_BY_ONE | CHAIN_TAN_CHAIN arrayEdges
FILTER_MDL refMdl
USER_INPUT_PARAM
Prompts input from the user and stores the result to a parameter.
Syntax
USER_INPUT_PARAM parameter_type parameter<:out> [option]
Arguments

parameter_type
The specified parameter type.

parameter
Name of a parameter which should receive the value.

option
NO_UPDATE: prevents associated Creo Elements/Pro parameters or
dimension from being updated automatically after CONFIG_ELEM.
MODEL reference<:in>: Optional argument which specifies the owner
of the parameter. This argument is obsolete in assembling
description and it is just supported for backward compatibility of
the syntax.
Error handling
The program execution will be canceled if the input is canceled,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_INPUT_PARAM DOUBLE P
USER_INPUT_PARAM DOUBLE DM1
USER_YESNO_PARAM
Prompts a boolean decision from the user and stores the result to a
parameter. The information can either be entered as a text or by
using the buttons in the message line.
Syntax
USER_YESNO_PARAM parameter_type parameter<:out>
Arguments

parameter_type
The specified parameter type. In case of INTEGER or DOUBLE 1 is
supposed to be entered for confirming the decision and 0 for
declining it. in case of STRING any input starting with a 'N'
character is supposed to decline the decision and any other input
confirms it.

parameter
Name of a parameter which should receive the value.
Example
USER_YESNO_PARAM INTEGER flip
§
GET_MOUSE_POINT
Lets the user pick on the screen to return the pick position. The
command can be used as well on solid models as on drawings. For solid
models the depth is detected from the current view. The left mouse
button is used to pick the position. The command can be canceled by
the middle mouse button.
Syntax
GET_MOUSE_POINT reference_origin<:in> pos<:out>
Arguments

reference_origin
Determines the origin for measuring the point coordinates. The
following situations have to be regarded:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to the indicated model.

pos
Structure variable of type POINT will receive the result.
Error handling
The program execution will be canceled if the origin reference or the
point reference do not exist or the user cancels the command by the
middle mouse button, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Thought the command can be used to determine a position in a solid
model, the GET_REF_POS command is often the better solution. This
allows to get a selection position directly on an geometrical entity.
The main use of this command is in drawing mode.
Example
GET_MOUSE_POINT NULL pnt
CREATE_DRW_NOTE refDrawing pnt.x pnt.y "This is a note"
§
PASSWORD_DIALOG
Requests login and password information in the password dialog box.
Syntax
PASSWORD_DIALOG login<:out> password<:out>
Arguments

login
Variable of type string which receives the login information.

password
Variable of type string which receives the password information.
Error handling
The program execution will be canceled if the user cancels the
dialog, unless errors are handled by BEGIN_CATCH_ERROR.
Example
PASSWORD_DIALOG login password
PRINT "login: %" login
PRINT "password: %" password
About Commands for Searching
Commands for searching references, parameters or dimension values in
Creo Elements/Pro and store the result to variables of the program.
The following commands are available:
SEARCH_MDL_REF — to search for a reference of a specific type in a
Creo Elements/Pro model.
SEARCH_MDL_REFS — to search for several references in a Creo
Elements/Pro model.
SEARCH_FEAT_REF — to search for a reference of a specific type in a
Creo Elements/Pro feature.
SEARCH_FEAT_REFS — to search for several references in a Creo
Elements/Pro feature.
SEARCH_FEAT_PARAM — to search for a feature parameter in a Creo
Elements/Pro model.
SEARCH_REF_PARAM — to search for a parameter on a reference.
CHECK_COMMON_FEAT_PARAM — to checks if a parameter exists in an
array of feature references.
SEARCH_FEAT_PARAM_NAME — to search for a feature parameter of a
specific name.
SEARCH_FEAT_PARAM_NAMES — to search for feature parameters of a
specific name.
SEARCH_REF_PARAM_NAME — to search for a reference parameter of a
specific name.
SEARCH_REF_PARAM_NAMES — to search for reference parameters of a
specific name.
SEARCH_UDF_DIM — to search for a variable dimension from a UDF.
SEARCH_MDL_PARAM — to search for a model parameter in a Creo
Elements/Pro model.
CHECK_COMMON_MDL_PARAM — to checks if a parameter exists in an
array of model references.
SEARCH_MDL_PARAM_NAME — to search for a model parameter of a
specific name.
SEARCH_MDL_PARAM_NAMES — to search for model parameters of a
specific name.
SEARCH_ENUMERATED_MDL_PARAM_NAME — to search for a restricted
enumerated model parameter of a specific name.
SEARCH_ENUMERATED_MDL_PARAM_NAMES — to search for a restricted
enumerated model parameter of a specific name.
SEARCH_ENUMERATED_FEAT_PARAM_NAME — to search for a restricted
enumerated feature parameter of a specific name.
SEARCH_ENUMERATED_FEAT_PARAM_NAMES — to search for a restricted
enumerated feature parameter of a specific name.
SEARCH_ENUMERATED_REF_PARAM_NAME — to search for a restricted
enumerated reference parameter of a specific name.
SEARCH_ENUMERATED_REF_PARAM_NAMES — to search for a restricted
enumerated reference parameter of a specific name.
SEARCH_MDL_OR_COMP_PARAM — to search for a model or component
parameter in a Creo Elements/Pro model.
SEARCH_STAMP_REF — to search for a distinct stamping reference for
progressive dies design.
SEARCH_STAGE_ORIENT_PLANE — to search for a datum plane of a model
to use is later on as orientation reference.
SEARCH_MDL_REF
Searches for a named reference in a Creo Elements/Pro model.
Syntax:
SEARCH_MDL_REF [options] model "type" "search_string" [WITH_CONTENT
...] [WITH_IDENTIFIER ... ] reference<:out>
Arguments

options
Valid options are:
RECURSIVE — Optional argument specifies that the search is not only
done in the model, but also in all available sub-assemblies and
sub-parts of this model.
ALLOW_SUPPRESSED — Also tests suppressed features if they fit to
the search string. In case of suppressed components, the models are
retrieved to memory.
ALLOW_SIMPREP_SUPPRESSED —Also tests components which are
suppressed by the current simplified representation. In case of
assemblies, these are retrieved to memory.
EXCLUDE_INHERITED — excludes the search in inherited features.
EXCLUDE_FOOTER— excludes the search in footer features.
NO_UPDATE — avoids automatic updating of the reference in case its
model will be assembled.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.

model
The specified model.

type
The specified reference type. Any string expression is allowed.

search_string
This is the Creo Elements/Pro name of the reference to search for.
Any string expression is allowed. The reference name could also be
specified by the use of wildcards.
Since features could be renamed by the user, the content of a string
parameter at the feature called BUW_OBJECT_ROLE is also accepted as
feature name. It is recommended to apply this parameter to avoid
problems on renaming.
Another technique is to identify a feature by its id. This could be
done by FID:number as search string. For example FID:9. References to
geometry (e.g. to an datum plane) can also be identified by id).
Therefor the expression GID:number can be used as search string.
In case of the type DRAWING, any text expression will match. It will
always be searched for a drawing which has the same name as the
specified model.

WITH_CONTENT
An optional WITH_CONTENT / WITH_CONTENT_NOT clause can follow, to
filter for specific variable content.

WITH_IDENTIFIER
An optional WITH_IDENTIFIER / WITH_IDENTIFIER_NOT can follow to limit
the search results for a specific identifier.

reference
Name of the reference which should receive the information.
Error handling
The program execution will be canceled if the model could not be
detected or if no reference is found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS CSYS assembling_csys asm_csys
SEARCH_MDL_REF THIS FEATURE_PARAM "hole" WITH_CONTENT STRING
through_hole hole_ref
SEARCH_MDL_REFS
Searches for all named reference in a Creo Elements/Pro model.
Syntax
SEARCH_MDL_REFS [options] model "type" "search_string" [WITH_CONTENT
...] [WITH_IDENTIFIER ...]array<:out>
Arguments

options
Valid options are:
RECURSIVE — Optional argument specifies that the search is not only
done in the model, but also in all available sub-assemblies and
sub-parts of this model.
ALLOW_SUPPRESSED — Also tests suppressed features if they fit to
the search string. In case of suppressed components, the models
are retrieved to memory.
ALLOW_SIMPREP_SUPPRESSED —Also tests components which are
suppressed by the current simplified representation. In case of
assemblies, these are retrieved to memory.
EXCLUDE_INHERITED — excludes the search in inherited features.
EXCLUDE_FOOTER— excludes the search in footer features.
NO_UPDATE — avoids automatic updating of the reference in case its
model will be assembled.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.

model
The specified model.

type
The specified reference type. Any string expression is allowed.

search_string
This is the Creo Elements/Pro name of the reference to search for.
Any string expression is allowed. The reference name could also be
specified by the use of wildcards.
Since features could be renamed by the user, the content of a string
parameter at the feature called BUW_OBJECT_ROLE is also accepted as
feature name. It is recommended to apply this parameter to avoid
problems on renaming.
Another technique is to identify a feature by its id. This could be
done by FID:number as search string. For example FID:9. References to
geometry (e.g. to an datum plane) can also be identified by id).
Therefor the expression GID:number can be used as search string.
In case of the type DRAWING, any text expression will match. It will
always be searched for a drawing which has the same name as the
specified model.

WITH_CONTENT
An optional WITH_CONTENT / WITH_CONTENT_NOT clause can follow, to
filter for specific variable content.

WITH_IDENTIFIER
An optional WITH_IDENTIFIER / WITH_IDENTIFIER_NOT can follow to limit
the search results for a specific identifier.

array
Name of the array of reference which should receive the information.
Error handling
The program execution will be canceled if the model could not be
detected or if no reference is found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
! find all features
SEARCH_MDL_REFS THIS FEATURE * arrayFeatures
SEARCH_FEAT_REF
Searches for a named reference in a Creo Elements/Pro feature.
Syntax:
SEARCH_FEAT_REF [options] refFeature<:in> type "search_string"
[WITH_CONTENT content_type "content_value"] reference<:out>
Arguments

options
Valid options are:
NO_UPDATE — avoids automatic updating of the reference in case its
model will be assembled.

refFeature
Reference to an existing feature.

type
The specified reference type.

search_string
This is the Creo Elements/Pro name of the reference to search for.
Any string expression is allowed. The reference name could also be
specified by the use of wildcards.
Another technique is to identify a geometrical item by its id. This
could be done by GID:number as search string. For example GID:9.

WITH_CONTENT
An optional WITH_CONTENT / WITH_CONTENT_NOT clause can follow, to
filter for specific variable content.

reference
Name of the reference which should receive the information.
Error handling
The program execution will be canceled if the feature could not be
detected or if no reference is found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_FEAT_REF feat SURFACE_PARAM "SAMPLE" refSurface
SEARCH_FEAT_REF feat SURFACE_PARAM "SURFACE_NAME" WITH_CONTENT STRING
"SAMPLE_SURFACE" refSurface
SEARCH_FEAT_REFS
Searches for all named reference in a Creo Elements/Pro feature.
Syntax
SEARCH_FEAT_REFS [options] refFeature type "search_string"
[WITH_CONTENT content_type "content_value"] array<:out>
Arguments

options
Valid options are:
NO_UPDATE — avoids automatic updating of the reference in case its
model will be assembled.

refFeature
Reference to an existing feature.

type
The specified reference type.

search_string
This is the Creo Elements/Pro name of the reference to search for.
Any string expression is allowed. The reference name could also be
specified by the use of wildcards.
Another technique is to identify a geometrical item by its id. This
could be done by GID:number as search string. For example GID:9.

WITH_CONTENT
An optional WITH_CONTENT / WITH_CONTENT_NOT clause can follow, to
filter for specific variable content.

array
Name of the array of reference which should receive the information.
Error handling
The program execution will be canceled if the feature could not be
detected or if no reference is found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
! find all surfaces with a parameter of a feature.
SEARCH_FEAT_REFS feat SURFACE_PARAM "*" allSurfacesWithParameter
SEARCH_FEAT_PARAM
Searches for a specific parameter in a feature.
Syntax
SEARCH_FEAT_PARAM feature "search_string" [option] parameter<:out>
Arguments

feature
The specified feature.

search_string
Name of the Creo Elements/Pro parameter or dimension which should be
searched. Any string expression is allowed.

parameter
Name for the parameter which should receive the content of the Creo
Elements/Pro parameter or dimension.

option
NO_UPDATE: prevents associated Creo Elements/Pro parameters or
dimension from being updated automatically after CONFIG_ELEM.
NO_DIM_SIGN — avoids to show up a minus sign for negative
regenerated dimensions.
Error handling
The program execution will be canceled if the feature does not exist,
unless errors are handled by BEGIN_CATCH_ERROR. In case the Creo
Elements/Pro parameter
could not be found, the system will ask for a value.
BEGIN_CATCH_ERROR is avoiding this.
Note
Accessing parameters from a component feature is useful technology in
the context of reusing references and parameters.
Example
! search feature parameter at the component feature.
SEARCH_FEAT_PARAM COMP_FEAT height component_height
SEARCH_REF_PARAM
Searches for a specific parameter in a reference.
Syntax
SEARCH_REF_PARAM ref<:in> "search_string" parameter<:out>
Arguments

ref
The reference which should contain the parameter.

search_string
Name of the Creo Elements/Pro parameter. Any string expression is
allowed.

parameter
Name for the parameter which should receive the content of the Creo
Elements/Pro parameter.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR. In case the
Creo Elements/Pro parameter
could not be found, the system will ask for a value.
BEGIN_CATCH_ERROR is avoiding this.
Example
USER_SELECT FACE surface
SEARCH_REF_PARAM surface "my_paramt" param
PRINT "%" param
§
CHECK_COMMON_FEAT_PARAM
Checks if a parameter exists in an array of feature references. The
parameter content can optionally be included in the comparison.
Syntax
CHECK_COMMON_FEAT_PARAM arrayFeatures<:in> "search_string" [CONTENT
... ] [options] paramExistsInAllFeatures<:out>
Arguments

arrayFeatures
Name of the existing array which contains all features to check.

search_string
Name of the Creo Elements/Pro parameter which should be available in
all features. Any string expression is allowed. The names can also be
specified by using wildcards.

options
The following options are available:
WITH_CONTENT clause, to filter for specific variable content.
WITH_CONTENT_NOT clause, to avoid for specific variable content.
COMMON_PARAM_NAMES array_name — creates an output array containing
the names of the parameter which are identified.

paramExistsInAllFeatures
Name of the boolean parameter which should receive the result.
Error handling
The program execution will be canceled if the array of features does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
CHECK_COMMON_FEAT_PARAM arrayFeatures "BUW*" bAllHaveBUW
IF bAllHaveBUW == TRUE
PRINT "All features have a BUW parameter"
END_IF
§
SEARCH_FEAT_PARAM_NAME
Searches for a parameter of a specific name in a feature.
Syntax
SEARCH_FEAT_PARAM_NAME feature "search_string" [option]
paramName<:out>
Arguments

feature
The specified feature.

search_string
Name of the Creo Elements/Pro parameter or dimension which should be
searched. Any string expression is allowed. The names can also be
specified by using wildcards.

option
The following options are available:
INCLUDE_MASS_PROPS — check also for mass property parameters.
WITH_CONTENT clause, to filter for specific variable content.
WITH_CONTENT_NOT clause, to avoid for specific variable content.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the feature or the
parameter does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
SEARCH_FEAT_PARAM_NAME feat "BUW*" paramName
PRINT "%" paramName
§
SEARCH_FEAT_PARAM_NAMES
Searches for parameters of a specific name in a feature.
Syntax
SEARCH_FEAT_PARAM_NAMES feature "search_string" [option]
arrayParamNames<:out>
Arguments

feature
The specified feature.

search_string
Name of the Creo Elements/Pro parameter or dimension which should be
searched. Any string expression is allowed. The names can also be
specified by using wildcards.

option
The following options are available:
INCLUDE_MASS_PROPS — check also for mass property parameters.
WITH_CONTENT clause, to filter for specific variable content.
WITH_CONTENT_NOT clause, to avoid for specific variable content.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the feature does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
SEARCH_FEAT_PARAM_NAMES feat "BUW*" arrayParameterNames
FOR paramName REF ARRAY arrayParameterNames
PRINT "%" paramName
END_FOR
§
SEARCH_REF_PARAM_NAME
Searches for a parameter of a specific name in a reference.
Syntax
SEARCH_REF_PARAM_NAME reference "search_string" [option]
paramName<:out>
Arguments

reference
Reference in which to search for the parameter.

search_string
Name of the Creo parameter which should be searched. Any string
expression is allowed. The names can also be specified by using
wildcards.

option
The following options are available:
INCLUDE_MASS_PROPS — check also for mass property parameters.
WITH_CONTENT clause, to filter for specific variable content.
WITH_CONTENT_NOT clause, to avoid for specific variable content.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the reference or the
parameter does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE feat
SEARCH_REF_PARAM_NAME surf "BUW*" paramName
PRINT "%" paramName
§
SEARCH_REF_PARAM_NAMES
Searches for parameters of a specific name in a reference.
Syntax
SEARCH_REF_PARAM_NAMES reference "search_string" [option]
arrayParamNames<:out>
Arguments

reference
Reference in which to search for the parameter.

search_string
Name of the Creo parameter which should be searched. Any string
expression is allowed. The names can also be specified by using
wildcards.

option
The following options are available:
INCLUDE_MASS_PROPS — check also for mass property parameters.
WITH_CONTENT clause, to filter for specific variable content.
WITH_CONTENT_NOT clause, to avoid for specific variable content.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION_ELEMENT annotation
SEARCH_REF_PARAM_NAMES annotation"*" arrayParameterNames
FOR param_name REF ARRAY arrayParameterNames
SEARCH_REF_PARAM elem param_name param_value
PRINT "% %" param_name param_value
END_FOR
SEARCH_UDF_DIM
Searches for a variable dimension from a user defined feature.
Syntax
SEARCH_UDF_DIM udf_feature "var_dim_name" parameter<:out>
Arguments

feature
UDF or member of a UDF according the rules how to specify features.

var_dim_name
Name of the variable dimension which should be searched. Any string
expression is allowed.

parameter
Name for the parameter which should receive the content of the Creo
Elements/Pro parameter or dimension.
Error handling
The program execution will be canceled if the feature does not exist
or the dimension could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Accessing variable dimensions from UDFs is useful technology in UDF
programs for retrieving GUI variables for modification.
Example
! search feature variable dimension
SEARCH_UDF_DIM udf HEIGHT paramHeight
SEARCH_MDL_PARAM
Searches for a parameter or dimension with a specific name in an Creo
Elements/Pro model.
Syntax
SEARCH_MDL_PARAM model "search_string" [option] parameter<:out>
Arguments

model
The specified model.

search_string
Name of the Creo Elements/Pro parameter or dimension which should be
searched. Any string expression is allowed.

option
NOT_INHERITED —does not search for the parameter or dimension in
inherited models.
INHERITED — searches for parameter or dimension only in inherited
models.
NO_UPDATE — prevents associated Creo Elements/Pro parameters or
dimension from being updated automatically after CONFIG_ELEM.
NO_DIMENSION — avoid to search for dimension. This can be used for
performance reasons to prevent the search for dimensions in large
models.
INCLUDE_MASS_PROPS — check also for mass property parameters.
NO_DIM_SIGN — avoids to show up a minus sign for negative
regenerated dimensions.

parameter
Name for the parameter which should receive the content of the Creo
Elements/Pro parameter or dimension.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR. In case the Creo
Elements/Pro parameter or dimension could not be found, the system
will ask for a value. BEGIN_CATCH_ERROR is avoiding this.
Note
If a variable remains undefined or not could be figured out by using
PARAM_VALID in an IF statement.
Example
SEARCH_MDL_PARAM THIS height dimension_height
§
CHECK_COMMON_MDL_PARAM
Checks if a parameter exists in an array of model references. The
parameter content can optionally be included in the comparison.
Syntax
CHECK_COMMON_MDL_PARAM arrayMdls<:in> "search_string" [option]
paramExistsInAllMdls<:out>
Arguments

arrayMdls
Name of the existing array which contains all models to check.

search_string
Name of the Creo Elements/Pro parameter which should be available in
all models. Any string expression is allowed. The names can also be
specified by using wildcards.

option
The following options are available:
WITH_CONTENT clause, to filter for specific variable content.
WITH_CONTENT_NOT clause, to avoid for specific variable content.
COMMON_PARAM_NAMES array_name — creates an output array containing
the names of the parameter which are identified.

paramExistsInAllMdls
Name of the boolean parameter which should receive the result.
Error handling
The program execution will be canceled if the array of mdls does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
CHECK_COMMON_MDL_PARAM arrayMdls "BUW*" bAllHaveBUW
IF bAllHaveBUW == TRUE
PRINT "All mdls have a BUW parameter"
END_IF
§
SEARCH_MDL_PARAM_NAME
Searches for a parameter of a specific name in a model.
Syntax
SEARCH_MDL_PARAM_NAME model "search_string" [option] paramName<:out>
Arguments

model
The specified model.

search_string
Name of the Creo Elements/Pro parameter or dimension which should be
searched. Any string expression is allowed. The names can also be
specified by using wildcards.

option
The following options are available:
INCLUDE_MASS_PROPS — check also for mass property parameters.
WITH_CONTENT clause, to filter for specific variable content.
WITH_CONTENT_NOT clause, to avoid for specific variable content.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the model or the parameter
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_PARAM_NAME ASSEMBLY "BUW*" paramNames
PRINT "%" paramName
§
SEARCH_MDL_PARAM_NAMES
Searches for parameters of a specific name in a model.
Syntax
SEARCH_MDL_PARAM_NAMES model "search_string" [option]
arrayParamNames<:out>
Arguments

model
The specified model.

search_string
Name of the Creo Elements/Pro parameter or dimension which should be
searched. Any string expression is allowed. The names can also be
specified by using wildcards.

option
The following options are available:
INCLUDE_MASS_PROPS — check also for mass property parameters.
WITH_CONTENT clause, to filter for specific variable content.
WITH_CONTENT_NOT clause, to avoid for specific variable content.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_PARAM_NAMES ASSEMBLY "BUW*" arrayParameterNames
FOR paramName REF ARRAY arrayParameterNames
PRINT "%" paramName
END_FOR
§
SEARCH_ENUMERATED_MDL_PARAM_NAME
Searches for a restricted enumerated parameter of a specific name in
a model.
Syntax
SEARCH_ENUMERATED_MDL_PARAM_NAME model<:in> "search_string"
paramName<:out>
Arguments

model
The specified model.

search_string
Name of the Creo model parameter name which should be searched. Any
string expression is allowed. The names can also be specified by
using wildcards.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the model or the parameter
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_ENUMERATED_MDL_PARAM_NAME ASSEMBLY "BUW*" paramNames
PRINT "%" paramName
§
SEARCH_ENUMERATED_MDL_PARAM_NAMES
Searches for restricted enumerated parameters of a specific name in a
model.
Syntax
SEARCH_ENUMERATED_MDL_PARAM_NAMES model<:in> "search_string"
arrayParamNames<:out>
Arguments

model
The specified model.

search_string
Name of the Creo model parameter names which should be searched. Any
string expression is allowed. The names can also be specified by
using wildcards.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_ENUMERATED_MDL_PARAM_NAMES ASSEMBLY "BUW*" arrayParameterNames
FOR paramName REF ARRAY arrayParameterNames
PRINT "%" paramName
END_FOR
§
SEARCH_ENUMERATED_FEAT_PARAM_NAME
Searches for a restricted enumerated parameter of a specific name in
a feature.
Syntax
SEARCH_ENUMERATED_FEAT_PARAM_NAME feature<:in> "search_string"
paramName<:out>
Arguments

feature
The specified feature.

search_string
Name of the Creo feature parameter name which should be searched. Any
string expression is allowed. The names can also be specified by
using wildcards.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the feature or the
parameter does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
SEARCH_ENUMERATED_FEAT_PARAM_NAME feat "BUW*" paramName
PRINT "%" paramName
§
SEARCH_ENUMERATED_FEAT_PARAM_NAMES
Searches for restricted enumerated parameters of a specific name in a
feature.
Syntax
SEARCH_ENUMERATED_FEAT_PARAM_NAMES feature<:in> "search_string"
arrayParamNames<:out>
Arguments

feature
The specified feature.

search_string
Name of the Creo feature parameter names which should be searched.
Any string expression is allowed. The names can also be specified by
using wildcards.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the feature does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
SEARCH_ENUMERATED_FEAT_PARAM_NAMES feat "BUW*" arrayParameterNames
FOR paramName REF ARRAY arrayParameterNames
PRINT "%" paramName
END_FOR
§
SEARCH_ENUMERATED_REF_PARAM_NAME
Searches for a restricted enumerated parameter of a specific name in
a reference.
Syntax
SEARCH_ENUMERATED_REF_PARAM_NAME reference<:in> "search_string"
paramName<:out>
Arguments

reference
Reference in which to search for the parameter.

search_string
Name of the Creo reference parameter name which should be searched.
Any string expression is allowed. The names can also be specified by
using wildcards.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the reference or the
parameter does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE feat
SEARCH_ENUMERATED_REF_PARAM_NAME surf "BUW*" paramName
PRINT "%" paramName
§
SEARCH_ENUMERATED_REF_PARAM_NAMES
Searches for restricted enumerated parameters of a specific name in a
reference.
Syntax
SEARCH_ENUMERATED_REF_PARAM_NAMES reference<:in> "search_string"
arrayParamNames<:out>
Arguments

reference
Reference in which to search for the parameter.

search_string
Name of the Creo reference parameter names which should be searched.
Any string expression is allowed. The names can also be specified by
using wildcards.

arrayParamNames
Name of the array which should receive the parameter names
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION_ELEMENT annotation
SEARCH_ENUMERATED_REF_PARAM_NAMES annotation"*" arrayParameterNames
FOR param_name REF ARRAY arrayParameterNames
SEARCH_REF_PARAM elem param_name param_value
PRINT "% %" param_name param_value
END_FOR
SEARCH_MDL_OR_COMP_PARAM
Recursive search for a parameter with a specific name. The search
starts with the specified model and checks if its component or the
model contains the parameter. In case it does not, the search will be
done in the parameter model and so forth.
Syntax:
SEARCH_MDL_OR_COMP_PARAM model "search_string" parameter<:out>
Arguments

model
The specified model.

search_string
Name of the Creo Elements/Pro parameter which should be searched. Any
string expression is allowed.

parameter
Name for the parameter which should receive the content of the Creo
Elements/Pro parameter or dimension.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR. In case the parameter
is not found at all the user has to specify the value.
BEGIN_CATCH_ERROR is avoiding this.
Note
In case the parameter is not found the user is asked for the correct
value.
Example
SEARCH_MDL_OR_COMP_PARAM THIS version paramVersion
SEARCH_STAMP_REF
Searches for a named surface in the selected models. The search is
done in z direction. Use this command to specify a tool plate at a
position
Syntax
SEARCH_STAMP_REF refLocation<:in> "surface_name" model [model2 ...]
reference<:out>
Arguments

refLocation
The previously selected reference to indicate the location.

surface_name
The Creo Elements/Pro surface name to search.

model1 model2 ...


Sequence of models roles that should be searched. Any string
expression is allowed. The role of a model is determined by the part
level string parameter BUW_OBJECT_ROLE.

reference
Reference which will receive the information.
Error handling
The program execution will be canceled if the location reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Usually the search direction is the standard z axis of the current
model. In case a coordinate system with the BUW_OBJECT_ROLE string
parameter with content MACHINING_CSYS is provided, the z axis of this
coordinate system is considered.
In case no name is provided to a upper or lower surface in Creo
Elements/Pro, the names TOP resp. BOTTOM are assumed.
In case on valid solid surface is found, also non solid surfaces are
considered. This could be useful if the surface is intersected at the
position. To find non solid surfaces by the command they must be
visible. If they are located on layers, make sure to show them by
SET_LAYER_STATUS.
Example
USER_SELECT POINT placement_point
SEARCH_STAMP_REF placement_point TOP CUT_PLATE BASE_PLATE PLATE_TOP
§
SEARCH_STAGE_ORIENT_PLANE
Searches for a datum plane in specified model. This command could be
used to retrieve an orientation reference for UDF placement or
assembling.
Syntax
SEARCH_STAGE_ORIENT_PLANE reference1<:in> reference2<:out>
Arguments

reference1:
The previously selected reference (for example, by USER_SELECT).

reference2<:out>:
Any reference name.
Example
USER_SELECT POINT placement_point
SEARCH_STAGE_ORIENT_PLANE placement_point stage_orient
About Commands for Feature Operations
Commands for creating, removing or changing the state of features and
UDFs.
The following commands are available:
CREATE_UDF — to create user defined features.
CREATE_UDF_EX — to create a user defined feature with a variable
number of UDF constraints.
CREATE_INHERITANCE — to create inheritance features.
CREATE_POINTS — to create a datum point offset coordinate system
feature.
CREATE_POINTS_EX — to create a datum point offset coordinate system
feature.
READ_POINTS_EX — to read the description of a datum point offset
coordinate system feature.
MODIFY_POINTS_EX — to modify datum point offset coordinate system
feature.
CREATE_FIELD_POINT — to create a field point.
READ_FIELD_POINT — to retrieve the placement reference of a field
point.
MODIFY_FIELD_POINT — to modify the placement reference of a field
point.
CREATE_GENERAL_POINT — to create a general point datum feature.
READ_GENERAL_POINT — to read the description of a general point
datum feature.
MODIFY_GENERAL_POINT — to modify a general point datum feature.
CREATE_GENERAL_CSYS — to create a coordinate system feature.
READ_GENERAL_CSYS — to read the description of a coordinate system
feature.
MODIFY_GENERAL_CSYS — to modify a coordinate system feature.
CREATE_HOLE — to create a hole feature.
READ_HOLE — to read the description of a hole feature.
MODIFY_HOLE — to modify a hole feature.
CONVERT_HOLE_DATA — to convert a existing hole to another hole
type.
READ_COMP_INTERFACE — to read the description of a component
interface feature.
REMOVE_FEATURE — to remove features.
REMOVE_FEATURES — to remove an array of features in a model.
REORDER_FEATURES — to reorder features.
SET_AUTO_REORDER — to reorder a feature to a position and adjust
this in every regeneration and saving.
GET_FEATURE_STATE — to determine if a feature is suppressed or
resumed.
GET_FEATURE_STATE_EX — to determine the state of a feature.
SET_FEATURE_STATE — to suppress or resuming features.
GET_FEATURE_DEPENDENCY — to retrieve the dependency setting of a
copy geom feature.
SET_FEATURE_DEPENDENCY — to set the dependency setting of a copy
geom feature.
GET_FEATURE_DEPENDENCY_NAME — to retrieve the name of the
associated source model to a copy geom feature.
GET_FEATURE_UPDATE_NOTIFICATION — to retrieve the update
notification status of a copy geom feature.
SET_FEATURE_UPDATE_NOTIFICATION — to set the update notification
status of a copy geom feature.
GROUP_FEATURES — to group features.
UNGROUP_FEATURES — to ungroup features.
GET_GROUP_HEAD — to retrieve the head of a group member.
GET_GROUP_FEATURE — to get access to a specific member of a
feature group.
GET_GROUP_FEATURE_NUM — to retrieve the number of features in a
group.
MOVE_TO_FOOTER — to move features to the footer.
MOVE_FROM_FOOTER — to move features from the footer.
CREATE_UDF
Creates a user-defined feature with specified references and variable
dimensions.
Syntax
CREATE_UDF &udfname MODEL [options] [reference_udf<:out>]
UDF_CONSTRAINT1
UDF_CONSTRAINT2
...
END_CREATE_UDF
Arguments

udfname
Name of the UDF in the database. The database is searched either in
the UDF standard folder or in current library component folder.
Specify the name without a file extension.
Path for UDF could be specified according the rules for path
specification. Also the file extension '.gph' can be specified, but
it is not required. String variables introduces by the ampersand
symbol & can also be used.

model
The specified model.

options
The following options are supported:
ADD_EXP_TO_MAP mapExport — all exported items of the udf will be
added to the supplied map. The map needs to be declared as type
STRING.
ALLOW_RECREATE — if this option is set on modification, the UDF
will be recreated in case of new references or of another target.
NO_AUTO_LAYERS — if this option is set BUW_LAYER_INFO parameters
will not be processed.
REMOVE_UDF_RELATIONS — some UDFs create relations to the model in
which they are inserted automatically. This option removes the
relations afterwards.
CONSIDER_NEG_DIM_SIGN — checks the UDF definition if a dimension is
regenerated to the negative value in the UDF definition to keep the
direction for a negative value.
DIM_DISPLAY_OPTION option — determines the display of non UDF
driven dimensions. The available options are NORMAL, READONLY and
BLANK. Default is NORMAL.
UNIQUE_IDENT "ident" — add an identifier to the UDF to be used for
modification.

reference_udf
(Optional) If you specified a UDF, you can later use the UDF for
parameter access.
UDF constraints
Multiple UDF constraints can be defined. More information is in the
chapter how to specify UDF constraints.
Note
In case features of the created UDF should be placed on a specific
layer a string parameter BUW_LAYER_INFO at this feature should
contain the layer name. If this layer name has to be calculated by a
string expression the SET_ON_LAYER command could be used for exported
feature references.
Example
CREATE_UDF MEASURE_Z_DIST_CSYS_PLANE ASSEMBLY DIST_MEASURE
UDF_REF REF_CSYS SELECTED_CSYS
UDF_REF REF_PLANE SELECTED_PLANE
UDF_EXP_PARAM DISTANCE_Z
END_CREATE_UDF
CREATE_UDF_EX
Creates a user-defined feature with a variable number of udf
constraints.
Syntax
CREATE_UDF_EX &udfname MODEL arrayUdfConstraints<:in> [options]
[reference_udf<:out>]
Arguments

udfname
Name of the UDF in the database. The database is searched either in
the UDF standard folder or in current library component folder.
Specify the name without a file extension.
Path for UDF could be specified according the rules for path
specification. Also the file extension '.gph' can be specified, but
it is not required. String variables introduces by the ampersand
symbol & can also be used.

model
The specified model.

arrayUdfConstraints
Name of an existing array with structures of type UDF_CONSTRAINT.

options
The following options are supported:
ADD_EXP_TO_MAP mapExport — all exported items of the udf will be
added to the supplied map. The map needs to be declared as type
STRING.
ALLOW_RECREATE — if this option is set on modification, the UDF
will be recreated in case of new references or of another target.
NO_AUTO_LAYERS — if this option is set BUW_LAYER_INFO parameters
will not be processed.
REMOVE_UDF_RELATIONS — some UDFs create relations to the model in
which they are inserted automatically. This option removes the
relations afterwards.
CONSIDER_NEG_DIM_SIGN — checks the UDF definition if a dimension is
regenerated to the negative value in the UDF definition to keep the
direction for a negative value.
DIM_DISPLAY_OPTION option — determines the display of non UDF
driven dimensions. The available options are NORMAL, READONLY and
BLANK. Default is NORMAL.
UNIQUE_IDENT "ident" — add an identifier to the UDF to be used for
modification.
reference_udf
(Optional) If you specified a UDF, you can later use the UDF for
parameter access.
Note
In case features of the created UDF should be placed on a specific
layer a string parameter BUW_LAYER_INFO at this feature should
contain the layer name. If this layer name has to be calculated by a
string expression the SET_ON_LAYER command could be used for exported
feature references.
Example
DECLARE_STRUCT UDF_CONSTRAINT constraint
DECLARE_ARRAY arrayUdfConstraints

constraint.type = "UDF_REF"
constraint.name = "REF_CSYS"
constraint.reference_in = SELECTED_CSYS
ADD_ARRAY_ELEM arrayUdfConstraints constraint

constraint.type = "UDF_REF"
constraint.name = "REF_PLANE"
constraint.reference_in = SELECTED_PLANE
ADD_ARRAY_ELEM arrayUdfConstraints constraint

constraint.type = "UDF_EXP_PARAM"
constraint.name = "DISTANCE_Z"
ADD_ARRAY_ELEM arrayUdfConstraints constraint

DECLARE_MAP mappedExports
CREATE_UDF_EX MEASURE_Z_DIST_CSYS_PLANE ASSEMBLY arrayUdfConstraints
ADD_EXP_TO_MAP mappedExports
GET_MAP_ELEM mappedExports "DISTANCE_Z" dist
PRINT "%" dist
§
CREATE_INHERITANCE
Creates an inheritance feature based on references to target and
source part.
Syntax
CREATE_INHERITANCE model_target model_source [option]
Arguments

model_target
Target part in which the inheritance feature should be created.
Models are specified in the following manner.

model_source
Source part which is inherited. Models are specified in the
following manner.

option
Optional parameter specifying the dependency. Valid values are
DEPENDENT and INDEPENDENT. In case no option is specified, DEPENDENT
is used as default.
Error handling
The program execution will be canceled if target or source model are
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The inheritance feature is created via a Creo Elements/Pro mapkey. In
case the target is a sub model of the current model on the screen, it
has to be activated.
Example
USER_SELECT MODEL mdlSource
CREATE_INHERITANCE THIS mdlSource DEPENDENT
§
CREATE_POINTS
Creates a datum point offset coordinate system feature with several
points inside.
Syntax
CREATE_POINTS model reference_csys<:in> arrayPoints<:in>
ref_feature<:out>
Arguments

model
Model in which the feature should be created. Models are specified in
the following manner.

reference_csys
Name of an existing coordinate system reference.

arrayPoints
Name of the existing array which has to consists of double
parameters. Each triplet inside the array specifies x, y and z
coordinates of a point.

ref_feature
Name of the reference which should receive the information about the
created point feature.
Error handling
The program execution will be canceled if model, reference coordinate
system or array are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT CSYS refCsys
DECLARE_ARRAY arrayPointCoords
DECLARE_VARIABLE DOUBLE coord
coord = 0
ADD_ARRAY_ELEM arrayPointCoords coord
ADD_ARRAY_ELEM arrayPointCoords coord
ADD_ARRAY_ELEM arrayPointCoords coord
coord = 10
ADD_ARRAY_ELEM arrayPointCoords coord
ADD_ARRAY_ELEM arrayPointCoords coord
ADD_ARRAY_ELEM arrayPointCoords coord
CREATE_POINTS THIS refCsys arrayPointCoords refFeature
§
CREATE_POINTS_EX
Creates a datum point offset coordinate system feature with several
points inside.
Syntax
CREATE_POINTS_EX model dtm_pnt_offset_csys<:in> ref_feature<:out>
Arguments

model
Model in which the feature should be created. Models are specified in
the following manner.

dtm_pnt_offset_csys
Structure variable of type DTM_PNT_OFFSET_CSYS which contains the
point feature definition.

ref_feature
Name of the reference which should receive the information about the
created point feature.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_STRUCT DTM_PNT_OFFSET_CSYS dtmPntOffsetCsys

USER_SELECT CSYS dtmPntOffsetCsys.offset_csys

DECLARE_STRUCT POINT point


point.x = 10
point.y = 20
point.z = 30
ADD_ARRAY_ELEM dtmPntOffsetCsys.array_points point

point.x = 20
point.y = 20
point.z = 20
ADD_ARRAY_ELEM dtmPntOffsetCsys.array_points point

point.x = 30
point.y = 20
point.z = 10
ADD_ARRAY_ELEM dtmPntOffsetCsys.array_points point

point.x = 10
point.y = 20
point.z = 30
ADD_ARRAY_ELEM dtmPntOffsetCsys.array_points point

point.x = 10
point.y = 20
point.z = 30
ADD_ARRAY_ELEM dtmPntOffsetCsys.array_points point

CREATE_POINTS_EX PART dtmPntOffsetCsys refFeature


§
READ_POINTS_EX
Reads the description of a datum point offset coordinate system
feature with several points inside.
Syntax
READ_POINTS_EX ref_feature<:in> dtm_pnt_offset_csys<:out>
Arguments

ref_feature
Existing reference to the datum point offset coordinate system
feature.

dtm_pnt_offset_csys
Structure variable of type DTM_PNT_OFFSET_CSYS which will receive the
point feature definition.
Error handling
The program execution will be canceled if the reference to the point
feature is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT POINT pnt
READ_POINTS_EX pnt dtm_pln_offset_csys

PRINT "offset_csys: %" dtm_pln_offset_csys.offset_csys


PRINT "type: %" dtm_pln_offset_csys.type
PRINT "with_dims: %" dtm_pln_offset_csys.with_dims

FOR point REF ARRAY dtm_pln_offset_csys.array_points


PRINT "%/%/%" point.x point.y point.z
END_FOR
§
MODIFY_POINTS_EX
Modifies a datum point offset coordinate system feature with several
points inside.
Syntax
MODIFY_POINTS_EX ref_feature<:in> dtm_pnt_offset_csys<:in>
Arguments

ref_feature
Existing reference to the datum point offset coordinate system
feature.

dtm_pnt_offset_csys
Structure variable of type DTM_PNT_OFFSET_CSYS which contains the
point feature definition.
Error handling
The program execution will be canceled if the reference to the point
feature is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT POINT pnt
READ_POINTS_EX pnt dtm_pln_offset_csys

DECLARE_STRUCT POINT point


point.x = 10
point.y = 20
point.z = 30
ADD_ARRAY_ELEM dtmPntOffsetCsys.array_points point

MODIFY_POINTS_EX pnt dtm_pln_offset_csys


§
CREATE_FIELD_POINT
Creates a field point.
Syntax
CREATE_FIELD_POINT model refPlacement<:in> refFeaturePoint<:out>
Arguments

model
Model in which the feature should be created. Models are specified in
the following manner.

refPlacement
Reference on which the point will be placed.

refFeaturePoint
Name of the variable which should receive the information about the
created field point feature.
Error handling
The program execution will be canceled if the model or the placement
reference are not existing or if the point can't be created, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE srf
CREATE_FIELD_POINT srf srf featPoint
CREATE_FIELD_POINT ASSEMBLY srf featPoint
§
READ_FIELD_POINT
Retrieves the placement reference of a field point.
Syntax
READ_FIELD_POINT refFeature<:in> refPlacement<:out>
Arguments

refFeature
Existing reference to the field point feature.

refPlacement
Name of the variable which will received the information about the
placement reference.
Error handling
The program execution will be canceled if the reference to field
point feature is not existing or the placement reference can't be
determined, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE featFieldPoint
READ_FIELD_POINT featFieldPoint refPlacement
§
MODIFY_FIELD_POINT
Modifies the placement reference of a field point.
Syntax
MODIFY_FIELD_POINT refFeature<:in> refPlacement<:in>
Arguments

ref_feature
Existing reference to the field point feature.

refPlacement
Reference where the point should be placed.
Error handling
The program execution will be canceled if the reference to the field
point feature or the placement ares not existing or if the field
point can't be modified, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE pnt

! array for all GENERAL_POINT_DATA structures


DECLARE_ARRAY arrayGeneralPointData

! GENERAL_POINT_DATA
DECLARE_STRUCT GENERAL_POINT_DATA general_pnt_data
DECLARE_STRUCT GENERAL_POINT_PLACEMENT general_pnt_placement
DECLARE_STRUCT GENERAL_POINT_DIMENSION general_pnt_dimension

! point on point
general_pnt_placement.placement_type = PNT_ON
USER_SELECT POINT general_pnt_placement.placement_ref

ADD_ARRAY_ELEM general_pnt_data.array_placement general_pnt_placement

ADD_ARRAY_ELEM arrayGeneralPointData general_pnt_data

MODIFY_GENERAL_POINT pnt arrayGeneralPointData


§
CREATE_GENERAL_POINT
Creates a general point datum feature which can contain different
points.
Syntax
CREATE_GENERAL_POINT model array_general_point_data<:in>
refFeature<:out>
Arguments

model
Model in which the feature should be created. Models are specified in
the following manner.

array_general_point_data
Array variable which contains structures of type GENERAL_POINT_DATA
to define the points.

refFeature
Name of the variable which should receive the information about the
created general point feature.
Error handling
The program execution will be canceled if the model does not exist or
if the point can't be created, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
!
! array for all GENERAL_POINT_DATA structures
!
DECLARE_ARRAY arrayGeneralPointData

!
! first point on surface with offset to edges
!
DECLARE_STRUCT GENERAL_POINT_DATA general_pnt_data1
DECLARE_STRUCT GENERAL_POINT_PLACEMENT general_pnt_placement
DECLARE_STRUCT GENERAL_POINT_DIMENSION general_pnt_dimension

! point on surface
general_pnt_placement.placement_type = PNT_ON
USER_SELECT SURFACE general_pnt_placement.placement_ref
ADD_ARRAY_ELEM general_pnt_data1.array_placement
general_pnt_placement

! first dimension to first edge


general_pnt_dimension.dimension_type = PNT_DIM_OFFSET
USER_SELECT EDGE general_pnt_dimension.dimension_ref
general_pnt_dimension.dimension_value = 20
ADD_ARRAY_ELEM general_pnt_data1.array_dimensions
general_pnt_dimension

! second dimension to second edge


general_pnt_dimension.dimension_type = PNT_DIM_OFFSET
USER_SELECT EDGE general_pnt_dimension.dimension_ref
general_pnt_dimension.dimension_value = 20
ADD_ARRAY_ELEM general_pnt_data1.array_dimensions
general_pnt_dimension

ADD_ARRAY_ELEM arrayGeneralPointData general_pnt_data1


! second point on point
DECLARE_STRUCT GENERAL_POINT_DATA general_pnt_data2

! point on point
general_pnt_placement.placement_type = PNT_ON
USER_SELECT POINT general_pnt_placement.placement_ref
ADD_ARRAY_ELEM general_pnt_data2.array_placement
general_pnt_placement

ADD_ARRAY_ELEM arrayGeneralPointData general_pnt_data2

!
! create the point feature
!
CREATE_GENERAL_POINT PART arrayGeneralPointData featPoint
§
READ_GENERAL_POINT
Retrieves the description of a general point datum feature.
Syntax
READ_GENERAL_POINT refFeature<:in> general_point_data<:out>
Arguments

refFeature
Existing reference to the general point datum feature.

general_point_data
Structure variable of type GENERAL_POINT_DATA to define the points.
Error handling
The program execution will be canceled if the reference to the point
feature is not existing or the placement reference can't be
determined, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE featPoint

READ_GENERAL_POINT featPoint arrayGeneralPointData

GET_ARRAY_SIZE arrayGeneralPointData n

PRINT "=== POINTS ==="

FOR generalPointData REF ARRAY arrayGeneralPointData

PRINT "--- POINT ---"

FOR pointPlacement REF ARRAY generalPointData.array_placement


PRINT "\t--- placement ---"
PRINT "\tplacement_type: %" pointPlacement.placement_type
PRINT "\tplacement_ref: %" pointPlacement.placement_ref
PRINT "\tplacement_value: %" pointPlacement.placement_value
END_FOR

FOR pointDimension REF ARRAY generalPointData.array_dimensions


PRINT "\t--- dimension ---"
PRINT "\tdimension_type: %" pointDimension.dimension_type
PRINT "\tdimension_ref: %" pointDimension.dimension_ref
PRINT "\tdimension_value: %" pointDimension.dimension_value
END_FOR

END_FOR
§
MODIFY_GENERAL_POINT
Modifies a general point datum feature.
Syntax
MODIFY_GENERAL_POINT refFeature<:in> array_general_point_data<:in>
Arguments

ref_feature
Existing reference to the general point datum feature.

array_general_point_data
Array variable which contains structures of type GENERAL_POINT_DATA
to define the points.
Error handling
The program execution will be canceled if the reference to the field
point feature or the placement ares not existing or if the field
point can't be modified, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT POINT pnt
USER_SELECT SURFACE srf
MODIFY_FIELD_POINT pnt srf
§
CREATE_GENERAL_CSYS
Creates a general coordinate system feature.
Syntax
CREATE_GENERAL_CSYS model general_csys_data<:in> refFeature<:out>
Arguments

model
Model in which the feature should be created. Models are specified in
the following manner.

general_csys_data
Structure variable of type GENERAL_CSYS_DATA to define the coordinate
system.

refFeature
Name of the variable which should receive the information about the
created coordinate system feature.
Error handling
The program execution will be canceled if the model does not exist or
if the coordinate system can't be created, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT CSYS csys
DECLARE_STRUCT GENERAL_CSYS_DATA csys_data

ADD_ARRAY_ELEM csys_data.array_origin_references csys

csys_data.offset_type = "CARTESIAN"
csys_data.offset.x = 100
csys_data.offset.y = 200
csys_data.offset.z = 300
csys_data.orient.x = 15
csys_data.orient.y = 30
csys_data.orient.z = 35

CREATE_GENERAL_CSYS PART csys_data feature


§
READ_GENERAL_CSYS
Retrieves the description of a coordinate system feature.
Syntax
READ_GENERAL_CSYS refFeature<:in> general_csys_data<:out>
Arguments

refFeature
Existing reference to the coordinate system feature.

general_csys_data
Structure variable of type GENERAL_CSYS_DATA to receive the
coordinate system feature definition.
Error handling
The program execution will be canceled if the reference to coordinate
system feature is not existing or the information could not be
retrieved, unless errors are handled by BEGIN_CATCH_ERROR.
Example
BEGIN_GUI_DESCR

USER_SELECT CSYS feat_csys_origin


USER_INPUT_PARAM DOUBLE trans_x
USER_INPUT_PARAM DOUBLE trans_y
USER_INPUT_PARAM DOUBLE trans_z
USER_INPUT_PARAM DOUBLE rot_x
USER_INPUT_PARAM DOUBLE rot_y
USER_INPUT_PARAM DOUBLE rot_z
END_GUI_DESCR

BEGIN_ASM_DESCR

USER_SELECT FEATURE feat_csys


READ_GENERAL_CSYS feat_csys csys_data

DECLARE_REFERENCE feat_csys_origin
GET_ARRAY_ELEM csys_data.array_origin_references 0 feat_csys_origin

DECLARE_VARIABLE DOUBLE trans_x


DECLARE_VARIABLE DOUBLE trans_y
DECLARE_VARIABLE DOUBLE trans_z

trans_x = csys_data.offset.x
trans_y = csys_data.offset.y
trans_z = csys_data.offset.z

DECLARE_VARIABLE DOUBLE rot_x


DECLARE_VARIABLE DOUBLE rot_y
DECLARE_VARIABLE DOUBLE rot_z

rot_x = csys_data.orient.x
rot_y = csys_data.orient.y
rot_z = csys_data.orient.z

CONFIG_ELEM

CLEAR_ARRAY csys_data.array_origin_references
ADD_ARRAY_ELEM csys_data.array_origin_references feat_csys_origin

csys_data.offset.x = trans_x
csys_data.offset.y = trans_y
csys_data.offset.z = trans_z

csys_data.orient.x = rot_x
csys_data.orient.y = rot_y
csys_data.orient.z = rot_z

MODIFY_GENERAL_CSYS feat_csys csys_data

END_ASM_DESCR
§
MODIFY_GENERAL_CSYS
Modifies a coordinate system feature.
Syntax
MODIFY_GENERAL_CSYS refFeature<:in> general_csys_data<:in>
Arguments

ref_feature
Existing reference to the coordinate system feature.

general_csys_data
Structure variable of type GENERAL_CSYS_DATA to modify the coordinate
system.
Error handling
The program execution will be canceled if the reference to the
coordinate system feature does not exist or it can't be modified,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
BEGIN_GUI_DESCR

USER_SELECT CSYS feat_csys_origin


USER_INPUT_PARAM DOUBLE trans_x
USER_INPUT_PARAM DOUBLE trans_y
USER_INPUT_PARAM DOUBLE trans_z
USER_INPUT_PARAM DOUBLE rot_x
USER_INPUT_PARAM DOUBLE rot_y
USER_INPUT_PARAM DOUBLE rot_z
END_GUI_DESCR

BEGIN_ASM_DESCR

USER_SELECT FEATURE feat_csys


READ_GENERAL_CSYS feat_csys csys_data

DECLARE_REFERENCE feat_csys_origin
GET_ARRAY_ELEM csys_data.array_origin_references 0 feat_csys_origin

DECLARE_VARIABLE DOUBLE trans_x


DECLARE_VARIABLE DOUBLE trans_y
DECLARE_VARIABLE DOUBLE trans_z

trans_x = csys_data.offset.x
trans_y = csys_data.offset.y
trans_z = csys_data.offset.z

DECLARE_VARIABLE DOUBLE rot_x


DECLARE_VARIABLE DOUBLE rot_y
DECLARE_VARIABLE DOUBLE rot_z

rot_x = csys_data.orient.x
rot_y = csys_data.orient.y
rot_z = csys_data.orient.z

CONFIG_ELEM

CLEAR_ARRAY csys_data.array_origin_references
ADD_ARRAY_ELEM csys_data.array_origin_references feat_csys_origin

csys_data.offset.x = trans_x
csys_data.offset.y = trans_y
csys_data.offset.z = trans_z

csys_data.orient.x = rot_x
csys_data.orient.y = rot_y
csys_data.orient.z = rot_z

MODIFY_GENERAL_CSYS feat_csys csys_data

END_ASM_DESCR
§
CREATE_HOLE
Creates a hole feature. This command requires Pro/ENGINEER Wildfire 4
or above.
Syntax
CREATE_HOLE model hole_data<:in> ref_feature<:out>
Arguments

model
Model in which the feature should be created. Models are specified in
the following manner.

hole_data
Structure variable of type HOLE_DATA which contains the hole feature
definition.

ref_feature
Name of the reference which should receive the information about the
created hole feature.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR. With the FIX_FAIL_UDF
option failing hole features can be redefined.
Example
DECLARE_STRUCT HOLE_DATA hole_data
hole_data.hole_type = "STANDARD"
hole_data.standard_hole.standard_type = "TAPPED"
hole_data.standard_hole.thread_type = "ISO"
hole_data.standard_hole.screw_size = "M10x1"
hole_data.hole_placement.placement_type = "ON_POINT"
USER_SELECT POINT hole_data.hole_placement.placement_ref1
CREATE_HOLE THIS hole_data feat
§
READ_HOLE
Reads the description of a hole feature. This command requires
Pro/ENGINEER Wildfire 4 or above.
Syntax
READ_HOLE ref_feature<:in> hole_data<:out>
Arguments

ref_feature
Existing reference to the hole feature.

hole_data
Structure variable of type HOLE_DATA which will receive the hole
feature definition.
Error handling
The program execution will be canceled if the reference to the hole
feature is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
READ_HOLE feat hole_data
DECLARE_VARIABLE STRING strMessage
strMessage = hole_data.hole_type
strMessage += "--- shape ----\n"
IF hole_data.hole_type == "STRAIGHT"
strMessage += "diameter: " + ftos(hole_data.straight_hole.diameter) +
"\n";
strMessage += "depth_to_type: " +
hole_data.straight_hole.depth_to_type + "\n";
strMessage += "depth_to_value: " +
ftos(hole_data.straight_hole.depth_to_value) + "\n";
strMessage += "depth_to_ref: " + hole_data.straight_hole.depth_to_ref
+ "\n";
strMessage += "depth_from_type: " +
hole_data.straight_hole.depth_from_type + "\n";
strMessage += "depth_from_value: " +
ftos(hole_data.straight_hole.depth_from_value) + "\n";
strMessage += "depth_from_ref: " +
hole_data.straight_hole.depth_from_ref + "\n";
ELSE_IF hole_data.hole_type == "SKETCHED"
ELSE_IF hole_data.hole_type == "STANDARD"
strMessage += "standard_type: " +
hole_data.standard_hole.standard_type + "\n";
strMessage += "thread_type: " + hole_data.standard_hole.thread_type +
"\n";
strMessage += "screw_size: " + hole_data.standard_hole.screw_size +
"\n";
strMessage += "fit_type: " + hole_data.standard_hole.fit_type + "\n";
strMessage += "add_thread: " +
btos(hole_data.standard_hole.add_thread) + "\n";
strMessage += "thread_depth_type: " +
hole_data.standard_hole.thread_depth_type + "\n";
strMessage += "thread_depth: " +
ftos(hole_data.standard_hole.thread_depth) + "\n";
strMessage += "add_cbore: " + btos(hole_data.standard_hole.add_cbore)
+ "\n";
strMessage += "cbore_diameter: " +
ftos(hole_data.standard_hole.cbore_diameter) + "\n";
strMessage += "cbore_depth: " +
ftos(hole_data.standard_hole.cbore_depth) + "\n";

strMessage += "add_csink: " + btos(hole_data.standard_hole.add_csink)


+ "\n";
strMessage += "csink_diameter: " +
ftos(hole_data.standard_hole.csink_diameter) + "\n";
strMessage += "csink_angle: " +
ftos(hole_data.standard_hole.csink_angle) + "\n";

strMessage += "add_csink_exit: " +


btos(hole_data.standard_hole.add_csink_exit) + "\n";
strMessage += "csink_exit_diameter: " +
ftos(hole_data.standard_hole.csink_exit_diameter) + "\n";
strMessage += "csink_exit_angle: " +
ftos(hole_data.standard_hole.csink_exit_angle) + "\n";

strMessage += "depth_type: " + hole_data.standard_hole.depth_type +


"\n";
strMessage += "depth_value: " +
ftos(hole_data.standard_hole.depth_value) + "\n";
strMessage += "depth_ref: " + hole_data.standard_hole.depth_ref +
"\n";
strMessage += "depth_dim_scheme: " +
hole_data.standard_hole.depth_dim_scheme + "\n";
strMessage += "add_note: " + btos(hole_data.standard_hole.add_note) +
"\n";

ELSE_IF hole_data.hole_type == "CUSTOM"


strMessage += "diameter: " + ftos(hole_data.custom_hole.diameter) +
"\n";

strMessage += "add_cbore: " + btos(hole_data.standard_hole.add_cbore)


+ "\n";
strMessage += "cbore_diameter: " +
ftos(hole_data.standard_hole.cbore_diameter) + "\n";
strMessage += "cbore_depth: " +
ftos(hole_data.standard_hole.cbore_depth) + "\n";

strMessage += "add_csink: " + btos(hole_data.standard_hole.add_csink)


+ "\n";
strMessage += "csink_diameter: " +
ftos(hole_data.standard_hole.csink_diameter) + "\n";
strMessage += "csink_angle: " +
ftos(hole_data.standard_hole.csink_angle) + "\n";

strMessage += "add_csink_exit: " +


btos(hole_data.standard_hole.add_csink_exit) + "\n";
strMessage += "csink_exit_diameter: " +
ftos(hole_data.standard_hole.csink_exit_diameter) + "\n";
strMessage += "csink_exit_angle: " +
ftos(hole_data.standard_hole.csink_exit_angle) + "\n";

strMessage += "depth_type: " + hole_data.custom_hole.depth_type +


"\n";
strMessage += "depth_value: " +
ftos(hole_data.custom_hole.depth_value) + "\n";
strMessage += "depth_ref: " + hole_data.custom_hole.depth_ref + "\n";
strMessage += "depth_dim_scheme: " +
hole_data.custom_hole.depth_dim_scheme + "\n";

ELSE
PRINT "- UNKNOWN -"
END_IF
strMessage += "--- placement ----\n"
strMessage += "placement_type: " +
hole_data.hole_placement.placement_type + "\n";
strMessage += "placement_ref1: " +
hole_data.hole_placement.placement_ref1 + "\n";
strMessage += "placement_ref2: " +
hole_data.hole_placement.placement_ref2 + "\n";
strMessage += "offset_ref1: " + hole_data.hole_placement.offset_ref1
+ "\n";
strMessage += "offset_ref2: " + hole_data.hole_placement.offset_ref2
+ "\n";
strMessage += "orient_ref: " + hole_data.hole_placement.orient_ref +
"\n";
strMessage += "aligned1: " + btos(hole_data.hole_placement.aligned1)
+ "\n";
strMessage += "aligned2: " + btos(hole_data.hole_placement.aligned2)
+ "\n";
strMessage += "offset1: " + ftos(hole_data.hole_placement.offset1) +
"\n";
strMessage += "offset2: " + ftos(hole_data.hole_placement.offset2) +
"\n";
strMessage += "radius: " + ftos(hole_data.hole_placement.radius) +
"\n";
strMessage += "diameter: " + ftos(hole_data.hole_placement.diameter)
+ "\n";
strMessage += "angle: " + ftos(hole_data.hole_placement.angle) +
"\n";
strMessage += "axial: " + ftos(hole_data.hole_placement.axial) +
"\n";
MESSAGE_BOX strMessage
§
MODIFY_HOLE
Modifies a hole feature. This command requires Pro/ENGINEER Wildfire
4 or above.
Syntax
MODIFY_HOLE ref_feature<:in> hole_data<:in>
Arguments

ref_feature
Existing reference to the hole feature.

hole_data
Structure variable of type HOLE_DATA which contains the hole feature
definition.
Error handling
The program execution will be canceled if the reference to the hole
feature is not existing, unless errors are handled by
BEGIN_CATCH_ERROR. With the FIX_FAIL_UDF option failing hole features
can be redefined.
Example
USER_SELECT FEATURE feat
READ_HOLE feat hole_data
hole_data.hole_placement.placement_type = "ON_POINT"
USER_SELECT POINT hole_data.hole_placement.placement_ref1
MODIFY_HOLE feat hole_data
§
CONVERT_HOLE_DATA
Converts the data from an existing hole to another hole type. This
command requires Pro/ENGINEER Wildfire 4 or above.
Syntax
CONVERT_HOLE_DATA ref_feature<:in> existing_hole_data<:in>
"hole_type" converted_hole_data_<:out>
Arguments

ref_feature
Existing reference to the hole feature.

existing_hole_data
Structure variable of type HOLE_DATA which contains the hole feature
definition.

hole_type
String variable containing the new hole type. This could be SKETCHED,
CUSTOM, STRAIGHT or STANDARD.

converted_hole_data
Structure variable of type HOLE_DATA which will receive the converted
hole feature definition.
Error handling
The program execution will be canceled if the reference to the hole
feature is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE featHole
READ_HOLE featHole hole_data
CONVERT_HOLE_DATA featHole hole_data "STRAIGHT" hole_data_straight
hole_data_straight.straight_hole.depth_to_value = 100
MODIFY_HOLE featHole hole_data_straight
§
READ_COMP_INTERFACE
Read the description of a component interface feature.
Syntax
READ_COMP_INTERFACE ref_feature<:in> is_default<:out>
array_constraints<:out>
Arguments

ref_feature
Existing reference to the component interface feature.

is_default
Name of the boolean variable which receives the information if this
is the default interface.

array_constraints
Name of the array which will receive the retrieved information.
Elements are structure values of type CONSTRAINT.
Error handling
The program execution will be canceled if the reference to the
component interface feature is not existing or the description could
not be read, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS PART FEATURE_TYPE "COMP_INTERFACE" interfaces

FOR interface REF ARRAY interfaces


READ_COMP_INTERFACE interface default constraints

PRINT "DEFAULT: %" default

FOR constraint REF ARRAY constraints


PRINT "\tCONSTRAINT"
PRINT "\ttype: %" constraint.type
PRINT "\tcomponent_ref: %" constraint.component_ref
PRINT "\toffset: %" constraint.offset
PRINT ""
END_FOR
END_FOR
REMOVE_FEATURE
Removes a specified feature.
Syntax
REMOVE_FEATURE [options] ref_feature<:in>
Arguments

option
The following delete options are supported. If none of them is
specified FIX is used as default:
FIX — deleting features without dependent child features. The fix
model user interface will be prompted in case of regeneration
failures.
CLIP— deleting features including dependent child features.
CLIP_ALL — deleting features including all following features.
Other supported options are:
INDIV_GP_MEMBERS — if this option is set, features which are member
of a group will be suppressed individually.

ref_feature
Reference to a feature which should be removed.
Error handling
The program execution will be canceled if the feature reference is
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refFeatureToRemove
REMOVE_FEATURE refFeatureToRemove
§
REMOVE_FEATURES
Removes an array of features in a model.
Syntax
REMOVE_FEATURES [options] arrayFeatures<:in>
Arguments

options
The following delete options are supported. If none of them is
specified FIX is used as default:
FIX — deleting features without dependent child features. The fix
model user interface will be prompted in case of regeneration
failures.
CLIP— deleting features including dependent child features.
CLIP_ALL — deleting features including all following features.
Other supported options are:
INDIV_GP_MEMBERS — if this option is set, features which are member
of a group will be removed individually.

arrayFeatures
Array of features which should be removed.
Error handling
The program execution will be canceled if the array is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS ASSEMBLY FEATURE_PARAM "REMOVE_ME"
arrayFeaturesToRemove
REMOVE_FEATURES arrayFeaturesToRemove
REORDER_FEATURES
Reorders features in the Creo Elements/Pro model tree.
Syntax:
REORDER_FEATURES ref_feature_reorder<:in> | arrayFeatures<:in>
'order_option' ref_feature_pos
Arguments

ref_feature_reorder | arrayFeatures
Name of an existing reference to a feature or an array of feature
references which should be placed in another position in the model
tree.

order_option
Either BEFORE or AFTER has to be specified to indicate the order.

ref_feature_pos
Feature indicating the position which should be used for re-ordering.
Error handling
The program execution will be canceled if the references for feature
reordering or for indicating the reorder position are not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refFeature1
USER_SELECT FEATURE refFeature2
REORDER_FEATURES refFeature1 AFTER refFeature2
§
SET_AUTO_REORDER
Reorders a feature to a specific position in the model tree. The
feature is always moved in the defined position for each
regeneration, save and creation of a new feature.
Syntax:
SET_AUTO_REORDER refFeature<:in> positionINT
Arguments

refFeature
Name of an existing reference to a feature which should be reorders
to another position in the model tree.

position
Variable of type integer which contains the feature position.
Error handling
The program execution will be canceled if the reference for feature
reordering is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.

Note
Negative numbers reorder the feature to the very end of the model
tree. The integer parameter BUW_AUTO_REORDER is set the feature to
store the reorder position. Additional a boolean model parameter
BUW_AUTO_REORDER marks a model to contain auto-reorder features.
Example
USER_SELECT FEATURE refFeature
SET_AUTO_REORDER refFeature -1
GET_FEATURE_STATE
Determines if a feature is suppressed or resumed.
Syntax
GET_FEATURE_STATE reference_feature<:in> parameter<:out>
Arguments

reference_feature
Name of an existing reference to a feature.

parameter
Name of the string parameter which will receive either SUPPRESSED or
RESUMED as feature state.
Error handling
The program execution will be canceled if the feature reference is
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Suppressed features could be accessed by SEARCH_MDL_REF with the
parameter ALLOW_SUPPRESSED.
Example
SEARCH_MDL_REF ALLOW_SUPPRESSED THIS FEATURE PLANE_XY refPlaneXY
GET_FEATURE_STATE refPlaneXY paramState
§
GET_FEATURE_STATE_EX
Determines the state of a feature.
Syntax
GET_FEATURE_STATE_EX reference_feature<:in> parameter<:out>
Arguments

reference_feature
Name of an existing reference to a feature.

parameter
Name of the string parameter which will receive the feature state.
Error handling
The program execution will be canceled if the feature reference is
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The following states are possible:
ACTIVE — the feature is active.
INACTIVE — the feature is inactive.
FAMTAB_SUPPRESSED — the feature is suppressed by family table.
SIMPREP_SUPPRESSED — the feature is suppressed by simplified
representation.
PROG_SUPPRESSED — the feaure is suppressed by Pro/PROGRAM.
SUPPRESSED — the feature is suppressed.
UNREGENERATED — the feature is active but not regenerated.
Example
SEARCH_MDL_REFS ALLOW_SUPPRESSED ASSEMBLY FEATURE "*" arrayFeatures
FOR feature REF ARRAY arrayFeatures
GET_FEATURE_STATEEX feature state
PRINT "%> %" state feature
END_FOR
§
SET_FEATURE_STATE
Suppresses or resumes a specified features.
Syntax
SET_FEATURE_STATE [option] reference_feature<:in> |
arrayFeatures<:in> state
Arguments

option
Valid options are:
INDIV_GP_MEMBERS — if this option is set, features which are member
of a group will be suppressed individually.
SUSPEND_DEPENDENT — if this option is set, dependent components and
features will be set to failed state.
FREEZE_DEPENDENT — if this option is set, dependent components will
be frozen and features will be set to failed state.

reference_feature
Name of an existing reference to a feature.

arrayFeatures
Name of an array of feature references. This could be used instead of
the reference to a single feature.

state
SUPPRESSED — to suppress a feature.
RESUMED — to resume a feature.
Error handling:
The program execution will be canceled if the feature reference is
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Suppressed features could be accessed by SEARCH_MDL_REF with the
parameter ALLOW_SUPPRESSED.
Example
SEARCH_MDL_REF ALLOW_SUPPRESSED THIS FEATURE PLANE_XY refPlaneXY
SET_FEATURE_STATE refPlaneXY RESUMED
SEARCH_MDL_REFS THIS FEATURE_PARAM BUW_OBJECT_ROLE WITH_CONTENT
STRING "bore" arrayBores
SET_FEATURE_STATE arrayBores SUPPRESSED
§
GET_FEATURE_DEPENDENCY
Retrieves the dependency setting of a copy geom feature.
Syntax
GET_FEATURE_DEPENDENCY reference_feature<:in> parameter<:out>
Arguments

reference_feature
Name of an existing reference to a copy geom feature.

parameter
Name of the string parameter which will the dependency state. Valid
values are listed in the feature dependency specification.
Error handling
The program execution will be canceled if the feature reference is
not existing or the state could not be figured out, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS FEATURE_TYPE "GEOM_COPY" refFeatCopyGeom
GET_FEATURE_DEPENDENCY refFeatCopyGeom stateDependency
§
SET_FEATURE_DEPENDENCY
Sets the dependency of a copy geom feature.
Syntax
SET_FEATURE_DEPENDENY reference_feature<:in> state
Arguments

reference_feature
Name of an existing reference to a copy geom feature.

state
Feature dependency state. Valid values are listed in the feature
dependency specification.
Error handling:
The program execution will be canceled if the feature reference is
not existing or the state could not be set, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS FEATURE_TYPE "GEOM_COPY" refFeatCopyGeom
SET_FEATURE_DEPENDENCY refFeatCopyGeom INDEPENDENT
§
GET_FEATURE_DEPENDENCY_NAME
Retrieves the name of the associated source model to a copy geom
feature.
Syntax
GET_FEATURE_DEPENDENCY_NAME reference_feature<:in> parameter<:out>
Arguments

reference_feature
Name of an existing reference to a copy geom feature.

parameter
Name of the string parameter which will receive the name of the
associated source model.
Error handling
The program execution will be canceled if the feature reference is
not existing or the name could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS FEATURE_TYPE "GEOM_COPY" refFeatCopyGeom
GET_FEATURE_DEPENDENCY_NAME refFeatCopyGeom nameDependentModel
RETRIEVE_MDL nameDependentModel refDependentModel
§
GET_FEATURE_UPDATE_NOTIFICATION
Retrieves the update notification status of a copy geometry feature.
This command requires Creo 3.0 or above. In case the Creo license
option 332 - Update_Control is not available the result will always
be NOTIFICATION_OFF.
Syntax
GET_FEATURE_UPDATE_NOTIFICATION reference_feature<:in>
parameter<:out>
Arguments

reference_feature
Name of an existing reference to a copy geom feature.

parameter
Name of the string parameter which will the update notifiation state.
Valid values are listed in the feature update notification
specification.
Error handling
The program execution will be canceled if the feature reference is
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS FEATURE_TYPE "GEOM_COPY" refFeatCopyGeom
GET_FEATURE_UPDATE_NOTIFICATION refFeatCopyGeom
stateUpdateNotification
§
SET_FEATURE_UPDATE_NOTIFICATION
Sets the update notification status of a copy geometry feature. This
command requires Creo 3.0 or above. In case the Creo license option
332 - Update_Control is not available or the feature dependency is
not set to INDEPENDENT, the function will not do anything.
Syntax
SET_FEATURE_UPDATE_NOTIFICATION reference_feature<:in> state
Arguments

reference_feature
Name of an existing reference to a copy geom feature.

state
Feature dependency state. Valid values are listed in the feature
update notification specification.
Error handling:
The program execution will be canceled if the feature reference is
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS FEATURE_TYPE "GEOM_COPY" refFeatCopyGeom
SET_FEATURE_DEPENDENCY refFeatCopyGeom INDEPENDENT
SET_FEATURE_UPDATE_NOTIFICATION refFeatCopyGeom NOTIFICATION_ON
§
GROUP_FEATURES
Group features which are specified in an array.
Syntax
GROUP_FEATURES arrayRefFeatures<:in> [ref_group<:out>]
Arguments

arrayRefFeatures
Array with references of features. In case geometrical references are
supplied the feature containing the reference is used.

ref_group
Optional name for the reference of the created group.
Error handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
The grouping functionality is limited to the Creo Elements/Pro
grouping capabilities. Therefor all features must belong to the same
model.
§
UNGROUP_FEATURES
Dissolves a group of features.
Syntax
UNGROUP_FEATURES refGroup<:in>
Arguments

refGroup
Reference to a group or to a member of a group.
Error handling
The program execution will be canceled if the feature reference is
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE group
UNGROUP_FEATURES group
GET_GROUP_HEAD
Retrieves the immediate or top-level head of a group member.
Syntax
GET_GROUP_HEAD [options] refGroupElement<:in> refGroupHead<:out>
Arguments

options
The following options are supported:
TOPLEVEL — to retrieve the top level group head.

ALLOW_SELF valueBOOL — to determine if for a supplied group, the


group head can be the identical feature. Default is TRUE.

refGroupElement
Existing reference to a group header or an element of the group.

refGroupHead
Name of the reference which will receive the retrieved information.
Error handling
The program execution will be canceled if the supplied reference does
not exist or the group could not be detected, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
IF REF_GROUP_MEMBER
GET_GROUP_HEAD TOPLEVEL feat toplevel_group
GET_GROUP_HEAD feat immediate_group
END_IF
GET_GROUP_FEATURE
Supplies reference to a specific feature of a group.
Syntax
GET_GROUP_FEATURE [options] refGroupElement<:in> indexINT
refFeature<:out>
Arguments

options
The following options are supported:
ALLOW_SUPPRESSED — to include also suppressed group features.

refGroupElement
Existing reference to a group header or an element of the group.

index
Index to specify the element of the group. 0 means group header, 1
means first feature of the group.

refFeature
Name of the reference which will receive the retrieved information.
Error handling
The program execution will be canceled if the supplied reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
GET_GROUP_FEATURE works similar as option UDF_EXP_REF with type
FEATURE when creating UDFs, but the index is different. 0 is used for
the group header instead for the first feature of the group.
Example
CREATE_UDF test_udf ASSEMBLY created_udf
UDF_REF REF_CSYS selCsys
END_CREATE_UDF
GET_GROUP_FEATURE created_udf 1 firstFeature
GET_GROUP_FEATURE_NUM
Retrieves number of features in a group.
Syntax
GET_GROUP_FEATURE_NUM [options] refGroupElement<:in>
paramNumberFeatures<:out>
Arguments

options
The following options are supported:
ALLOW_SUPPRESSED — to include also suppressed group features.

refGroupElement
Existing reference to a group header or a element of the group.

paramNumberFeatures
Name of the parameter which will receive the number of features in
the group.
Error handling
The program execution will be canceled if the supplied reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
CREATE_UDF test_udf ASSEMBLY created_udf
UDF_REF REF_CSYS selCsys
END_CREATE_UDF
GET_GROUP_FEATURE_NUM created_udf num
PRINT "Group contains % features" num
§
MOVE_TO_FOOTER
Moves a feature or an array of features to the footer.
Syntax:
MOVE_TO_FOOTER ref_feature<:in> | arrayFeatures<:in>
Arguments

ref_feature
Name of an existing reference to a feature which should be moved to
the footer.

arrayFeatures
Name of an array of feature references which should be moved to the
footer.
Error handling
The program execution will be canceled if the reference to the
feature or the array are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Moving features to the footer is internally done by a mapkey,
therefor the function will not fail even if the feature can not be
moved to the footer.
Example
SEARCH_MDL_REFS PART FEATURE_TYPE "ANALYSIS" arrayFeatAnalysis
MOVE_TO_FOOTER arrayFeatAnalysis
§
MOVE_FROM_FOOTER
Moves a feature or an array of features from the footer.
Syntax:
MOVE_FROM_FOOTER ref_feature<:in> | arrayFeatures<:in>
Arguments

ref_feature
Name of an existing reference to a feature which should be moved from
the footer.

arrayFeatures
Name of an array of feature references which should be moved from the
footer.
Error handling
The program execution will be canceled if the references for feature
or the array are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Moving features from the footer is internally done by a mapkey,
therefor the function will not fail even if the feature can not be
moved from the footer.
Example
SEARCH_MDL_REFS PART FEATURE_TYPE "ANALYSIS" arrayFeatAnalysis
MOVE_FROM_FOOTER arrayFeatAnalysis
About Commands for Model Operations
Commands for model operations. Commands for the following topics are
available:
Model Assembling — to assemble a model and to retrieve and change
constraint information.
Model File Operations — to retrieve, save and erase models.
Model Properties — to retrieve and modify model properties.
Model Notebooks —to declare and undeclare model notebooks.
Model Tolerances — to read and set model tolerances.
Model Units — to retrieve and modify model units.
Model Sessions — to inquiry and set session related model
information.
Model Manipulation — to manipulate models.
Model Analysis — to analyze models.
About Commands for Model Assembling
Commands for assembling a model and retrieving and changing
constraint information.
The following commands are available:
ASSEMBLE — to assemble a model by specified constraints.
ASSEMBLE_EX — to assembly a model with a variable number of
constraints.
ASSEMBLE_SKELETON — to assemble the first skeleton in an assembly.
CREATE_SKELETON — to create the first skeleton based on name and
template.
SET_COMP_POS — to set the position of a under-constraint component.
DRAG_COMP_POS — to place a component dynamically.
GET_COMP_PLACED — to determine the placement state of a component.
SET_COMP_PLACED — to set the placement state of a component.
ADD_CONSTRAINTS — to add further constraints to a placed component.
REMOVE_CONSTRAINT — to remove a constraint from a placed component.
REMOVE_ALL_CONSTRAINTS — to remove all constraints from a placed
component.
GET_CONSTRAINT_SETS — to retrieve all constraint sets from a
component.
GET_CONSTRAINT_SET — to retrieve a constraint set from a component.
GET_CONSTRAINTS — to retrieve all constraints form a component.
SET_CONSTRAINTS — to modify the constraints of a component.
GET_CONSTRAINT — to retrieve a constraint from a component.
SET_CONSTRAINT — to modify a constraint of a component.
ASSEMBLE
Assembles a library component by specifying the constraints.
Syntax
ASSEMBLE model [target] [MECHANISM mechanismType] [FREEZE_FAILED
freezeBOOL] [MEASURECOPY measurecopyTRUE]
[relation line] UDF_ref<:in> param1<:out> param2<:out> ...
CONTRAINT1
CONTRAINT2
...
CONSTRAINT_SET1
CONSTRAINT_SET2
...
END_ASSEMBLE
Arguments

model
The model can be specified by rules for model specification. Instead
of this also the keyword THIS_MEASURECOPY can be used to add
relations at component level.

target
Optional specification of the assembly target. Models are specified
in the following manner. In case the target is not specified, THIS is
used as target.

MECHANISM mechanismType
Optional mechanism declaration.

FREEZE_FAILED freeze
Optional boolean parameter decides if the component is frozen on
failing placement constraints or if an error will show up. In case
the option is not set the Creo Elements/Pro configuration option
freeze_failed_assy_comp determines the behaviour.

MEASURECOPY measurecopy
Optional boolean parameter decides if the relation lines should be
used.

relation line
Is only available for the model keyword THIS_MEASURECOPY or the
option MEASURECOPY set to TRUE. Parameters of an UDF reference are
bound to parameters of the component by a component relation. For
this case the names of the UDF parameters must match to the name of
the parameter in the component.

Constraints
Multiple constraints can be defined. More information is in the
chapter how to specify constraints.

Constraint Sets
Additional to single constraints, also complete constraint sets can
be defined. More information is in the chapter how to specify
constraint sets.
Example
! create UDF with analysis features.
CREATE_UDF measure_z_dist_csys_plane ASSEMBLY MEASURE_UDF
UDF_REF REF_CSYS SELECTED_CSYS
UDF_REF REF_PLANE SELECTED_PLANE
UDF_EXP_PARAM DISTANCE_Z
END_CREATE_UDF

ASSEMBLE THIS_MEASURECOPY
MEASURE_UDF DISTANCE_Z
CSYS SELECTED_CSYS COMP_CSYS
END_ASSEMBLE
§
ASSEMBLE_EX
Assembles a library component by specifying the constraints via an
array. This commend has the same functionality as an ASSEMBLE ...
END_ASSEMBLE block, but it allows to store the constraints in an
array and therefor is more flexible.
Syntax
ASSEMBLE_EX model array_constraints<:in> | array_constraint_sets<:in>
[target] [MECHANISM mechanismType] [FREEZE_FAILED freezeBOOL]
[MEASURECOPY measurecopyTRUE] [RELATION_LINE UDF_ref<:in>
param1<:out> param2<:out> ... ]
Arguments

model
The model can be specified by rules for model specification. Also the
keyword THIS_MEASURECOPY is available in combination to use the
RELATION_LINE.

array_constraints | array_constraint_sets
Name of an existing array of type CONTRAINT or CONSTRAINT_SET to
specify constraints or constraint sets.

target
Optional specification of the assembly target. Models are specified
in the following manner. In case the target is not specified, THIS is
used as target.

MECHANISM mechanismType
Optional mechanism declaration.

FREEZE_FAILED freeze
Optional boolean parameter decides if the component is frozen on
failing placement constraints or if an error will show up. In case
the option is not set the Creo Elements/Pro configuration option
freeze_failed_assy_comp determines the behaviour.

MEASURECOPY measurecopy
Optional boolean parameter decides if the relation lines should be
used.

RELATION_LINE UDF_ref<:in> param1<:out> param2<:out>


Is only available for the model keyword THIS_MEASURECOPY or the
option MEASURECOPY set to TRUE. Parameters of an UDF reference are
bound to parameters of the component by a component relation. For
this case the names of the UDF parameters must match to the name of
the parameter in the component.
Example
! create UDF with analysis features.
DECLARE_STRUCT UDF_CONSTRAINT udf_constraint
DECLARE_ARRAY arrayUdfConstraints

udf_constraint.type = "UDF_REF"
udf_constraint.name = "REF_CSYS"
udf_constraint.reference_in = SELECTED_CSYS
ADD_ARRAY_ELEM arrayUdfConstraints udf_constraint

udf_constraint.type = "UDF_REF"
udf_constraint.name = "REF_PLANE"
udf_constraint.reference_in = SELECTED_PLANE
ADD_ARRAY_ELEM arrayUdfConstraints udf_constraint

udf_constraint.type = "UDF_EXP_PARAM"
udf_constraint.name = "DISTANCE_Z"
ADD_ARRAY_ELEM arrayUdfConstraints udf_constraint

DECLARE_MAP mappedExports
CREATE_UDF_EX MEASURE_Z_DIST_CSYS_PLANE ASSEMBLY arrayUdfConstraints
ADD_EXP_TO_MAP mappedExports MEASURE_UDF

DECLARE_STRUCT CONSTRAINT constraint


DECLARE_ARRAY arrayConstraint

constraint.type = "CSYS"
constraint.assembly_ref = SELECTED_CSYS
constraint.component_ref = COMP_CSYS
ADD_ARRAY_ELEM arrayConstraint constraint

ASSEMBLE_EX THIS_MEASURECOPY arrayConstraint RELATION_LINE


MEASURE_UDF DISTANCE_Z
§
ASSEMBLE_SKELETON
Assembles the first skeleton in an assembly.
Syntax
ASSEMBLE_SKELETON skeleton<:in> target<:in>
Arguments

skeleton
The skeleton model which should be assembled.

target
The assembly model which should receive the skeleton.
Error handling
The program execution will be canceled if the assembly or the
skeleton model do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
This command works only for the first skeleton model and it fails for
succeeding even if the Creo configuration option
multiple_skeleton_allowed is set to yes. Use the normal ASSEMBLE
command to add further skeletons.
Example
ASSEMBLE_SKELETON skeleton ASSEMBLY
§
CREATE_SKELETON
Creates a skeleton in an assembly based on name and template.
Syntax
CREATE_SKELETON "skeleton_name" template<:in> target<:in>
Arguments

skeleton_name
Name which should be used for the skeleton. Any string expression is
allowed.

template
Template model which is used to create the skeleton. This could be a
regular part or a skeleton model.

target
The assembly model which should receive the skeleton.
Error handling
The program execution will be canceled if the assembly or the
template model do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
This command works only for the first skeleton model and it fails for
succeeding even if the Creo configuration option
multiple_skeleton_allowed is set to yes. Use the normal ASSEMBLE
command to add further skeletons.
Example
GET_MDL_NAME ASSEMBLY name
RETRIEVE_MDL "lib:template.prt" template
CREATE_SKELETON name + "_SKEL0001" template ASSEMBLY
§
SET_COMP_POS
Sets the position of a component which is under-constraint.
Syntax
SET_COMP_POS model<:in> transformation<:in>
Arguments

model
The model which should be re-located and re-oriented.

transformation
Existing structure variable of type TRANSFORMATION.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example

ASSEMBLE THIS
PACKAGED
END_ASSEMBLE

USER_SELECT CURVE curve


GET_REF_POS NULL curve pos

DECLARE_STRUCT TRANSFORMATION transform


transform.trans_x = pos.x
transform.trans_y = pos.y
transform.trans_z = pos.z

SET_COMP_POS THIS transform


§
DRAG_COMP_POS
Allows to place a component dynamically. Click to left mouse button
to drop it.
Syntax
DRAG_COMP_POS model<:in>
Arguments

model
The model which should be placed dynamically.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL mdl
DRAG_COMP_POS mdl
§
GET_COMP_PLACED
Determines the placement state of a component. Unplaced component are
usually created via Model > Assemble > Include.
Syntax
GET_COMP_PLACED model<:in> placed<:out>
Arguments

model
The model which placement state should be determined.

placed
Boolean variable which receives the placement state.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT comp
GET_COMP_PLACED comp placed
PRINT "%" placed
§
SET_COMP_PLACED
Sets the placement state of a component. Unplaced component are
usually created via Model > Assemble > Include.
Syntax
SET_COMP_PLACED model<:in> placedBOOL
Arguments

model
The model which should be placed or unplaced.

placed
Boolean variable to set the placement state of a component.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT comp
SET_COMP_PLACED comp TRUE
§
ADD_CONSTRAINTS
Adds further constraints to a placed component.
Syntax
ADD_CONSTRAINTS model<:in> [FREEZE_FAILED freezeBOOL]
CONSTRAINT1
CONSTRAINT2
...
END_ADD_CONSTRAINTS
Arguments

model
The model for which the constraints should be added.

FREEZE_FAILED freeze
Optional boolean parameter decides if the component is frozen on
failing placement constraints or if an error will show up. In case
the option is not set the Creo Elements/Pro configuration option
freeze_failed_assy_comp determines the behaviour.

Constraints
Multiple constraints can be defined. More information is in the
chapter how to specify constraints.
Example
ADD_CONSTRAINTS model
ALIGN ADTM1 DTM1
END_ADD_CONSTRAINTS
§
REMOVE_CONSTRAINT
Removes a constraint of a placed component. This command does not
remove interface constraints.
Syntax
REMOVE_CONSTRAINT model<:in> index INTEGER
Arguments

model
The model from which the constraint should be removed.

index
The index of the constraint. The first constraint has the number 0.
Error handling
The program execution will be canceled if the model or the constraint
does not exist or the constraint could not be removed, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT component
REMOVE_CONSTRAINT component 0
§
REMOVE_ALL_CONSTRAINTS
Removes all constraints of a placed component, including interface
constraints. This command is available since Creo 2.0 M230 / Creo 3.0
M110 and above.
Syntax
REMOVE_ALL_CONSTRAINT model<:in>
Arguments

model
The model from which the constraints should be removed.
Error handling
The program execution will be canceled if the model does not exist or
the constraints could not be removed, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT component
REMOVE_ALL_CONSTRAINTS
§
GET_CONSTRAINT_SETS
Retrieves all constraint sets from a component.
Syntax
GET_CONSTRAINT_SETS model<:in> array_constraint_sets<:out>
Arguments

model
The model from which the constraint sets should be retrieved.

array_constraint_sets
Name of the array which will receive the retrieved information.
Elements are structure values of type CONSTRAINT_SET.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_CONSTRAINT_SETS comp constraintSets
PRINT "+++ START +++"
FOR constraint_set REF ARRAY constraintSets
PRINT "CONSTRAINT SET: active: % mechanism: %"
constraint_set.active constraint_set.mechanism
FOR constraint REF ARRAY constraint_set.array_constraints
PRINT "\tCONSTRAINT"
PRINT "\ttype: %" constraint.type
PRINT "\tassembly_ref: %" constraint.assembly_ref
PRINT "\tcomponent_ref: %" constraint.component_ref
PRINT "\toffset: %" constraint.offset
PRINT "\tactive: %" constraint.active
PRINT ""
END_FOR
PRINT ""
END_FOR
§
GET_CONSTRAINT_SET
Retrieve a constraint sets from a component.
Syntax
GET_CONSTRAINT_SET model<:in> index INTEGER constraint_set<:out>
Arguments

model
The model from which the constraint set should be retrieved.

index
The index of the constraint set. The first constraint set has the
number 0.

constraint_set
Name of the structure variable of type CONSTRAINT_SET which will
receive the information.
Error handling
The program execution will be canceled if the model or the constraint
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_CONSTRAINT_SET comp 0 constraint_set
PRINT "+++ START +++"
PRINT "CONSTRAINT SET: active: % mechanism: %" constraint_set.active
constraint_set.mechanism
FOR constraint REF ARRAY constraint_set.array_constraints
PRINT "\tCONSTRAINT"
PRINT "\ttype: %" constraint.type
PRINT "\tassembly_ref: %" constraint.assembly_ref
PRINT "\tcomponent_ref: %" constraint.component_ref
PRINT "\toffset: %" constraint.offset
PRINT "\tactive: %" constraint.active
PRINT ""
END_FOR
§
GET_CONSTRAINTS
Retrieves all constrains from a component.
Syntax
GET_CONSTRAINTS model<:in> array_constraints<:out>
Arguments

model
The model from which the constraints should be retrieved.

array_constraints
Name of the array which will receive the retrieved information.
Elements are structure values of type CONSTRAINT.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_CONSTRAINTS comp constraints
PRINT "+++ START +++"
FOR constraint REF ARRAY constraints
PRINT "\tCONSTRAINT"
PRINT "\ttype: %" constraint.type
PRINT "\tassembly_ref: %" constraint.assembly_ref
PRINT "\tcomponent_ref: %" constraint.component_ref
PRINT "\toffset: %" constraint.offset
PRINT "\tactive: %" constraint.active
PRINT ""
END_FOR
§
SET_CONSTRAINTS
Set the constrains for a component.
Syntax
SET_CONSTRAINTS model<:in> array_constraints<:in> [FREEZE_FAILED
freezeBOOL]
Arguments

model
The model for which the constraint should be set.

array_constraints
Existing array with structure elements of type CONSTRAINT.

FREEZE_FAILED freeze
Optional boolean parameter decides if the component is frozen on
failing placement constraints or if an error will show up. In case
the option is not set the Creo Elements/Pro configuration option
freeze_failed_assy_comp determines the behaviour.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
RETRIEVE_MDL "PIN.prt" mdlPin

ASSEMBLE mdlPin
PACKAGED
END_ASSEMBLE

SEARCH_MDL_REF ASSEMBLY MODEL "BLOCK" mdlBlock

DECLARE_STRUCT CONSTRAINT constraint1


constraint1.index = 0
constraint1.type = ALIGN
SEARCH_MDL_REF mdlBlock AXIS "*" constraint1.assembly_ref
SEARCH_MDL_REF mdlPin AXIS "*" constraint1.component_ref

DECLARE_STRUCT CONSTRAINT constraint2


constraint2.index = 1
constraint2.type = MATE_OFF
SEARCH_MDL_REF mdlBlock FACE "BLIND_HOLE_FACE"
constraint2.assembly_ref
SEARCH_MDL_REF mdlPin FACE "PIN_END_FACE" constraint2.component_ref
constraint2.offset = 10.0

DECLARE_ARRAY array_constraints
ADD_ARRAY_ELEM array_constraints constraint1
ADD_ARRAY_ELEM array_constraints constraint2

SET_CONSTRAINTS mdlPin array_constraints


§
GET_CONSTRAINT
Retrieve a constraint from a component.
Syntax
GET_CONSTRAINT model<:in> index INTEGER constraint<:out>
Arguments

model
The model from which the constraint should be removed.

index
The index of the constraint set. The first constraint has the number
0.

constraint
Name of the structure variable of type CONSTRAINT which will receive
the information.
Error handling
The program execution will be canceled if the model or the constraint
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_CONSTRAINT comp 0 constraint
PRINT "+++ START +++"
PRINT "\tCONSTRAINT"
PRINT "\ttype: %" constraint.type
PRINT "\tassembly_ref: %" constraint.assembly_ref
PRINT "\tcomponent_ref: %" constraint.component_ref
PRINT "\toffset: %" constraint.offset
PRINT "\tactive: %" constraint.active
§
SET_CONSTRAINT
Modifies a constraint of a component.
Syntax
SET_CONSTRAINT model<:in> index INTEGER constraint<:in>
[FREEZE_FAILED freezeBOOL]
Arguments

model
The model from which the constraint should be removed.

index
The index of the constraint set. The first constraint has the number
0.

constraint
Existing structure variable of type CONSTRAINT.

FREEZE_FAILED freeze
Optional boolean parameter decides if the component is frozen on
failing placement constraints or if an error will show up. In case
the option is not set the Creo Elements/Pro configuration option
freeze_failed_assy_comp determines the behaviour.
Error handling
The program execution will be canceled if the model or the constraint
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_CONSTRAINT comp 0 constraint
constraint.offset = 50
SET_CONSTRAINT comp 0 constraint
About Commands for Model File Operations
Commands for retrieving, saving and erasing models.
The following commands are available:
SAVE_MDL — to save a model to disk.
ERASE_NOT_DISPLAYED — to erase all models from memory which are not
displayed by mapkey.
ERASE_NOT_DISPLAYED_EX — to erase all models from memory which are
not displayed by a Creo/TOOLKIT command.
ERASE_MDL — to erase a specific model from memory.
COPY_MDL — to create a copy of the model.
BACKUP_MDL — to save a copy of the model to a different folder.
LOAD_MDL — to let the user open a model by dialog.
RETRIEVE_MDL — to retrieve a model by name.
USE_LIBRARY_MDL — to use a model from the library.
GET_MFG_ASM — to retrieve the associated assembly to a MFG model.
SAVE_MDL
Saves a Creo Elements/Pro model to disk.
Syntax
SAVE_MDL refMdl<:in> options
Arguments

refMdl
Reference to an existing model.

options
the following options are supported:
INCLUDE_DRAWINGS — saves also drawings of the main model or of sub
components if they have the same name.
CHECK_SAVED — checks for all components if they have been saved.
This option is used to work around Pro/TOOLKIT bugs.
SAVE_OBJECTS — influences the saving procedure identical to the
Pro/ENGINEER configuration option save_object. The following
possibilities are supported:
DEFAULT — uses the Pro/ENGINEER configuration option.
CHANGED_AND_SPECIFIED — saves the top-level object plus any
modified, dependent object.
ALL — stores all objects.
CHANGED — stored only chanced objects.
CHANGED_AND_UPDATED — stores changed an updated objects.
Note
If a save as functionality is required, make a copy of the model by
COPY_MDL.
ERASE_NOT_DISPLAYED
Erases models which are not displayed from Creo Parametric by using a
mapkey. Same functionality as the Creo Parametric menu sequence:
File > Erase > Not Displayed.
This has slightly other side effects than the ERASE_NOT_DISPLAYED_EX
command.
Syntax
ERASE_NOT_DISPLAYED
ERASE_NOT_DISPLAYED_EX
Erases models which are not displayed from Creo Parametric by a
Creo/TOOLKIT command. This has slightly other side effects than
ERASE_NOT_DISPLAYED which works by using a mapkey.
Use this command preferably for new developments.
Syntax
ERASE_NOT_DISPLAYED_EX
ERASE_MDL
Erases a model from Creo Elements/Pro.
Syntax
ERASE_MDL model
Description

model
Model which is to be erased from memory according to model
specification.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR. If the model
could not be erased from memory, no error occurs.
Note
The command does not remove the current model on the screen. Trying
to remove the current models leaded to random crashes in the past,
therefor this is disabled now.
Example
COPY_MDL THIS_10 "new" newMdl
REPLACE_COMPONENT THIS_10 newMdl
ERASE_MDL newMdl
COPY_MDL
Creates a copy of an existing Creo model.
Syntax
COPY_MDL [options] model "name" refNewMdl<:out> [consecNumber<:out>]
Arguments

options
The following options are supported:
ADD_REQ_SHORT
Indication that a project short cut is automatically appended, even
if it was not specified by an '#'.

CONSEC_NUMBER number INT


Specifies value for consecutive number. In case the specified
number is already in use the next free one will be taken.
PROJECT_SHORT "short"
Specifies a different project short cut as the one from the main
assembly.

UPDATE_COMMON_NAME update BOOL


Specifies if the PTC_COMMON_NAME is updated automatically. Default
is TRUE.

COPY_DRAWING rename BOOL


Specifies if an associated drawing to a part or assembly should be
copied. Default is TRUE.

model
The model which should be copied.

name
New model name. Any string expression is allowed. The model can name
contain a special syntax to build up this name.

refNewMdl
Variable to retrieve the reference of the new model.

consecNumber
Optional parameter which receives the consecutive number. This can be
used to have the same consecutive numbers in sub assemblies.
Error handling
The program execution will be canceled if the model could not be
found or copied, unless errors are handled by BEGIN_CATCH_ERROR.
Example
COPY_MDL THIS "sample" refSample
BACKUP_MDL
Saves a copy the model to a specific folder.
Syntax
BACKUP_MDL model "folder"
Arguments

model
The model which should be saved.

folder
Folder in which the model should be saved. According to the path
specification it could be either in library or in working directory.
Any string expression is allowed.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
BACKUP_MDL THIS "d:\temp"
LOAD_MDL
Executes file open dialog and lets the user select a model.
Syntax
LOAD_MDL [option] "filter" reference<:out>
Arguments

options
The following options are supported:
USE_GENERIC — In case a family table generic is chosen, the user is
normally prompt if he wants to select an instance. This option
avoids that.

filter
Specifies the filter for the file open dialog box. For example
'*.prt' specifies the filter for all parts. Any string expression is
allowed.

reference
Name of the reference which will retrieve the model.
Error handling
The program execution will be canceled if the user cancels the
operation or if the model could not be retrieved, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
LOAD_MDL "PROJ_*" refModel
RETRIEVE_MDL
Retrieves a model specified by name. To retrieve an instance of a
family table, use instance_name<generic_name> as Creo Elements/Pro
does.
Syntax
RETRIEVE_MDL [option] "model_name" refMdl<:out>
Arguments

model_name
Specifies the model name according to the path specification. Any
string expression is allowed. The extension (e.g. '.prt', '.asm')
must be included.

option
The following options are available:
INCLUDE_DRAWINGS — if this option is set, drawings of the same name
as model and sub models are automatically retrieved in session.
ASK_FOR_SIMPREP — if this option is set, Creo Elements/Pro prompts
the user which simplified representation to open.
USE_SIMPREP "repname" — if this option is set, the simplified
representation will be opened.

refMdl
Name of the reference which will receive the model.
Error handling
The program execution will be canceled if the model could not be
retrieved, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The command does not set the directory of the retrieved model to your
current working directory. This can be achieve by the BACKUP_MDL
command. In case it should be used like the model which comes with a
asm, asm_copy, part or part_copy tab file, use the USE_LIBRARY_MDL
command. In order to retrieve manufacturing models, the extension
'.mfg' can be used for manufacturing assemblies.
Example
RETRIEVE_MDL "lib:example.prt" refPart
RETRIEVE_MDL "example.asm" refAsm
RETRIEVE_MDL "instance<generic>.prt" refInstance
§
USE_LIBRARY_MDL
Uses a library model with an operation like in the sel_list.txt of a
tab file. This includes copying to the current working directory
including drawings as well as naming generation for asm_copy and
prt_copy.
Syntax
USE_LIBRARY_MDL [options] "model_name" operation refMdl<:out>
Arguments

options
The following options are supported:
NAME_TEMPLATE "template" — New model name. Any string expression is
allowed. The model can name contain a special syntax to build up
this name.
PROJECT_SHORT "short" — Specifies a different project short cut as
the one from the main assembly.

COPY_FAMTABLE valueBOOL — Determines if in case of a family table


the complete table should be copied or only the specified instance
or generic part. Default is TRUE.

model_name
Specifies the model name according to the path specification. Any
string expression is allowed. The extension (e.g. '.prt', '.asm') is
not regarded, since it is determined by the operation.

operation
The following options are available:
asm — to use an assembly without renaming according the asm option
of a sel_list.txt. In case a manufacturing model is available, this
will be used instead.
asm_copy — to use an assembly including renaming according the
asm_copy option of a sel_list.txt. In case a manufacturing model is
available, this will be used instead.
mfg — to use a manufacturing model without renaming according the
mfg option of a sel_list.txt.
mfg_copy — to use a manufacturing model without renaming according
the mfg_copy option of a sel_list.txt.
mfg_asm — to use the assembly, or the assembly of a manufacturing
model without renaming according the mfg_asm option of a
sel_list.txt.
mfg_asm_copy — to use an assembly or the assembly of a
manufacturing model without renaming according the mfg_asm_copy
option of a sel_list.txt.
part — to use a part including renaming according the part option
of a sel_list.txt.
part_copy — to use a part without renaming according the part_copy
option of a sel_list.txt.
drawing — to retrieve a drawing. This is a different behaviour from
the dwg option of a sel_list.txt. This is usually used to add a
drawing to a model which has a different name.

refMdl
Name of the reference which will receive the model.
Error handling
The program execution will be canceled if the model could not be
retrieved, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USE_LIBRARY_MDL "lib:example" asm_copy refAsmExample
GET_MFG_ASM
Retrieves the associated assembly to a manufacturing assembly. In
case the model is not a manufacturing assembly, the command retrieves
the same model.
Syntax
GET_MFG_ASM model_mfg refMfgAsm<:out>
Arguments

model
The specified MFG model.

refMfgAsm
Variable which will receive the associated assembly.
Error handling
The program execution will be canceled if the model could not be
retrieved, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case the supplied model is not a MFG model, the result will be
identical to the input model. This provides a comfortable way to work
with normal assemblies and MFGs in the same way.
Example
GET_MFG_ASM mdlMfg mdlMfgAsm
About Commands for Model Properties
Commands for retrieving and modifying model properties.
The following commands are available:
GET_ACCURACY — to read the accuracy of a model.
SET_ACCURACY — to modify the accuracy of a model.
SET_READONLY — to set read-only mode to a model.
UNSET_READONLY — to remove read-only mode from a model.
GET_MDL_NAME — to retrieve the name of a model.
SET_MDL_NAME — to modify the name of a model.
GET_MDL_PATH — to retrieve the path of a model
GET_MDL_EXTENSION — to retrieve the file extension of a model.
GET_MDL_TYPE — to retrieve the type of a model.
GET_MDL_TYPE_EX — to consider Creo Unite Technology models when
retrieving the type of a model.
GET_MDL_SUBTYPE — to retrieve the sub type of a model.
GET_COMP_TYPE — to retrieve the type of a component.
SET_COMP_TYPE — to set the type of a component.
GET_COMP_BOM_LEVEL — to retrieve the nesting level in the model
tree of a component.
GET_MATERIAL — to read the assigned material of a model.
GET_MATERIALS — to search for materials which are stored on a
model.
CREATE_MATERIAL — to create a new material on a part.
SET_MATERIAL — to assign a material to a model.
DELETE_MATERIAL — to delete the currently assigned material from a
model.
GET_MATERIAL_PROPERTIES — to receive the properties of the
currently assigned material.
SET_MATERIAL_PROPERTIES — to set the properties to the currently
assigned material.
GET_MATERIAL_PROPERTY — to read a specific property of the
currently assigned material.
SET_MATERIAL_PROPERTY — to set a specific property of the currently
assigned material.
GET_MASS_PROPERTIES — to receive the mass properties of a model.
GET_AUDIT_TRAIL — to receive the history information for a model.
GET_DENSITY — to receive the density of a part.
SET_DENSITY — to set the density of a part.
GET_COMMON_NAME — to read the PTC_COMMON_NAME parameter.
SET_COMMON_NAME — to set the PTC_COMMON_NAME parameter.
GET_MDL_VERSION — to retrieve the internal version as an integer
value.
GET_MDL_MODIFIED — to determine if the modification flag of a model
is set.
SET_MDL_MODIFIED — to set the modification status of a model as
changed.
GET_MDL_SESSION_ID — to retrieve the session id of a solid model.
GET_MDL_DTL_OPTION — to retrieve a specific detail option from a
solid model.
GET_MDL_DTL_OPTIONS — to retrieve the detail options from a solid
model.
SET_MDL_DTL_OPTION — to assign a specific detail option to a solid
model.
SET_MDL_DTL_OPTIONS — to assign the detail options to a solid
model.
LOAD_MDL_DTL_OPTIONS — to assign the detail options to a solid
model from file.
GET_INSERT_MODE_POSITION — to retrieve the reference to the last
active feature before the insert mode arrow.
GET_ACCURACY
Reads the accuracy of a model.
Syntax
GET_ACCURACY model paramType<:out> paramValue<:out>
Arguments

model
Model from which the accuracy should be read according to model
specification.

paramType
Receives the string parameter ABSOLUTE or RELATIVE.

paramValue
Receives the accuracy value.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_ACCURACY THIS paramType paramValue
SET_ACCURACY
Sets the accuracy of a model.
Syntax
SET_ACCURACY [options] model type value DOUBLE
Arguments

options
The following options are supported
FORCE — temporarily sets the accuracy_lower_bound configuration
option to its minimal value 1E-6.

model
Model to which the accuracy should be applied according to model
specification.

type
ABSOLUTE — for absolute accuracy.
RELATIVE — for relative accuracy.

value
Value which should be used as accuracy.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Based on the geometry Creo Elements/Pro can not always convert to the
desired accuracy. In this case the command iteratively converts the
accuracy as close as possible.
Example
SET_ACCURACY THIS ABSOLUTE 0.001
SET_READONLY
Sets read-only mode of a model.
Syntax
SET_READONLY model refFeature<:in>
Arguments

model
Model for which the read-only mode should be set according to model
specification.

refFeature
Determines the last feature for which the read-only mode should be
activated:
NULL
In case all features should be set to read-only.
Reference to a feature
To set the read-only mode up to a specific feature.
Error handling
The program execution will be canceled if the model or the feature
could not be found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_READONLY THIS NULL
UNSET_READONLY
Removes read-only mode of a model.
Syntax
UNSET_READONLY model
Arguments

model
Model from which the read-only mode should be removed according to
model specification.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
UNSET_READONLY THIS
GET_MDL_NAME
Retrieves name of a specified model.
Syntax
GET_MDL_NAME model parameter<:out>
Arguments

model
The specified model.

parameter
Name of the parameter which should receive the model name.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_NAME THIS mdlName
SET_MDL_NAME
renames a specified model. In case the model already exists on hard
drive or in the workspace the renamed model will be saved. When
renaming a part or an assembly available drawings of the same name
will be renamed accordingly.
Syntax
SET_MDL_NAME [options] model "mdl_name" [paramConsecNumber<:out>]
Arguments

options
The following options are supported:
ADD_REQ_SHORT
Indication that a project short cut is automatically appended, even
if it was not specified by an '#'.

CONSEC_NUMBER number INT


Specifies value for consecutive number. In case the specified
number is already in use the next free one will be taken.
PROJECT_SHORT "short"
Specifies a different project short cut as the one from the main
assembly.

USE_COMMONSPACE use_cs BOOL


Specifies if the common space of an attached Intralink / PDMLink
session is searched for a model of this name. By default the search
is enabled.

UPDATE_COMMON_NAME update BOOL


Specifies if the PTC_COMMON_NAME is updated automatically. Default
is TRUE.

RENAME_DRAWING rename BOOL


Specifies if an associated drawing to a part or assembly should be
renamed. Default is TRUE.

model
The specified model.

mdl_name
New model name. Any string expression is allowed. The model can name
contain a special syntax to build up this name.

paramConsecNumber
Optional parameter which receives the consecutive number. This can be
used to have the same consecutive numbers in sub assemblies.
Error handling
The program execution will be canceled if the model does not exist or
if it could not be renamed, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
In case the model name is configured to the same name as a model
which already exists, the model will be replaced through the existing
one. For part_copy and asm_copy programs the short cut will be added
automatically.
Example
SET_MDL_NAME THIS "sample"
SET_MDL_NAME THIS "#_sample_*"
§
SET_NEXT_MDL_NAME
Sets the next available name for this model. Since Pro/ENGINEER
Wildfire M070 this command also uses the PDMLink auto numbering.
Syntax
SET_NEXT_MDL_NAME model
Arguments

model
The specified model.
Error handling
The program execution will be canceled if the model does not exist or
if it could not be renamed, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
This command combines GET_NEXT_MDL_NAME and SET_MDL_NAME.
Example
SET_NEXT_MDL_NAME THIS
GET_MDL_PATH
Retrieves the path of a specified model.
Syntax
GET_MDL_PATH model parameter<:out>
Arguments

model
The specified model.

parameter
Name of the parameter which should receive the model path.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_PATH THIS mdlPath
GET_MDL_EXTENSION
Retrieves the file extension of a model.
Syntax
GET_MDL_EXTENSION model parameter<:out>
Arguments

model
The specified model.

parameter
Name of the parameter which should receive the model type.
Valid model extensions are:
asm
prt
drw
lay
frm
mfg
rep
mrk
dgm
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_EXTENSION THIS mdlExtension
PRINT "Extension: %" mdlExtension
GET_MDL_TYPE
Retrieves the type of a model.
Syntax
GET_MDL_TYPE model parameter<:out>
Arguments

model
The specified model.

parameter
Name of the parameter which should receive the model type.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_TYPE THIS mdlType
PRINT "Type: %" mdlType
§
GET_MDL_TYPE_EX
Retrieves the type of the model including imported models with Creo
Unite Technology.
Syntax
GET_MDL_TYPE_EX model parameter<:out>
Arguments

model
The specified model.

parameter
Name of the parameter which should receive the model type.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL mdl
GET_MDL_TYPE_EX mdl mdlType
PRINT "Type: %" mdlType
GET_MDL_SUBTYPE
Retrieves the sub type of a model.
Syntax
GET_MDL_SUBTYPE model parameter<:out>
Arguments

model
The specified model.

parameter
Name of the parameter which should receive the model sub type.
Valid model sub types are:
BULK
PART_SOLID
PART_COMPOSITE
PART_SHEETMETAL
PART_CONCEPT_MODEL
ASM_DESIGN
ASM_INTERCHANGE
ASM_INTCHG_SUBST
ASM_INTCHG_FUNC
ASM_CLASS_CAV
ASM_VERIFY
ASM_PROCPLAN
ASM_NCMODEL
MFG_NCASM
MFG_NCPART
MFG_EXPMACH
MFG_CMM
MFG_SHEETMETAL
MFG_CAST
MFG_MOLD
MFG_DIEFACE
MFG_HARNESS
MFG_PROCPLAN
REGEN_BACKUP
OLD_REG_MFG
ASM_CLASS_SCAN_SET
ASM_EXT_SIMP_REP
ASM_FIGURE
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_SUBTYPE THIS mdlSubtype
PRINT "Sub type: %" mdlSubtype
GET_COMP_TYPE
Retrieves the type of a component.
Syntax
GET_COMP_TYPE component parameter<:out>
Arguments

component
The specified model.

parameter
Name of the parameter which should receive the component type.
Valid component types are:
WORKPIECE
REF_MODEL
FIXTURE
MOLD_BASE
MOLD_COMP
MOLD_ASSEM
DIE_BLOCK
DIE_COMP
SAND_CORE
CAST_RESULT
NONE
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT comp
GET_COMP_TYPE comp compType
PRINT "Component type: %" compType
SET_COMP_TYPE
Sets the type of a component.
Syntax
GET_COMP_TYPE component "comp_type"
Arguments

component
The specified model.

comp_type
Valid component types are:
WORKPIECE
REF_MODEL
FIXTURE
MOLD_BASE
MOLD_COMP
MOLD_ASSEM
DIE_BLOCK
DIE_COMP
SAND_CORE
CAST_RESULT
NONE
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
Setting component types only works in the correct Creo Elements/Pro
application mode. It follows the same rules as on manual use.
Example
USER_SELECT COMPONENT comp
SET_COMP_TYPE comp WORKPIECE
GET_COMP_BOM_LEVEL
Retrieves nesting level in the model tree of a component.
Syntax
GET_COMP_BOM_LEVEL component paramBomLevel<:out>
Arguments

model
The specified model.

paramBomLevel
Name of an integer variable which will receive the nesting level in
the model tree.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL mdl
GET_COMP_BOM_LEVEL mdl level
PRINT "level: %" level
§
GET_MATERIAL
Reads the assigned material of a model. In case no material is
assigned the result is an empty string or "ptc_system_mtrl_props",
depending on the version of CREO.
Syntax
GET_MATERIAL model paramMaterial<:out>
Arguments

model
Model from which the assigned material should be read according the
model specification.

paramMaterial
Receives the assigned material as a string parameter.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MATERIAL THIS paramMaterial
PRINT "Material: %" paramMaterial
§
GET_MATERIALS
Searches for the materials which are stored at a model.
Syntax
GET_MATERIALS model "search_string" arrayMaterials<:out>
Arguments

model
Model from which the assigned material should be read according the
model specification.

search_string
Search expression to describe which materials should be searched. Any
string expression is allowed.

arrayMaterials
Name of the array variable which will receive the material names.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MATERIALS PART "*" arrayMaterials
FOR material REF ARRAY arrayMaterials
PRINT "%" material
END_FOR
§
CREATE_MATERIAL
Creates a new material with specified standard properties.
Syntax
CREATE_MATERIAL model "material_name" material<:in>
Arguments

model
Model for which the material should be created according model
specification.

material_name
Name for the new material. Any string expression is allowed.

material
Structure variable of type MATERIAL which contains the material
properties.
Error handling
The program execution will be canceled if the model could not be
found or the material not be created, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
DECLARE_STRUCT MATERIAL material_props
CREATE_MATERIAL PART "new_material" material_props
§
SET_MATERIAL
Sets and assigns material to a model.
Syntax
SET_MATERIAL model "material"
Arguments

model
Model to which the material should be assigned according the model
specification.

material
Name and path of the material according the technique to specify file
paths. In case the specification does not include a path besides the
current working directory also the PRO_MATERIAL_DIR is searched.
Error handling
The program execution will be canceled if the model or the material
could not be found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_MATERIAL THIS_10 "lib:steel.mat"
SET_MATERIAL THIS_20 "copper.mat"
§
DELETE_MATERIAL
Deletes the currently assigned or the specified materials from a
model.
Syntax
DELETE_MATERIAL model [arrayMaterials<:in>]
Arguments

model
Model from which the material should be read model specification.

arrayMaterials
Optional array with the materials to remove. If not specified only
the currently assigned material will be removed.
Error handling
The program execution will be canceled if the model could not be
found or the material could not be deleted, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
GET_MATERIALS PART "*" arrayMaterials
DELETE_MATERIAL PART arrayMaterials
§
GET_MATERIAL_PROPERTIES
Reads the standard properties of the assigned material of a model.
Syntax
GET_MATERIAL_PROPERTIES model material<:out>
Arguments

model
Model from which the assigned material should be read according model
specification.

material
Structure variable of type MATERIAL which receives the material
properties.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MATERIAL_PROPERITES THIS material
PRINT "Material: % emissivity: %" material.name material.emissivity
§
SET_MATERIAL_PROPERTIES
Set the standard properties of the assigned material of a model.
Syntax
SET_MATERIAL_PROPERTIES model material<:in>
Arguments

model
Model for which the assigned material should be changed according
model specification.

material
Structure variable of type MATERIAL which contains the material
properties.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The material which should be modified is specified by MATERIAL.name.
In case this material does not exist, the function will fail.
Example
GET_MATERIAL_PROPERTIES THIS material
material.bend_table = "table1"
SET_MATERIAL_PROPERTIES THIS material
§
GET_MATERIAL_PROPERTY
Read a property of the assigned material of a model. This allows also
to access custom material properties.
Syntax
GET_MATERIAL_PROPERTY model "property_name" value<:out>
Arguments

model
Model from which the assigned material should be read model
specification.

property_name
Name of the property. Any string expression is allowed.

value
Name of the variable which receives the property content.
Error handling
The program execution will be canceled if the model could not be
found or no material is assigned or the property could not be found,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MATERIAL_PROPERTY THIS "price" price
PRINT "Price: % price
§
SET_MATERIAL_PROPERTY
Set a property to the assigned material of a model. This allows also
to access custom material properties.
Syntax
SET_MATERIAL_PROPERTY model "property_name" valueSTRNUM
Arguments

model
Model from which the assigned material should be read model
specification.

property_name
Name of the property. Any string expression is allowed.

value
Value which should be set to the material property. Any string
expression or math expression is allowed.
Error handling
The program execution will be canceled if the model could not be
found unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_MATERIAL_PROPERTY THIS "price" 1.25
§
GET_MASS_PROPERTIES
Calculates the mass properties of a part or assembly similar to
Analysis > Model > Model Mass Properties. In case the coordinate
system is from another model, a temporary one will be created for the
measurement.
Syntax
GET_MASS_PROPERTIES [options] model reference_csys<:in>
mass_properties<:out>
Arguments

options
The following options are supported:
ONLY_TRANSLATION_INVARIANT valueBOOL — to limit the calculation to
the translation invariant properties volume, surface_area, density,
mass and center_of_gravity in order to avoid the creation of a
temporary coordinate system. Default is FALSE.

model
Model from which the mass properties should be calculated according
model specification.

reference_csys
The coordinate system which is used for the calculation. If NULL is
specified the default coordinate system will be used.

mass_properties
Structure variable of type MASS_PROPERTIES which receives the
calculate result.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MASS_PROPERTIES THIS NULL mass
PRINT "Volume: % surface area: %" mass.volume mass.surface_area
PRINT "Center of gravity (% % %)" mass.center_of_gravity.x
mass.center_of_gravity.y mass.center_of_gravity.z
§
GET_AUDIT_TRAIL
Retrieves the history information for a model provided by Tools >
Investigate > File History.
Syntax
GET_AUDIT_TRAIL model arrayAuditTrail<:out>
Arguments

model
Model from which the mass properties should be calculated according
model specification.

arrayAuditTrail
Array which received the audit trail information. Elements are
structure variables of type AUDIT_TRAIL.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_AUDIT_TRAIL mdl arrayAuditTrail
FOR audit REF ARRAY arrayAuditTrail
PRINT "complete_line: %" audit.line
PRINT "% % % %" audit.item_name audit.host audit.user audit.time
END_FOR
§
GET_DENSITY
Retrieves the current density of a part. In case no density is
specified 1 is used as default.
Syntax
GET_DENSITY model paramDensity<:out>
Arguments

model
Model from which the density should be retrieved according model
specification.

paramDensity
Name of the variable which will receive the density.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_DENSITY THIS density
§
SET_DENSITY
Sets the density of a part.
Syntax
SET_DENSITY model value DOUBLE
Arguments

model
Model which should receive the density according model specification.

value
Value which should be used as density.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_DENSITY THIS 8.5
§
GET_COMMON_NAME
Retrieves the content of the PTC_COMMON_NAME parameter of the model.
This command requires Creo Elements/Pro Wildfire 4 or above.
Syntax
GET_COMMON_NAME model parameter<:out>
Arguments

model
The specified model.

parameter
Name of the parameter which should receive the content of the
PTC_COMMON_NAME parameter.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_COMMON_NAME THIS mdlCommonName
§
SET_COMMON_NAME
Sets the PTC_COMMON_NAME parameter of a model. Since the
PTC_COMMON_NAME. This command requires Creo Elements/Pro Wildfire 4
or above.
Syntax
SET_COMMON_NAME model "common_name"
Arguments

model
The specified model.

common_name
New common name.
Error handling
The program execution will be canceled if the model does not exist or
the common name could not be set, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_COMMON_NAME THIS "sample_common_name.prt"
§
GET_MDL_VERSION
Retrieves the internal version as an integer value. The version is a
number which is incremented after every modification. It is not
related to the file name number of Pro/ENGINEER models.
Syntax
GET_MDL_VERSION model paramVersion<:out>
Arguments

model
The specified model.

paramVersion
Name of the parameter which should receive the version as integer
value.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_VERSION THIS version
§
GET_MDL_MODIFIED
Determines if the modification flag of a model is set. This
modification flag decides if the model has to be saved.
Syntax
GET_MDL_MODIFIED model paramModifiedFlag<:out>
Arguments

model
The specified model.

paramModifiedFlag
Name of the parameter which should receive the modification flag as a
boolean variable.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_MODIFIED THIS boolModified
IF boolModified == TRUE
PRINT "Model is modified"
END_IF
§
SET_MDL_MODIFIED
Sets the modification flag of the model. This makes sure the model
will be regarded as changed for the a save command.
Syntax
SET_MDL_MODIFIED model
Arguments

model
The specified model.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_MDL_MODIFIED THIS
§
GET_MDL_SESSION_ID
Retrieves the session id of a solid model. This can be used to
address models in a relation or for drawing notes.
Syntax
GET_MDL_SESSION_ID mdl<:in> session_id<:out>
Arguments

mdl
The specified model.

session_id
Name of the variable which receives the session id as an integer
value.
Error handling
The program execution will be canceled if the reference to the model
does not exist or the session id could not be obtained, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
GET_SESSION_MDLS arraySessionMdls
FOR mdl REF ARRAY arraySessionMdls
GET_MDL_NAME mdl name
GET_MDL_SESSION_ID mdl id

PRINT "%: %" name id


END_FOR
§
GET_MDL_DTL_OPTION
Retrieve a specific detail option from a solid model.
Syntax
GET_MDL_DTL_OPTION mdl<:in> "option_name" option_value<:out>
Arguments

mdl
The specified model.

option_name
Name of the detail option. Any string expression is allowed.

option_value
Name of the variable which received the option value as string
content.
Error handling
The program execution will be canceled if the reference to the model
does not exist or the option could not be retrieved, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_DTL_OPTION ASSEMBLY "text_height" height
PRINT "%" height
§
GET_MDL_DTL_OPTIONS
Retrieves the detail options from a solid model.
Syntax
GET_MDL_DTL_OPTIONS mdl<:in> mdl_dtl_options<:out>
Arguments

mdl
The specified model.

mdl_dtl_options
Structure variable of type MDL_DTL_OPTIONS which receives the model
detail options.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_DTL_OPTIONS ASSEMBLY options
PRINT "%" options.text_height
PRINT "%" options.text_thickness
PRINT "%" options.text_width_factor
§
SET_MDL_DTL_OPTION
Assigns a specific detail option to a solid model.
Syntax
SET_MDL_DTL_OPTION mdl<:in> "option_name" "option_value"
Arguments

mdl
The specified model.

option_name
Name of the detail option. Any string expression is allowed.

option_value
Value of the detail option. Any string expression is allowed.
Error handling
The program execution will be canceled if the reference to the model
does not exist or if the option could not be assigned, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
SET_MDL_DTL_OPTION ASSEMBLY "text_height" "10"
§
SET_MDL_DTL_OPTIONS
Assigns the detail options to a solid model.
Syntax
SET_MDL_DTL_OPTIONS mdl<:in> mdl_dtl_options<:in>
Arguments

mdl
The specified model.

mdl_dtl_options
Existing structure variable of type MDL_DTL_OPTIONS.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_DTL_OPTIONS ASSEMBLY options
option.text_height = 10
SET_MDL_DTL_OPTIONS options
§
LOAD_MDL_DTL_OPTIONS
Applies the detail options to a solid model from a dtl file.
Syntax
LOAD_MDL_DTL_OPTIONS mdl<:in> "dtl_file"
Arguments

model
The specified model.

dtl_file
Path and name of the dtl file. Any string expression is allowed.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
LOAD_MDL_DTL_OPTIONS ASSEMBLY "lib:options.dtl"
§
GET_INSERT_MODE_POSITION
In case a model is in insert mode, this commands supplies a reference
to the last active feature..
Syntax
GET_INSERT_MODE_POSITION mdl<:in> refLastActiveFeature<:out>
Arguments

model
The specified model.

refLastActiveFeature
Reference to the last active feature in case the model is in active
mode..
Error handling
The program execution will be canceled if the reference to the model
does not exist or the model is not in active mode, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
IF IS_INSERT_MODE_ACTIVE PART
GET_INSERT_MODE_POSITION PART last_active_feature
PRINT "%" last_active_feature
END_IF
About Commands for Model Notebooks
Commands for declaring and undeclaring notebooks and for retrieving
declared notebooks of a solid model.
The following commands are available:
GET_MDL_NOTEBOOK — to retrieve the declared notebook of a solid
model.
GET_MDL_NOTEBOOKS — to retrieve all declared notebooks of a solid
model.
DECLARE_MDL_NOTEBOOK — to declare a solid model to a notebook.
UNDECLARE_MDL_NOTEBOOK — to undeclare a solid model from a
notebook.
§
GET_MDL_NOTEBOOK
Retrieves the declare notebook of a solid model.
Syntax
GET_MDL_NOTEBOOK mdl<:in> notebook<:out>
Arguments

mdl
The specified model.

notebook
Name of the variable which receives the reference to the notebook.
Error handling
The program execution will be canceled if the reference to the model
does not exist or no notebooks is declared, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
GET_MDL_NOTEBOOK PART notebook
UNDECLARE_MDL_NOTEBOOK PART notebook
§
GET_MDL_NOTEBOOKS
Retrieves all declared notebooks of a solid model.
Syntax
GET_MDL_NOTEBOOKS mdl<:in> arrayNotebooks<:out>
Arguments

mdl
The specified model.

arrayNotebooks
Name of the array which receives the references to the notebooks.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_NOTEBOOKS PART arrayNotebooks
FOR notebook REF ARRAY arrayNotebooks
UNDECLARE_MDL_NOTEBOOK PART notebook
END_FOR
§
DECLARE_MDL_NOTEBOOK
Declares a solid model to a notebook.
Syntax
DECLARE_MDL_NOTEBOOK mdl<:in> notebook<:in>
Arguments

mdl
The specified model.

notebook
Reference to the notebook which should be declared.
Error handling
The program execution will be canceled if the reference to the model
or the notebook do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
READ_DIRECTORY "." "*.lay" arrayNotebookNames
FOR nameNotebook REF ARRAY arrayNotebookNames
RETRIEVE_MDL nameNotebook notebook
DECLARE_MDL_NOTEBOOK PART notebook
END_FOR
§
UNDECLARE_MDL_NOTEBOOK
Undeclares a solid model from a notebook.
Syntax
UNDECLARE_MDL_NOTEBOOK mdl<:in> notebook<:in>
Arguments

mdl
The specified model.

notebook
Reference to the notebook which should be undeclared.
Error handling
The program execution will be canceled if the reference to the model
or the notebook do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_MDL_NOTEBOOKS PART arrayNotebooks
FOR notebook REF ARRAY arrayNotebooks
UNDECLARE_MDL_NOTEBOOK PART notebook
END_FOR

ERASE_NOT_DISPLAYED_EX
About Commands for Model Tolerances
Commands for reading and setting model tolerances.
The following commands are available:
GET_MDL_TOL_STANDARD — to read the tolerance standard of a model.
SET_MDL_TOL_STANDARD — to set the tolerance standard of a model.
GET_MDL_TOL_CLASS — to read the tolerance class of a model.
SET_MDL_TOL_CALSS — to set the tolerance class of a model.
LOAD_MDL_TOL_TABLE — to load the tolerance table for a model.
§
GET_MDL_TOL_STANDARD
Reads the tolerance standard of a model. The command is supported for
Creo 2.0 M100 and above.
Syntax
GET_MDL_TOL_STANDARD mdl<:in> tol_standard<:out>
Arguments

mdl
The specified model.

tol_standard
Name of the variable which receives the tolerance standard. Valid
standards are:
ANSI — for the ANSI standard.
ISO — for the ISO standard.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_TOL_STANDARD PART standard
PRINT "%" standard
§
SET_MDL_TOL_STANDARD
Sets the tolerance standard of a model. The command is supported
since Creo 2.0 M100 and above.
Syntax
SET_MDL_TOL_STANDARD mdl<:in> "tol_standard"
Arguments

mdl
The specified model.

tol_standard
Model tolerance standard. Any string expression is allowed. The
following tolerance standards are supported:
ANSI — for the ANSI standard.
ISO — for the ISO standard.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_MDL_TOL_STANDARD PART "ISO"
§
GET_MDL_TOL_CLASS
Reads the tolerance class of a model.
Syntax
GET_MDL_TOL_CLASS mdl<:in> tol_class<:out>
Arguments

mdl
The specified model.

tol_class
Name of the variable which receives the tolerance class. Valid
classes are:
NONE — for no tolerance class.
FINE — for the FINE tolerance class.
MEDIUM — for the MEDIUM tolerance class.
COARSE — for the COARSE tolerance class.
VERY_COARSE — for the VERY COARSE tolerance class.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_TOL_CLASS PART class
PRINT "%" class
§
SET_MDL_TOL_CLASS
Sets the tolerance class of a model.
Syntax
SET_MDL_TOL_CLASS mdl<:in> "tol_class"
Arguments

mdl
The specified model.

tol_class
Model tolerance class. Any string expression is allowed. The
following tolerance classes are supported:
NONE — for no tolerance class.
FINE — for the FINE tolerance class.
MEDIUM — for the MEDIUM tolerance class.
COARSE — for the COARSE tolerance class.
VERY_COARSE — for the VERY COARSE tolerance class.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_MDL_TOL_CLASS PART "MEDIUM"
§
LOAD_MDL_TOL_TABLE
Loads the tolerance table for a model.
Syntax
LOAD_MDL_TOL_TABLE mdl<:in> "ttl_file"
Arguments

mdl
The specified model.

ttl_file
Name of the tolerance table file. Any string expression is allowed.
In case the file name does not include a path specification, the path
from the configuration option tolerance_table_dir is used. If this
configuration option is not set, the standard Creo path for tolerance
tables will be used.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
LOAD_MDL_TOL_TABLE PART "hole_a.ttl"
About Commands for Model Units
Commands for retrieving and modifying model units
The following commands are available:
GET_UNIT_LENGTH — to read the current unit for length from a model.
GET_UNIT_MASS — to read the current unit for mass from a model.
GET_UNIT_FORCE — to read the current unit for force from a model.
GET_UNIT_TIME — to read the current unit for time from a model.
GET_UNIT_TEMPERATURE — to read the current unit for temperature
from a model.
GET_UNIT_SYSTEM — to read the current unit system from a model.
SET_UNIT_LENGTH — to set the unit system of a model with the
specified unit for length.
SET_UNIT_SYSTEM — to set the unit system of a model.
CREATE_UNIT_SYSTEM — to create a new unit system in a model.
GET_UNIT_LENGTH
Reads the current unit for length from a model.
Syntax
GET_UNIT_LENGTH model paramUnitLength<:out>
Arguments

model
Model from which the unit should be read according to model
specification.

paramUnitLength
Receives the string parameter with one of the following values:
CM
FT
INCH
MICRON
MIL
M
MM
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_UNIT_LENGTH THIS paramUnitLength
GET_UNIT_MASS
Reads the current unit for mass from a model.
Syntax
GET_UNIT_MASS model paramUnitMass<:out>
Arguments

model
Model from which the unit should be read according to model
specification.

paramUnitMass
Receives the string parameter with one of the following values:
G
KG
LBM
OUNCE-M
MG
SLUG
TON-M
TONNE
UNDEFINED — in some the unit system does not contain a mass.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_UNIT_MASS THIS paramUnitMass
GET_UNIT_FORCE
Reads the current unit for force from a model.
Syntax
GET_UNIT_FORCE model paramUnitForce<:out>
Arguments

model
Model from which the unit should be read according to model
specification.

paramUnitForce
Receives the string parameter with one of the following values:
DYNE
KG-F
KIP
KN
LBF
N
OUNCE-F
TON
UNDEFINED — in some the unit system does not contain a force.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_UNIT_FORCE THIS paramUnitForce
GET_UNIT_TIME
Reads the current unit for time from a model.
Syntax
GET_UNIT_TIME model paramUnitTime<:out>
Arguments

model
Model from which the unit should be read according to model
specification.

paramUnitTime
Receives the string parameter with one of the following values:
DAY
HR
MICRO-SEC
MIN
MSEC
SEC
WEEK
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_UNIT_TIME THIS paramUnitTime
GET_UNIT_TEMPERATURE
Reads the current unit for temperature from a model.
Syntax
GET_UNIT_TEMPERATURE model paramUnitTemperature<:out>
Arguments

model
Model from which the unit should be read according to model
specification.

paramUnitTemperature
Receives the string parameter with one of the following values:
C
F
K
R
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_UNIT_TEMPERATURE THIS paramUnitTemperature
GET_UNIT_SYSTEM
Reads the current unit system from a model.
Syntax
GET_UNIT_SYSTEM model paramUnitSystem<:out>
Arguments

model
Model from which the unit should be read according to model
specification.

paramUnitSystem
Receives the string parameter with the customer name of the unit
system or with one of the following values for standard unit systems:
CGS
FTP
DEFAULT
IPS
MKS
MMKS
MMNS
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_UNIT_SYSTEM THIS paramUnitSystem
SET_UNIT_LENGTH
Sets the unit system of a model with the specified unit for length.
Syntax
SETS_UNIT_LENGTH model unit_length convert
Arguments

model
Model for which the unit should be set according to model
specification.

unit_length
Available length units are:
CM
FT
INCH
MICRON
MIL
M
MM

convert
The following converting options are available:
CONVERT — convert the dimensions to keep the same model size.
INTERPRET — interpret the dimensions to keep the same dimension
values.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_UNIT_LENGTH THIS MM CONVERT
SET_UNIT_SYSTEM
Sets the unit system of a model.
Syntax
GETS_UNIT_LENGTH model unit_system convert
Arguments

model
Model for which the unit should be set according to model
specification.

unit_system
For custom unit systems the name and for standard unit systems one of
the following values:
CGS
FTP
DEFAULT
IPS
MKS
MMKS
MMNS

convert
The following converting options are available:
CONVERT — convert the dimensions to keep the same model size.
INTERPRET — interpret the dimensions to keep the same dimension
values.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_UNIT_SYSTEM THIS MMKS CONVERT
§
CREATE_UNIT_SYSTEM
Creates a new unit system in a model
Syntax
CREATE_UNIT_SYSTEM model unit_system<:in>
Arguments

model
Model for which the unit should be set according to model
specification.

unit_system
Structure variable of type UNIT_SYSTEM which contains information
about the units as well as the unit system name.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case a unit system of the same name is already in use, this will
not be altered and no error occurs.
Example
DECLARE_STRUCT UNIT_SYSTEM unit_system
unit_system.name = "buw"
unit_system.is_mlt = TRUE
unit_system.mass = "kg"
unit_system.length = "mm"
unit_system.time = "sec"
CREATE_UNIT_SYSTEM THIS unit_system
About Commands for Model Sessions
Commands for inquiring and setting session related model information.
The following commands are available:
SWITCH_TO_MDL — to make a specific model to the current model.
GET_CURRENT_MDL — to retrieve a reference to the current mode.
SET_CURRENT_MDL — to make a model the current model on the screen.
GET_SESSION_MDLS — to retrieve an array with all models which are
currently in session.
GET_TOPLEVEL_MDLS — to determine the parts and assemblies which are
not included in another assembly.
GET_TOPLEVEL_ASMS — to determine the assemblies which are not
included in another assembly.
GET_NEXT_MDL_NAME — to determine the next available name for a
model of a specific type.
SET_NEXT_MDL_NAME — to set the next available name to the model.
SWITCH_TO_MDL
Makes a specific model the current Creo Elements/Pro model.
Syntax
SWITCH_TO_MDL model<:in>
Arguments

model
Model which should be the current Creo Elements/Pro model.
§
GET_CURRENT_MDL
Retrieves the reference of the current model.
Syntax
GET_CURRENT_MDL model<:out>
Description

model
Name of the variable which will receive the reference of the current
model.
Error handling
The program execution will be canceled if there is no current model,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
You can use the logical expression CURRENT_MDL_AVAILABLE to figure
out if there is a current model.
Example
IF CURRENT_MDL_AVAILABLE
GET_CURRENT_MDL mdl
GET_MDL_NAME mdl name
PRINT "Current model: %" name
ELSE
PRINT "No current model"
END_IF
§
SET_CURRENT_MDL
Makes a model the current model on the screen.
Syntax
SET_CURRENT_MDL model<:in>
Description

model
The specified model.
Error handling
The program execution will be canceled if the model reference is not
available or the model could not be set as current model, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
This command works by the use of a mapkey and has a lot of side
effects. For example all following USER_SELECT statements will fail.
In most situations the SWITCH_TO_MDL command is the better solution.
However this command is able to convince Pro/ENGINEER / Creo that the
model is the current one.
Example
RETRIEVE_MDL "sample.asm" refMdl
SET_CURRENT_MDL refMdl
§
GET_SESSION_MDLS
Retrieves and array of all models which are currently in session.
Syntax
GET_SESSION_MDLS [options] arrayModels<:out>
Description
options
The following options are available
MDL_TYPES "type" | arrayOfTypes — to use models of the specified
model types. Without this option, parts and assemblies are
retrieved.

arrayModels<:out>
Name of the array which will receive the references of the models in
session.
Example
GET_SESSION_MDLS mdls
FOR mdl REF ARRAY mdls
GET_MDL_NAME mdl name
PRINT "%" name
END_FOR
§
GET_TOPLEVEL_MDLS
Determines the parts and assemblies from an given array of models
which are not included in another assembly.
Syntax
GET_TOPLEVEL_MDLS arrayModels<:in> arrayToplevelModels<:out>
Description

arrayModels
Existing array of model references.

arrayToplevelModels
Name of the array which will receive the references of the top level
models.
Error handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
READ_DIRECTORY "." "*.asm,*.prt" allMdlNames
FOR mdlName REF ARRAY allMdlNames
RETRIEVE_MDL mdlName mdl
END_FOR
GET_SESSION_MDLS allMdlsInSession
GET_TOPLEVEL_MDLS allMdlsInSession mdlsTopLevel
FOR mdlToplevel REF ARRAY mdlsTopLevel
GET_MDL_NAME mdlTopLevel nameTopLevel
GET_MDL_EXTENSION mdlTopLevel extTopLevel
PRINT "Toplevel model: %.%" nameTopLevel extTopLevel
END_FOR
§
GET_TOPLEVEL_ASMS
Determines the assemblies from an given array of models which are not
included in another assembly.
Syntax
GET_TOPLEVEL_ASMS arrayModels<:in> arrayToplevelAssemblies<:out>
Description

arrayModels
Existing array of model references.

arrayTopleveAssemblies
Name of the array which will receive the references of the top level
models.
Error handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
READ_DIRECTORY "." "*.asm" allAsmNames
FOR mdlName REF ARRAY allAsmNames
RETRIEVE_MDL mdlName mdl
END_FOR
GET_SESSION_MDLS allMdlsInSession
GET_TOPLEVEL_ASMS allMdlsInSession asmsTopLevel
FOR asmToplevel REF ARRAY asmsTopLevel
GET_MDL_NAME asmToplevel nameTopLevel
GET_MDL_EXTENSION asmToplevel extTopLevel
PRINT "Toplevel model: %.%" nameTopLevel extTopLevel
END_FOR
§
GET_NEXT_MDL_NAME
Determines the next available name for a model of a specific type.
Since Pro/ENGINEER Wildfire M070 this command also uses the PDMLink
auto numbering.
Syntax
GET_NEXT_MDL_NAME mdlType<:in> paramName<:out>
Description

mdlType
Model type for which the next available name should be determined.
Any string expressions are allowed.

paramName
Name of the parameter which will receive the next available model
name.
Example
GET_NEXT_MDL_NAME "PART" partName
About Commands for Model Manipulation
Commands for model manipulation.
The following commands are available:
REGEN_MDL — to regenerate a model.
REPLACE_COMPONENT — to replace a component by another model.
REMOVE_COMPONENT — to remove a component.
ACTIVATE_INSERT_MODE — to set the insert mode up to a specified
feature.
CANCEL_INSERT_MODE — to cancel the insert mode and resume all
features.
SET_MDL_SCALE — to scale a model by a factor.
REGEN_MDL
Regenerates an existing model.
Syntax
REGEN_MDL model [option]
Arguments

model
The model to regenerate.

option
FORCE — to force the model regeneration process, even if the model
does not need to be regenerated.
Example
REGEN_MDL THIS_59
REGEN_MDL ASSEMBLY FORCE
REPLACE_COMPONENT
Replaces an existing component through another one. References are
maintained in case they are identical, that means they have the same
Creo Elements/Pro identifier.
Syntax
REPLACE_COMPONENT [options] model_to_replace model_for_replacement
Arguments

options
The following options are supported:
REMEMBER_COMPONENT value BOOL — to keep the dependency to the
replaced components. Default is FALSE.

UPDATE_CONSTRAINTS update BOOL— to update the component constraints


by their name. Default is FALSE.

FREEZE_FAILED freeze BOOL — to determine if the component should be


frozen or not in case the constraints are not correct. In case the
option is not set the Creo Elements/Pro configuration option
freeze_failed_assy_comp determines the behaviour. Default is
determined by the Creo configuration option
freeze_failed_assy_comp.

SINGLE_TAB_PATTERN_INSTANCE single_instance BOOL — to update only


one instance of a pattern. Default is FALSE.

model_to_replace
Component which should be replaced. Models are specified in the
following manner.

model_for_replacement
Model which should be used to replace the component. Models are
specified in the following manner.
Error handling
The program execution will be canceled if one if the models is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note
This command could be used to replace family table instances as well
as normal Creo Elements/Pro models.
Example
USER_SELECT COMPONENT compMdlToReplace
REPLACE_COMPONENT compMdlToReplace THIS
REMOVE_COMPONENT
Removes a specified part or assembly component.
Syntax
REMOVE_COMPONENT model
Arguments

model
Model of a component which should be removed. Models are specified in
the following manner.
Error handling
The program execution will be canceled if model or reference are not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT compToRemove
REMOVE_COMPONENT compToRemove
ACTIVATE_INSERT_MODE
Activate insert mode before or after a specific feature.
Syntax
ACTIVATE_INSERT_MODE order_option refFeature<:in>
Arguments

order_option
Either BEFORE or AFTER to indicate whether insert mode should be
activated before or after the specified feature.

refFeature
Name of an existing reference to a feature to specify the position of
the insert mode.
Error handling
The program execution will be canceled if the reference to the
feature is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
ACTIVATE_INSERT_MODE AFTER feat
CANCEL_INSERT_MODE
Cancels insert mode and resumes the suppressed features.
Syntax
CANCEL_INSERT_MODE model
Arguments

model
Model in which the insert model should be canceled.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
Activating and canceling the insert model could be used to force a
model regeneration.
Example
USER_SELECT PART prt
CANCEL_INSERT_MODE prt
§
SET_MDL_SCALE
Scales a model by a factor. Similar to Edit > Scale Model in
Pro/ENGINEER / Creo Parametric.
Syntax
SET_MDL_SCALE [options] model factorDOUBLE
Arguments

options
Valid options are:
RECURSIVE — Optional argument specifies that all sub models are also
scaled.

model
Model which is to be scaled according to model specification.

factor
Factor which is used to scale the model.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_MDL_SCALE RECURSIVE ASSEMBLY 2.0
§
About Commands for Model Analysis
Commands for analyzing models.
The following commands are available:
COMPARE_MDLS — to compare two models.
CALC_FEATURE_DIFF — to find features in one model which are
different from the features in another one.
§
COMPARE_MDLS
Compares two models.
Syntax
COMPARE_MDLS option model1 model2 paramIdentical<:out>
Arguments

options
BY_SOLIDGEOMETRY — Compare models by solid geometry.
BY_FEATUREGEOMETRY — Compare models by feature type, feature id and
geometrical items of a feature.

model1
Mode1 according model specification which should be compared.

model2
Mode2 according model specification which should be compared.

paramIdentical
Name of the string parameter which will receive the result. Either
TRUE if the parts are identical or FALSE if they are different.
Error handling
The program execution will be canceled if the models could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Comparing models by geometry compares the different mass properties.
Models without solid geometry are therefor recognized as identical.
Example
LOAD_MODEL "*.prt" mdl1
LOAD_MODEL "*.prt" mdl2
COMPARE_MDLS BY_FEATUREGEOMETRY mdl1 mdl2 identical
IF identical == "TRUE"
PRINT "Models are identical"
ELSE
PRINT "Models are different"
END_IF
§
CALC_FEATURE_DIFF
Compares two models and returns features of the first model which are
only available in this model or which are different from the
corresponding feature in the second model. By default the comparison
of feature is only done by their geometry. Comparison against their
dimensions can be included.
Syntax
CALC_FEATURE_DIFF [options] model1 model2
arrayDifferentFeatures<:out>
Arguments
options
The following options are available:
COMPARE_DIMS — compare features additionally according dimension
values and symbol names.

model1
Mode1 according model specification which should be compared.

model2
Mode2 according model specification which should be compared.

arrayDifferentFeatures
Name of the array which will receive features of the first model
which are different from the corresponding feature in the second
model.
Error handling
The program execution will be canceled if the models could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
LOAD_MODEL "*.prt" mdl1
LOAD_MODEL "*.prt" mdl2
CALC_FEATURE_DIFF mdl1 mdl2 arrayDiffFeatures
FOR feature REF ARRAY arrayDiffFeatures
GET_REF_ID feature id
PRINT "diff: %" id
END_FOR
§
About Commands for Model Annotations
Commands for creating and accessing solid model annotations. These
functions require Pro/ENGINEER Wildfire 4 or above. Annotations can
be dimensions, reference dimensions, symbols notes, geometric
tolerances, surface finishes and set datum tags. Annotation which
belong to annotation feature are called annotation elements.
The following commands are available:
CREATE_ANNOTATION — to create an empty annotation feature.
MOVE_ANNOTATION_TO_PLANE — to move annotation elements to a
specified plane.
MOVE_ANNOTATION_TO_ORIENTATION — to move annotation elements to an
orientation.
ADD_ANNOTATION_REF —to add surface references to an annotation.
ADD_ANNOTATION_REFS — to add a surface reference to an annotation.
GET_ANNOTATION_REFS — to retrieve all references from an
annotation.
GET_ANNOTATION_ELEMENT — to retrieve the first element of an
annotation feature.
GET_ANNOTATION_ELEMENTS — to retrieves all elements of an
annotation feature.
SET_ANNOTATION_ELEMENT — to removes existing elements from the
annotation and to places a new one instead.
SET_ANNOTATION_ELEMENTS — to removes existing elements from the
annotation and to places the new ones instead.
ADD_ANNOTATION_ELEMENT — to add a new annotation element to an
annotation feature.
ADD_ANNOTATION_ELEMENTS — to add an array of annotation elements to
an annotation feature.
DELETE_ANNOTATION_ELEMENT — to delete an annotation from its
annotation feature.
DELETE_ANNOTATION_ELEMENTS — to delete all elements from an
annotation feature.
ADD_ANNOTATION_ELEMENT_REF — to add a standard, surface or chain
reference to an annotation element.
ADD_ANNOTATION_ELEMENT_REFS — to add standard, surface or chain
references to an annotation element.
GET_ANNOTATION_ELEMENT_REFS — to read standard, surface or chain
references of an annotation element.
REMOVE_ANNOTATION_ELEMENT_REF — to remove standard, surface or
chain references from an annotation element.
SET_ANNOTATION_ELEMENT_REF_STRENGTH — to set or delete the strong
flag for references of an annotation element.
GET_MDL_ANNOTATION_PLANE — to retrieve the standard annotation
planes from a model.
GET_MDL_ACTIVE_ANNOTATION_PLANE — to retrieve the active annotation
plane of a model.
GET_REF_ANNOTATION_PLANE — to retrieve the annotation plane of a
reference.
CREATE_ANNOTATION_PLANE — to create a new annotation plane based on
orientation or reference.
GET_ANNOTATION_PLANE_NAME — to retrieve the name of an annotation
plane.
SET_ANNOTATION_PLANE_NAME —to set the name of an annotation plane
an optionally set it to the gallery.
GET_ANNOTATION_POS — to retrieve the position of an annotation.
SET_ANNOTATIOIN_POS — to set the position of an annotation.
GET_ANNOTATION_LEADER_REF — to retrieve the attachment reference of
an annotation leader.
GET_ANNOTATION_LEADER_REFS — to retrieve all attachment references
of an annotation leader.
GET_ANNOTATION_ORIENTATION — to retrieve the orientation of an
annotation.
GET_ANNOTATION_ANGLE — to retrieve the angle of an annotation.
SET_ANNOTATION_ANGLE — to set the angle of an annotation.
GET_ANNOTATION_TEXT_STYLE — to retrieve the text style of an
annotation.
SET_ANNOTATION_TEXT_STYLE — to set the text style for an
annotation.
GET_ANNOTATION_ELEMENT_NAME — to get the name of a specified
annotation element which is contained by an annotation feature.
SET_ANNOTATION_ELEMENT_NAME — to set the name of a specified
annotation element which is contained by an annotation feature.
GET_ANNOTATION_LEGACY_STATE — to retrieve the information about the
legacy state of an annotation.
CONVERT_LEGACY_ANNOTATION — to convert a legacy annotation.
Furthermore annotation specific commands are listed in the following
chapters:
Dimension annotations — commands for dimension annotations.
Note annotations — commands for annotation notes.
Symbol annotations — commands for annotation symbols.
Geometric tolerance annotations — commands for geometric tolerance
annotations.
Surface finish annotations — commands for surface finish
annotations.#
Datum tag annotation — commands for datum tag annotations.
§
CREATE_ANNOTATION
Creates an empty annotation feature.
Syntax
CREATE_ANNOTATION model feat_annotation<:out>
Arguments

model
Model in which the annotation feature should be created.

feat_annotation
Name of the reference which should receive the information about the
created feature.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
CREATE_ANNOTATION ASSEMBLY feat
SET_ANNOTATION_ELEMENT feat symbol
§
MOVE_ANNOTATION_TO_PLANE
Moves annotation elements to a specified plane.
Syntax
MOVE_ANNOTATION_TO_PLANE [options] annotation<:in> |
arrayAnnotations<:in> plane<:in>
Arguments

options
The following options are supported:
FLIP_DIRECTION flipBOOL — defines if a annotation is flipped on the
annotation plane. Default is FALSE.

annotation | arrayAnnotations
One Reference or an array of references to annotation elements.

plane
Reference to the plane to which the annotations should be moved.
Error handling
The program execution will be canceled if the reference to the
annotations and the plane could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT_MULTIPLE ANNOTATION_ELEMENT -1 annotations
USER_SELECT FACE face
MOVE_ANNOTATION_TO_PLANE annotations face
§
MOVE_ANNOTATION_TO_ORIENTATION
Moves annotation elements to an orientation.
Syntax
MOVE_ANNOTATION_TO_ORIENTATION [options] annotation<:in> |
arrayAnnotations<:in> "name"<:in>
Arguments

options
The following options are supported:
FLIP_DIRECTION flipBOOL — defines if a annotation is flipped on the
annotation plane. Default is FALSE.

annotation | arrayAnnotations
One Reference or an array of references to annotation elements.

name
Name of the orientation.
Error handling
The program execution will be canceled if the reference to the
annotations and the plane could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT_MULTIPLE ANNOTATION_ELEMENT -1 annotations
MOVE_ANNOTATION_TO_ORIENTATION annotations "top"
§
ADD_ANNOTATION_REF
Adds a surface reference to an dimension, note, symbol, geometric
tolerance, or datum tag annotation.
Syntax
ADD_ANNOTATION_REF [options] annotation<:in> references<:in>
Arguments

options
The following options are available:
ANNOTATION_REF_TYPE "type" — the following annotation reference
types are available: FIRST_REF and SECOND_REF. Default is
FIRST_REF. This option only applies to dimension annotations.

annotation
Existing reference to a dimension, note, symbol, geometric tolerance
or datum tag annotation.

references
Existing reference which should be added to the annotation.
Error handling
The program execution will be canceled if the annotation or the
reference could not be found or if the reference could not be
applied, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
USER_SELECT SURFACE srf
ADD_ANNOTATION_REF ANNOTATION_REF_TYPE SECOND_REF dim srf
§
ADD_ANNOTATION_REFS
Adds surface references to an dimension, note, symbol, geometric
tolerance, or datum tag annotation.
Syntax
ADD_ANNOTATION_REFS [options] annotation<:in> array_references<:in>
Arguments

options
The following options are available:
ANNOTATION_REF_TYPE "type" — the following annotation reference
types are available: FIRST_REF and SECOND_REF. Default is
FIRST_REF. This option only applies to dimension annotations.

annotation
Existing reference to a dimension, note, symbol, geometric tolerance
or datum tag annotation.

array_references
Existing array with references which should be added to the
annotation.
Error handling
The program execution will be canceled if the annotation or the array
of references could not be found or if the references could not be
applied, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
USER_SELECT_MULTIPLE SURFACE -1 array_surfaces
ADD_ANNOTATION_REFS ANNOTATION_REF_TYPE SECOND_REF dim array_surfaces
§
GET_ANNOTATION_REFS
Retrieves all references from an dimension, note, symbol, gtol, or
datum tag annotation.
Syntax
GET_ANNOTATION_REFS [options] annotation<:in> array_references<:out>
Arguments

options
The following options are available:
ANNOTATION_REF_TYPE "type" — the following annotation reference
types are available: FIRST_REF, SECOND_REF and ALL. Default is ALL.
This option only applies to dimension annotations.

annotation
Existing reference to a dimension, note, symbol, gtol or datum tag
annotation.

array_references
Name of the array which receives references.
Error handling
The program execution will be canceled if the annotation or its
reference could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_ANNOTATION_REFS ANNOTATION_REF_TYPE FIRST_REF dim references
PRINT "references: %" references
§
GET_ANNOTATION_ELEMENT
Retrieves the first annotation element of an annotation feature or of
other features which contain annotation elements.
Syntax
GET_ANNOTATION_ELEMENT feat_annotation<:in> elem_annotation<:out>
Arguments

feat_annotation
Existing reference to an annotation feature.

elem_annotation
Name of the reference which receives the annotation element.
Error handling
The program execution will be canceled if the feature could not be
found or if it does not contain annotation elements, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
GET_ANNOTATION_ELEMENT feat elem
PRINT "%" elem
§
GET_ANNOTATION_ELEMENTS
Retrieves all annotation elements of an annotation feature or of
other features which contain annotation elements.
Syntax
GET_ANNOTATION_ELEMENTS feat_annotation<:in>
array_elem_annotations<:out>
Arguments

feat_annotation
Existing reference to an annotation feature.

array_elem_annotations
Name of the array which receives the annotation elements.
Error handling
The program execution will be canceled if the feature could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
GET_FEATURE_TYPE feat type
GET_ANNOTATION_ELEMENTS feat arrayElements

FOR elem REF ARRAY arrayElements


PRINT "Element: %" elem
END_FOR
§
SET_ANNOTATION_ELEMENT
Removes existing elements from the annotation and places a new one
instead.
Syntax
SET_ANNOTATION_ELEMENT feat_annotation<:in> elem_annotation<:in>
Arguments

feat_annotation
Existing reference to an annotation feature.

elem_annotation
Existing reference to an annotation element.
Error handling
The program execution will be canceled if the annotation feature or
the annotation element could not be found, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
USER_SELECT NOTE note
SET_ANNOTATION_ELEMENT feat note
§
SET_ANNOTATION_ELEMENTS
Removes existing elements from the annotation and places the new ones
instead.
Syntax
SET_ANNOTATION_ELEMENTS feat_annotation<:in>
array_elem_annotations<:in>
Arguments

feat_annotation
Existing reference to an annotation feature.

array_elem_annotation
Existing array of reference to annotation elements
Error handling
The program execution will be canceled if the annotation feature or
the array of annotation elements could not be found, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
USER_SELECT NOTE note
USER_SELECT SYMBOL symbol
DECLARE_ARRAY elements
ADD_ARRAY_ELEM elements note
ADD_ARRAY_ELEM elements symbol
SET_ANNOTATION_ELEMENTS feat elements
§
ADD_ANNOTATION_ELEMENT
Adds a new annotation element to an annotation feature.
Syntax
ADD_ANNOTATION_ELEMENT feat_annotation<:in> elem_annotation<:in>
Arguments

feat_annotation
Existing reference to an annotation feature.

elem_annotation
Existing reference to an annotation element.
Error handling
The program execution will be canceled if the annotation feature or
the annotation element could not be found, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
USER_SELECT NOTE note
ADD_ANNOTATION_ELEMENT feat note
§
ADD_ANNOTATION_ELEMENTS
Adds an array of annotation elements to an annotation feature.
Syntax
ADD_ANNOTATION_ELEMENTS feat_annotation<:in>
array_elem_annotations<:in>
Arguments

feat_annotation
Existing reference to an annotation feature.

array_elem_annotation
Existing array of reference to annotation elements
Error handling
The program execution will be canceled if the annotation feature or
the array of annotation elements could not be found, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
USER_SELECT NOTE note
USER_SELECT SYMBOL symbol
DECLARE_ARRAY elements
ADD_ARRAY_ELEM elements note
ADD_ARRAY_ELEM elements symbol
ADD_ANNOTATION_ELEMENTS feat elements
§
DELETE_ANNOTATION_ELEMENT
Delete an annotation from its annotation feature.
Syntax
DELETE_ANNOTATION_ELEMENT annotation<:in>
Arguments

annotation
Existing reference to an annotation.
Error handling
The program execution will be canceled if the annotation could not be
found or deleted from the annotation feature, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
Unlike removing an annotation element manually, the references are
not restored automatically by the Creo API. This is automatically
done afterwards, but has some limitations. Especially for datum tag
annotations, this is not possible at all.
Example
USER_SELECT NOTE note
DELETE_ANNOTATION_ELEMENT note
§
DELETE_ANNOTATION_ELEMENTS
Delete all elements from an annotation feature.
Syntax
DELETE_ANNOTATION_ELEMENTS feat_annotation<:in>
Arguments

feat_annotation
Existing reference to an annotation feature.
Error handling
The program execution will be canceled if the feature could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Unlike removing an annotation element manually, the references are
not restored automatically by the Creo API. This is automatically
done afterwards, but has some limitations. Especially for datum tag
annotations, this is not possible at all.
Example
USER_SELECT FEATURE feat
DELETE_ANNOTATION_ELEMENTS feat
§
ADD_ANNOTATION_ELEMENT_REF
Adds a standard, surface or chain reference to an annotation element.
Syntax
ADD_ANNOTATION_ELEMENT_REF [options] annotation_element<:in>
reference<:in>
Arguments

options
The following options are supported:
ANNOTATION_ELEMENT_REF_TYPE "type" — the following annotation
element reference types are available: STANDARD, SURFACE and CHAIN.
Default is STANDARD.

STRENGTHEN strongBOOL — defines if a annotation element reference


is strong or weak. Default is FALSE.
DESCRIPTION "description" — is used for the description of the
reference. Default is an empty string.

annotation_element
Existing reference to an annotation element.

reference
Existing reference which should be added to the annotation element.
Error handling
The program execution will be canceled if the annotation element or
the reference could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION_ELEMENT annotation_element
USER_SELECT SURFACE surface
ADD_ANNOTATION_ELEMENT_REF ANNOTATION_ELEMENT_REF_TYPE SURFACE
STRENGTHEN TRUE DESCRIPTION "some information" annotation_element
surface
§
ADD_ANNOTATION_ELEMENT_REFS
Adds standard, surface or chain references to an annotation element.
Syntax
ADD_ANNOTATION_ELEMENT_REFS [options] annotation_element<:in>
array_reference<:in>
Arguments

options
The following options are supported:
ANNOTATION_ELEMENT_REF_TYPE "type" — the following annotation
element reference types are available: STANDARD, SURFACE and CHAIN.
Default is STANDARD.

STRENGTHEN strongBOOL — defines if a annotation element reference


is strong or weak. Default is FALSE.
DESCRIPTION "description" — is used for the description of the
reference. Default is an empty string.

annotation_element
Existing reference to an annotation element.

array_reference
Existing array with references which should be added to the
annotation element.
Error handling
The program execution will be canceled if the annotation element or
the array could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION_ELEMENT annotation_element
USER_SELECT_MULTIPLE SURFACE -1 array_surfaces
ADD_ANNOTATION_ELEMENT_REFS ANNOTATION_ELEMENT_REF_TYPE SURFACE
STRENGTHEN TRUE DESCRIPTION "some information" annotation_element
array_surfaces
§
GET_ANNOTATION_ELEMENT_REFS
Reads standard, surface or chain references from an annotation
element.
Syntax
GET_ANNOTATION_ELEMENT_REFS [options] annotation_element<:in>
array_references<:out>
Arguments

options
The following options are supported:
ANNOTATION_ELEMENT_REF_TYPE "type" — the following annotation
element reference types are available as filter: STANDARD, SURFACE,
CHAIN. and ALL. Default is STANDARD.

annotation_element
Existing reference to an annotation element.

array_references
Name of the array which receives structures of type
ANNOTATION_ELEMENT_REF_OPTION.
Error handling
The program execution will be canceled if the annotation element does
not exist or the references could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION_ELEMENT annotation_element
GET_ANNOTATION_ELEMENT_REFS ANNOTATION_ELEMENT_REF_TYPE STANDARD
annotation_elemen array_refs
PRINT "%" array_ref
§
REMOVE_ANNOTATION_ELEMENT_REF
Removes standard, surface or chain references from an annotation
element.
Syntax
REMOVE_ANNOTATION_ELEMENT_REFS [options] annotation_element<:in>
reference<:in> | array_reference<:in> | "*"
Arguments

options
The following options are supported:
ANNOTATION_ELEMENT_REF_TYPE "type" — the following annotation
element reference types are available: STANDARD, SURFACE, CHAIN and
ALL. Default is STANDARD.

annotation_element
Existing reference to an annotation element.

reference<:in> | array_reference | "*"


Existing reference or array of references which should be removed
from the annotation element. Use an asterisk '*' to remove all
references.
Error handling
The program execution will be canceled if the annotation element or
the array could not be found or the references could not be deleted,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
! remove annotation element references of type surface
USER_SELECT ANNOTATION_ELEMENT elem
GET_ANNOTATION_ELEMENT_REFS ANNOTATION_ELEMENT_REF_TYPE "SURFACE"
elem arrayAnnotationElemRefs

DECLARE_ARRAY arrayReferences
FOR annotationElemRef REF ARRAY arrayAnnotationElemRefs
ADD_ARRAY_ELEM arrayReferences annotationElemRef.reference
END_FOR

REMOVE_ANNOTATION_ELEMENT_REF ANNOTATION_ELEMENT_REF_TYPE "SURFACE"


elem arrayReferences

! Remove all annotation element references


USER_SELECT ANNOTATION_ELEMENT elem
REMOVE_ANNOTATION_ELEMENT_REF elem "*"
§
SET_ANNOTATION_ELEMENT_REF_STRENGTH
Sets to removes the strong flag for standard, surface or chain
references of an annotation element.
Syntax
SET_ANNOTATION_ELEMENT_REF_STRENGTH [options] annotation_element<:in>
reference<:in> | array_reference<:in> | "*" strongBOOL
Arguments

options
The following options are supported:
ANNOTATION_ELEMENT_REF_TYPE "type" — the following annotation
element reference types are available: STANDARD, SURFACE, CHAIN and
ALL. Default is STANDARD.

annotation_element
Existing reference to an annotation element.

reference<:in> | array_reference | "*"


Existing reference or array of references to which the strong flag
should be set or removed. Use an asterisk '*' to set or remove the
strong flag for all references.

strong
Boolean variable which defines if the strong flag is set to removed.
Error handling
The program execution will be canceled if the annotation element or
the array could not be found or the flat could not be set, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
! set the strong flag to all annotation element references of type
surface
USER_SELECT ANNOTATION_ELEMENT elem
GET_ANNOTATION_ELEMENT_REFS ANNOTATION_ELEMENT_REF_TYPE "SURFACE"
elem arrayAnnotationElemRefs

DECLARE_ARRAY arrayReferences
FOR annotationElemRef REF ARRAY arrayAnnotationElemRefs
ADD_ARRAY_ELEM arrayReferences annotationElemRef.reference
END_FOR

SET_ANNOTATION_ELEMENT_REF_STRENGTH ANNOTATION_ELEMENT_REF_TYPE
"SURFACE" elem arrayReferences TRUE

! Remove the strong flag from all annotation element references


USER_SELECT ANNOTATION_ELEMENT elem
SET_ANNOTATION_ELEMENT_REF_STRENGTH elem "*" FALSE
§
GET_MDL_ANNOTATION_PLANE
Retrieves named and standard annotation planes of each model. Custom
named annotation plane could not be processed.
Syntax
GET_MDL_ANNOTATION_PLANE model<:in> "name" plane<:out>
Arguments

model
Model of the annotation plane.
name
Name of the annotation plane. Only the following standard names can
be used: FLAT_TO_SCREEN, FRONT, TOP, RIGHT, BACK, BOTTOM, LEFT.

plane
Name of the variable which will receive the annotation plane
reference.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_ANNOTATION_PLANE PART "FRONT" annotPlaneFront
§
GET_MDL_ACTIVE_ANNOTATION_PLANE
Retrieves the active annotation plane of a mode. This command
requires Creo 4.0 M100, Creo 5.0.5.0 / Creo 6.0.1.0 or above.
Syntax
GET_MDL_ACTIVE_ANNOTATION_PLANE model<:in> plane<:out>
Arguments

model
Model of the annotation plane.

plane
Name of the variable which will receive the active annotation plane
reference.
Error handling
The program execution will be canceled if the model could not be
found or the active annotation plane could not be determined, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_ACTIVE_ANNOTATION_PLANE PART annotation_plane
PRINT "%" annotation_plane
GET_ANNOTATION_PLANE_NAME annotation_plane name
PRINT "%" name
§
GET_REF_ANNOTATION_PLANE
Retrieves the annotation plane of a reference to an annotation.
Syntax
GET_REF_ANNOTATION_PLANE [options] refAnnotation<:in> plane<:out>
Arguments

options
The following options are supported:
CALC_POS valueBOOL— this configuration option determines if an
existing annotation plane should be used or if a new one is to be
created at the calculated position. Since dimensions are not always
placed directly on the annotation plane, this option helps to
create an annotation plane which is in the same plane as the
dimension text.

refAnnotationl
Reference to an existing annotation.

plane
Name of the variable which will receive the annotation plane
reference.
Error handling
The program execution will be canceled if the reference could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION annotation
GET_REF_ANNOTATION_PLANE annotation annotationPlane
PRINT "%" annotationPlane
§
CREATE_ANNOTATION_PLANE
Creates an annotation plane based on model orientation or a plane
reference.
Syntax
CREATE_ANNOTATION_PLANE mdl<:in> plane_option<:in> plane<:out>
Arguments

model
Model of the annotation plane.

plane_option
Existing structure variable of type ANNOTATION_PLANE_OPTION to define
the annotation plane setup.

plane
Name of the variable which will receive the annotation plane
reference.
Error handling
The program execution will be canceled if the mdl could not be found,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
USER_SELECT FACE face

DECLARE_STRUCT ANNOTATION_PLANE_OPTION planeOption


planeOption.type = "REFERENCE"
planeOption.ref_plane = face

CREATE_ANNOTATION_PLANE PART planeOption plane


SHOW_DIM_ANNOTATION dim plane
§
GET_ANNOTATION_PLANE_NAME
Retrieves the name of an annotation plane. This command requires Creo
4.0 M130, Creo 6.0.5.0 or above. Creo 5.0 is not supported.
Syntax
GET_ANNOTATION_PLANE_NAME plane<:in> name<:out>
Arguments

plane
Existing reference to an annotation plane.

name
Name of the variable which will receive the name of the annotation
plane.
Error handling
The program execution will be canceled if the annotation plane could
not be found, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Unnamed annotation planes have the name UNKNOWN.
Example
GET_MDL_ANNOTATION_PLANE PART "TOP" annotation_plane
GET_ANNOTATION_PLANE_NAME annotation_plane name
PRINT "%" name
§
SET_ANNOTATION_PLANE_NAME
Sets the name of an annotation plane and optionally adds it to the
gallery. This command requires Creo 4.0 M130, Creo 6.0.5.0 or above.
Creo 5.0 is not supported.
Syntax
SET_ANNOTATION_PLANE_NAME [options] plane<:in> "name"
Arguments

options
The following options are available

GALLERY_DISPLAY displayBOOL — to define if the annotation plane is


added to the gallery or not. Default is FALSE.

plane
Existing reference to an annotation plane.

name
Name which should be used for the annotation plane. Any string
expression is allowed.
Error handling
The program execution will be canceled if the annotation plane could
not be found or the name could not be applied, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
DECLARE_STRUCT ANNOTATION_PLANE_OPTION option
option.type = "REFERENCE"
SEARCH_MDL_REF PART PLANE "*" option.ref_plane
CREATE_ANNOTATION_PLANE PART option annotation_plane1
SET_ANNOTATION_PLANE_NAME annotation_plane1 "annot1"

option.type = "NAMED_VIEW"
option.view_name = "MY_ANNOTATION"
CREATE_ANNOTATION_PLANE PART option annotation_plane2
SET_ANNOTATION_PLANE_NAME GALLERY_DISPLAY FALSE annotation_plane2
"annot2"

option.type = "FLAT_TO_SCREEN_SCREEN_COORD"
CREATE_ANNOTATION_PLANE PART option annotation_plane3
SET_ANNOTATION_PLANE_NAME GALLERY_DISPLAY TRUE annotation_plane3
"annot3"
§
GET_ANNOTATION_POS
Retrieves position of an annotation.
Syntax
GET_ANNOTATION_POS referenceAnnotation<:in> pos<:out>
Arguments

referenceAnnotation
Reference to an annotation.

pos
Structure variable of type POINT will receive the result.
Error handling
The program execution will be canceled if the annotation reference
does not exist or the position could not be determined, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_ANNOTATION_POS dim pos
PRINT "pos: %/%/%" pos.x pos.y pos.z
§
SET_ANNOTATION_POS
Sets the position of an annotation.
Syntax
SET_ANNOTATION_POS referenceAnnotation<:in> pos<:in>
Arguments

referenceAnnotation
Reference to an annotation.

pos
Existing structure variable of type POINT.
Error handling
The program execution will be canceled if the annotation reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
DECLARE_STRUCT POINT pnt
pnt.x = 100
pnt.y = 0
pnt.z = 0
SET_ANNOTATION_POS dim pos
§
GET_ANNOTATION_LEADER_REF
Retrieves the attachment reference of an annotation leader.
Syntax
GET_ANNOTATION_LEADER_REF refAnnotation<:in>
refLeaderAttachment<:out>
Arguments

refAnnotation
Reference to an annotation.

refLeaderAttachment
Name of the variable which should receive the reference to the leader
attachment.
Error handling
The program execution will be canceled if the annotation reference
does not exist or if the leader attachment reference could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL symbol
GET_ANNOTATION_LEADER_REF symbol leaderAttachment

PRINT "Leader attachment: %" leaderAttachment


§
GET_ANNOTATION_LEADER_REFS
Retrieves the all attachment references of an annotation leader.
Syntax
GET_ANNOTATION_LEADER_REFS refAnnotation<:in>
arrayLeaderAttachments<:out>
Arguments

refAnnotation
Reference to an annotation.

arrayLeaderAttachments
Name of the array which should receive the references to all leader
attachments.
Error handling
The program execution will be canceled if the annotation reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL symbol
GET_ANNOTATION_LEADER_REFS symbol arrayLeaderAttachments
FOR leaderAttachment REF ARRAY arrayLeaderAttachments
PRINT "Leader attachment: %" leaderAttachment
END_FOR
§
GET_ANNOTATION_ORIENTATION
Retrieves orientation of an annotation.
Syntax
GET_ANNOTATION_ORIENTATION referenceAnnotation<:in> matrix<:out>
Arguments

referenceAnnotation
Reference to an annotation or to an annotation plane.

matrix
Structure variable of type MATRIX will receive the result.
Error handling
The program execution will be canceled if the annotation reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_ANNOTATION_ORIENTATION dim orientation

PRINT "% / % / % / %" orientation.m11 orientation.m12 orientation.m13


orientation.m14
PRINT "% / % / % / %" orientation.m21 orientation.m22 orientation.m23
orientation.m24
PRINT "% / % / % / %" orientation.m31 orientation.m32 orientation.m33
orientation.m34

SET_ORIENTATION_MATRIX dim orientation


§
GET_ANNOTATION_ANGLE
Retrieves angle of an annotation.
Syntax
GET_ANNOTATION_ANGLE referenceAnnotation<:in> angle<:out>
Arguments

referenceAnnotation
Reference to an annotation or an annotation plane.

angle
Name of the double variable which will receive the angle.
Error handling
The program execution will be canceled if the annotation reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_REF_ANNOTATION_PLANE dim plane

GET_ANNOTATION_ANGLE plane angle


PRINT "%" angle
§
SET_ANNOTATION_ANGLE
Retrieves position of an annotation.
Syntax
SET_ANNOTATION_ANGLE referenceAnnotation<:in> angleDOUBLE
Arguments

referenceAnnotation
Reference to an annotation.

angle
Angle for the annotation as double value .Any math expression is
allowed.
Error handling
The program execution will be canceled if the annotation reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_ANNOTATION_ANGLE dim angle
PRINT "%" angle
SET_ANNOTATION_ANGLE dim 45.0
§
GET_ANNOTATION_TEXT_STYLE
Retrieves the text style of an annotation.
Syntax
GET_ANNOTATION_TEXT_STYLE [options] referenceAnnotation<:in>
text_syle<:out>
Arguments

options
the following options are supported:
EXPAND_DEFAULT valueBOOL — to expand the default values which are
encoded by -1.0 to their real values. Default is FALSE.

referenceAnnotation
Reference to an annotation.

text_style
Structure variable of type TEXT_STYLE which receives the text style
definition.
Error handling
The program execution will be canceled if the annotation reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION annotation
GET_ANNOTATION_TEXT_STYLE EXPAND_DEFAULT TRUE annotation style
PRINT "height: %" style.height
PRINT "thickness: %" style.thickness
PRINT "width_factor: %" style.width_factor
PRINT "slant_angle: %" style.slant_angle
PRINT "underline: %" style.underline
PRINT "horz_justification : %" style.horz_justification
PRINT "angle : %" style.angle
IF style.color.by_name == TRUE
PRINT "color: %" style.color.color_name
ELSE
PRINT "color: %/%/%" style.color.color_rgb.red
style.color.color_rgb.green style.color.color_rgb.blue
END_IF
PRINT "mirror : %" style.mirror
§
SET_ANNOTATION_TEXT_STYLE
Sets the text style for an annotation.
Syntax
SET_ANNOTATION_TEXT_STYLE referenceAnnotation<:in> text_syle<:in>
Arguments

referenceAnnotation
Reference to an annotation.

text_style
Structure variable of type TEXT_STYLE which contains the text style
definition.
Error handling
The program execution will be canceled if the annotation reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION annotation
GET_ANNOTATION_TEXT_STYLE annotation style
style.height = 5.0
SET_ANNOTATION_TEXT_STYLE annotation style
§
GET_ANNOTATION_ELEMENT_NAME
Gets the name of a specified annotation element which is contained by
an annotation feature.
Syntax
GET_ANNOTATION_ELEMENT_NAME refAnnotation<:in> name<:out>
Arguments

refAnnotation
Name of an existing reference to an annotation element in an
annotation feature.

Name
Name of the variable which will receive the name. In case there is no
name the result will be UNKNOWN.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION annotation
GET_ANNOTATION_ELEMENT_NAME annotation name
PRINT "%" name
§
SET_ANNOTATION_ELEMENT_NAME
Sets the name of a specified annotation element which is contained by
an annotation feature.
Syntax
SET_ANNOTATION_ELEMENT_NAME refAnnotation<:in> [options] "name"
Arguments

refAnnotation
Name of an existing reference to an annotation element in an
annotation feature.

options
The following options are available:
ASK_RENAME_EXISTING valueBOOL — to define if the user is asked in
case existing reference names have to be renamed. Default is TRUE.

name
Name which should be used be applied to the annotation element. It
needs to follow the Creo Elements/Pro rules for names. Any string
expression is allowed.
Error handling
The program execution will be canceled if the reference does not
exist or if it could not be renamed, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
In case the name contains an asterisk the next available consecutive
number will be used for this to create a new unique name. Otherwise
if another entity in Creo has the same name, the user will be asked
if the existing name should be erased.
Example
USER_SELECT ANNOTATION annotation
SET_ANNOTATION_ELEMENT_NAME annotation ASK_RENAME_EXISTING FALSE
"abc*"
USER_SELECT ANNOTATION annotation2
SET_ANNOTATION_ELEMENT_NAME annotation2 "test"
§
GET_ANNOTATION_LEGACY_STATE
Retrieves the information about the legacy state of an annotation.
These annotations have been created prior to Creo 4.0. This function
requires Creo Parametric 4.0 M090, 5.0.5.0, 6.0.2.0 or above.
Syntax
GET_ANNOTATION_LEGACY_STATE annotation<:in> legacy_state<:out>
Arguments

annotation
Existing reference to an annotation.

legacy_state
Name of the boolean variable which will receive the legacy state.
Error handling
The program execution will be canceled if the annotation reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_ANNOTATION_LEGACY_STATE annotation state
IF state == TRUE
CONVERT_LEGACY_ANNOTATION annotation
PRINT "Converted !!!"
ELSE
PRINT "Not converted !!!"
END_IF
§
CONVERT_LEGACY_ANNOTATION
Converts a legacy annotation. These annotations have been created
prior to Creo 4.0. This function requires Creo Parametric 4.0.
Syntax
CONVERT_LEGACY_ANNOTATION annotation<:in>
Arguments

annotation
Existing reference to an annotation.
Error handling
The program execution will be canceled if the annotation reference
does not exist or could not be converted, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
GET_ANNOTATION_LEGACY_STATE annotation state
IF state == TRUE
CONVERT_LEGACY_ANNOTATION annotation
PRINT "Converted !!!"
ELSE
PRINT "Not converted !!!"
END_IF
§
About Commands for Dimension Annotations
Commands for creating and accessing solid model annotations. These
functions require Pro/ENGINEER Wildfire 4 or above. Annotations can
be notes, symbols etc which can be placed on annotation features.
The following commands are available:
SHOW_DIM_ANNOTATION — to convert a solid dimension to an annotation
dimension.
CREATE_DIM_ANNOTATION — to create a new annotation dimension.
READ_DIM_ANNOTATION — to read the properties of an existing
annotation dimension.
DELETE_DIM_ANNOTATION — to delete an annotation dimension.
§
SHOW_DIM_ANNOTATION
Converts a solid dimension to an annotation dimension.
Syntax
SHOW_DIM_ANNOTATION reference_dim<:in>
reference_annotation_plane<:in>
Arguments

reference_owner
Existing reference to a solid dimension.

reference_attach
Existing reference to an annotation plane. Also NULL can be used if
the orientation should be calculated automatically.
Error handling
The program execution will be canceled if the reference to the
dimension or the annotation plane do not exist or if the conversion
fails, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SHOW_DIM_ANNOTATION dim NULL
§
CREATE_DIM_ANNOTATION
Creates an annotation dimension.
Syntax
CREATE_DIM_ANNOTATION model<:in> dim_option<:in> dim<:out>
Arguments

model
Model of the annotation plane.

dim_option
Existing structure variable of type ANNOTATION_DIM_OPTION to define
the dimension setup.

dim
Name of the variable which will receive the dimension reference.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_STRUCT ANNOTATION_PLANE_OPTION plane_option
plane_option.type = "REFERENCE"
USER_SELECT FACE plane_option.ref_plane
CREATE_ANNOTATION_PLANE PART plane_option plane

DECLARE_STRUCT ANNOTATION_DIM_OPTION option


option.annotation_plane = plane
USER_SELECT EDGE edge
ADD_ARRAY_ELEM option.array_references edge
CREATE_DIM_ANNOTATION PART option dim
§
READ_DIM_ANNOTATION
Reads the properties of an existing annotation dimension.
Syntax
READ_DIM_ANNOTATION dim<:in> dim_option
Arguments

dim
Reference to an existing annotation dimension.

dim_option
Structure variable of type ANNOTATION_DIM_OPTION which will receive
the dimension setup information.
Error handling
The program execution will be canceled if the reference to the
dimension does not exist or if the definition could not be read,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
For driving annotation dimensions, the members array_references,
array_dim_sense and orient of the structure ANNOTATION_DIM_OPTION
will not be filled.
Example
USER_SELECT DIMENSION dim
READ_DIM_ANNOTATION dim dim_option
PRINT "placement_pos %/%/%" dim_option.placement_pos.x
dim_option.placement_pos.y dim_option.placement_pos.z
§
DELETE_DIM_ANNOTATION
Deletes an existing annotation dimension.
Syntax
DELETE_DIM_ANNOTATION dim<:in>
Arguments

dim
Reference to an existing annotation dimension.
Error handling
The program execution will be canceled if the reference to the
dimension does not exist or if the annotation dimension could not be
deleted, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION_DIMENSION dim
DELETE_DIM_ANNOTATION dim
§
About Commands for Note Annotations
Commands for creating, deleting and modifying note annotations.
The following commands are available:
CREATE_NOTE — to create a note.
DELETE_NOTE — to delete a note.
CREATE_NOTE_EX — extended version of the command to create a note
in a solid model.
READ_NOTE_EX — extended version of the command to read the content
of a node from a solid model.
MODIFY_NOTE_EX — extended version of the command to modify a note
in a solid model.
GET_NOTE_TEXT — to retrieve the text of a note.
SET_NOTE_TEXT — to set the text of a note.
GET_NOTE_URL — to retrieve the URL of a note.
SET_NOTE_URL — to set the URL to a note.
GET_NOTE_OWNER — to retrieve the owner of a note.
§
CREATE_NOTE
Creates a text note with leader to a model or feature. As attachment
item a point reference is required.
Syntax
CREATE_NOTE [options] reference_owner<:in> reference_attach<:in>
"text"
Arguments

options
NO_LEADER — Create the note without a leader.
NO_DEL_IDENT — avoids to add an delete identifier as parameter.

reference_owner
Existing reference to a model or a feature.

reference_attach
Existing reference to a geometrical item. Points, axis and surfaces
can be used. In case of a datum plane, Creo Elements/Pro prompts the
user to specify an additional reference.

text
Text which should be displayed in the note. Any string expression is
allowed.
Example
USER_SELECT MODEL modelOwner
USER_SELECT POINT attachPoint
CREATE_NOTE modelOwner attachPoint "This is a note"
§
DELETE_NOTE
Deletes a note.
Syntax
DELETE_NOTE refNote<:in>
Arguments

refNote
Reference to an existing note.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS THIS NOTE "*" allNotes
FOR note REF ARRAY allNotes
DELETE_NOTE note
END_FOR
§
CREATE_NOTE_EX
Creates a note in a solid model.
Syntax
CREATE_NOTE_EX [options] owner<:in> note_option ref_note<:out>
Arguments

options
NO_DEL_IDENT — avoids to add an delete identifier as parameter.

owner
Reference to the owner of the note. This could be a model or a
feature.

note_option
Structure variable of type NOTE_OPTION which contains the definition
of the note placement and its leaders.

ref_note
Name for the reference to the created note.
Error handling
The program execution will be canceled if the reference to the note
owner does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case notes are placed with placement_type ON_ITEM and the
placement_ref is an edge which was searched, the exact position can
either be determined by using SET_REF_POS or by specifying the
placement_pos.
For leaders to searched edge references it is the same situation. In
case SET_REF_POS is used for the selection the exact position on the
edge can be specified.
Example
GET_MDL_ANNOTATION_PLANE PART "TOP" annotation_plane

DECLARE_STRUCT NOTE_OPTION note_option


note_option.named_orientation = FALSE
note_option.ref_orientation = annotation_plane

note_option.text = "leader_note"
note_option.placement_type = "WITH_LEADER"

! positioning of the note


note_option.placement_pos.x = 0
note_option.placement_pos.y = 100
note_option.placement_pos.z = -100

! search the references for the leaders


SEARCH_MDL_REF PART EDGE "EDGE_TOP" edgeTop
SEARCH_MDL_REF PART EDGE "EDGE_LEFT" edgeLeft

! use SET_REF_POS to indicate the edge position in model coordinates


DECLARE_STRUCT POINT pnt
pnt.x = 25
pnt.y = 0
pnt.z = 25

SET_REF_POS NULL edgeLeft pnt


SET_REF_POS NULL edgeTop pnt

! define the leaders


DECLARE_STRUCT ATTACH_LEADER leader
leader.placement_ref = edgeLeft
leader.placement_type = "ON_ENTITY"
ADD_ARRAY_ELEM note_option.array_leaders leader
DECLARE_STRUCT ATTACH_LEADER leader
leader.placement_ref = edgeTop
leader.placement_type = "ON_ENTITY"
ADD_ARRAY_ELEM note_option.array_leaders leader

! create the note


CREATE_NOTE_EX PART note_option note
§
READ_NOTE_EX
Reads the information from an existing note in an solid model.
Syntax
READ_NOTE_EX refNote<:in> note_option<:out>
Arguments

refNote
Reference to a note.

note_option
Name of the structure variable of type NOTE_OPTION which should
retrieve the note information.
Error handling
The program execution will be canceled if the reference to the note
does not exist or could not be determined, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT NOTE note

READ_NOTE_EX note note_option

PRINT "type: %" note_option.placement_type


PRINT "type: %/%/%" note_option.placement_pos.x
note_option.placement_pos.y note_option.placement_pos.z

FOR leader REF ARRAY note_option.array_leaders


PRINT "--- LEADER ---"
PRINT "leader_type: %" leader.placement_type
PRINT "leader_ref: %" leader.placement_ref

GET_REF_POS NULL leader.placement_ref pos


PRINT "leader_ref_pos: %/%/%" pos.x pos.y pos.z

PRINT "leader pos: %/%/%" leader.placement_pos.x


leader.placement_pos.y leader.placement_pos.z
PRINT "leader arrow: %" leader.arrow_type
END_FOR

PRINT "--- content ---"


PRINT "text: %" note_option.text
PRINT "height: %" note_option.text_style.height
PRINT "thickness: %" note_option.text_style.thickness
PRINT "width_factor: %" note_option.text_style.width_factor
PRINT "slant_angle: %" note_option.text_style.slant_angle
PRINT "underline: %" note_option.text_style.underline
PRINT "horz_justification: %"
note_option.text_style.horz_justification
PRINT "vert_justification: %"
note_option.text_style.vert_justification
PRINT "angle: %" note_option.text_style.angle
IF note_option.text_style.color.by_name == TRUE
PRINT "color: %" note_option.text_style.color.color_name
ELSE
PRINT "color: %/%/%" note_option.text_style.color.color_rgb.red \
note_option.text_style.color.color_rgb.green \
note_option.text_style.color.color_rgb.blue
END_IF

PRINT "mirror: %" note_option.text_style.mirror


PRINT "font: %" note_option.text_style.font
§
MODIFY_NOTE_EX
Modifies an existing note in a solid model.
Syntax
MODIFY_NOTE_EX refNote<:in> note_option<:in>
Arguments

refNote
Reference to note.

note_option
Structure variable of type NOTE_OPTION which contains the note
information.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT NOTE note

READ_NOTE_EX note note_option

note_option.placement_type = "WITH_LEADER"

BEGIN_CATCH_ERROR
USER_SELECT EDGE edge
END_CATCH_ERROR

WHILE REF_VALID edge


DECLARE_STRUCT ATTACH_LEADER leader
leader.placement_ref = edge
leader.placement_type = "ON_ENTITY"

ADD_ARRAY_ELEM note_option.array_leaders leader

INVALIDATE_REF edge

BEGIN_CATCH_ERROR
USER_SELECT EDGE edge
END_CATCH_ERROR
END_WHILE

MODIFY_NOTE_EX note note_option


§
GET_NOTE_TEXT
Retrieves the text from an existing note.
Syntax
GET_NOTE_TEXT refNote<:in> noteText<:out>
Arguments

refNote
Reference to an existing note.

noteText
Parameter which will receive the note text.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS NOTE "note_0" refNote
GET_NOTE_TEXT refNote noteText
PRINT "Note text: %" noteText
§
SET_NOTE_TEXT
Sets the text of an existing note.
Syntax
SET_NOTE_TEXT refNote<:in> "text"
Arguments

refNote
Reference to an existing note.

text
This is the note text which should be created. Any string expression
is allowed.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT NOTE note
SET_NOTE_TEXT note "line1\nline2\nline3\nline4"
§
GET_NOTE_URL
Retrieves the URL which is assigned to a note. In case no URL is
assigned, the command returns an empty string. This functionality is
limited to notes on solid models and notes which are shown in
drawings.
Syntax
GET_NOTE_URL refNote<:in> URL<:out>
Arguments

refNote
Reference to an existing note.

URL
Name of the string variable which receives the note URL.
Error handling
The program execution will be canceled if the reference to the note
does not exist or if the URL could not be retrieved, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS NOTE "note_0" refNote
GET_NOTE_URL refNote url
PRINT "Note URL: %" url
§
SET_NOTE_URL
Sets the URL for an existing note. To delete the URL use and empty
string. This functionality is limited to notes on solid models and
notes which are shown in drawings.
Syntax
SET_NOTE_URL refNote<:in> "URL"
Arguments

refNote
Reference to an existing note.

URL
This is the note URL which should be created. Any string expression
is allowed.
Error handling
The program execution will be canceled if the reference to the note
does not exist or the URL could not be set, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT NOTE note
SET_NOTE_URL note "www.buw-soft.de"
§
GET_NOTE_OWNER
Retrieves the reference to the owner of a note, which is either a
model or a feature. This functionality is limited to notes on solid
models.
Syntax
GET_NOTE_OWNER refNote<:in> refOwner<:out>
Arguments

refNote
Reference to an existing note.

refOwner
Name of the reference which will receive the owner of the specified
note.
Error handling
The program execution will be canceled if the reference to the note
does not exist or the owner could not be determined, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT NOTE note
GET_NOTE_OWNER note owner
PRINT "%" owner
§
About Commands for Symbol Annotations
Commands for symbol annotations.
The following commands are available:
CREATE_SYMBOL — to create a symbol in a solid model.
READ_SYMBOL — to read the information from an existing symbol in a
solid model.
MODIFY_SYMBOL — to modify an existing symbol in a solid model.
DELETE_SYMBOL — to delete a symbol from a solid model.
SEARCH_SYMBOL_VAR_TEXT — to search for the variable text of a
symbol.
GET_SYMBOL_VAR_TEXT — to retrieve the variable text of a symbol by
its name.
SET_SYMBOL_VAR_TEXT — to set the variable text of a symbol by its
name.
SEARCH_SYMBOL_VAR_TEXT_NAMES — to search the names of variable
texts in a symbol.
SEARCH_SYMBOL_GROUP_NAMES — to search for the names of groups in a
symbol.
GET_SYMBOL_GROUP_SHOWN — to examine if a symbol group is visible or
not.
SET_SYMBOL_GROUP_SHOWN — to set a symbol group visible or none
visible.
GET_SYMBOL_GROUP_EXCLUSIVE — to examine if a symbol group is
exclusive or not.
GET_SYMBOL_POS — to retrieve the position of a symbol.
GET_SYMBOL_NAME — to retrieve the name of a symbol.
PURGE_UNUSED_SYMBOLS — to purge unused symbols from a solid model.
§
CREATE_SYMBOL
Creates a symbol in a solid model.
Syntax
CREATE_SYMBOL model<:in> "symbol_file" symbol_option
[ref_symbol<:out>]
SYMBOL_CONSTRAINT1
SYMBOL_CONSTRAINT2
...
END_CREATE_SYMBOL
Arguments

model
Reference to the model in which the symbol should be created.

symbol_file
Name and path of the symbol file. According to the path specification
it could be in library or in working directory. In case no path is
specified the search order is working directory, current library
directory and PRO_SYMBOL_DIR. In case the symbol_file contains an
empty string the member variable path of SYMBOL_OPTION is used
instead.

symbol_option
Structure variable of type SYMBOL_OPTION which contains the
definition of the symbol placement and its leaders.

ref_symbol
Optional name for reference to the created symbol.

symbol_constraint
VAR_TEXT 'name' "value"
Specify variable text element by string value.
SHOW_GROUP "path"
Shows a group in the symbol. In case of using nested groups use '\'
as sub path delimiter.
Example
DECLARE_STRUCT SYMBOL_OPTION symbol_option
symbol_option.placement_type = "FREE"
symbol_option.placement_pos.x = 100
symbol_option.placement_pos.y = 0
symbol_option.height = 20.0
symbol_option.angle = 10.0
symbol_option.copy_symbol = TRUE

DECLARE_STRUCT ATTACH_LEADER attachLeader1


attachLeader1.placement_type = "FREE"
attachLeader1.placement_pos.x = 10
attachLeader1.placement_pos.y = 10
ADD_ARRAY_ELEM symbol_option.array_leaders attachLeader1

DECLARE_STRUCT ATTACH_LEADER attachLeader2


attachLeader2.placement_type = "ON_ENTITY"
attachLeader2.placement_ref = refPnt
ADD_ARRAY_ELEM symbol_option.array_leaders attachLeader2

symbol_option.flat_to_screen = "FALSE"
symbol_option.screen_location = "FALSE"
symbol_option.view_orientation = "TOP"

CREATE_SYMBOL PART lib:sample symbol_option symbol


VAR_TEXT CITY Erlangen
VAR_TEXT COUNTRY Germany
VAR_TEXT ADDRESS "Weisse-Herz Str 2a"
VAR_TEXT COMPANY "BuW Software"
SHOW_GROUP ADDRESS
SHOW_GROUP ADDRESSEE\COMPANY
END_CREATE_SYMBOL
CREATE_ANNOTATION PART feat
SET_ANNOTATION_ELEMENT feat symbol
§
READ_SYMBOL
Reads the information from an existing symbol in an solid model.
Syntax
READ_SYMBOL refSymbol<:in> symbol_option<:out>
Arguments

refSymbol
Reference to symbol.

symbol_option
Name of the structure variable of type SYMBOL_OPTION which should
retrieve the symbol information.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL symbol
READ_SYMBOL symbol symbol_options
USER_SELECT_MULTIPLE EDGE -1 arrayEdges
FOR edge REF ARRAY arrayEdges
DECLARE_STRUCT ATTACH_LEADER aLeader
aLeader.placement_type = "ON_ENTITY"
aLeader.placement_ref = edge
ADD_ARRAY_ELEM symbol_options.array_leaders aLeader
END_FOR
MODIFY_SYMBOL symbol symbol_options
§
MODIFY_SYMBOL
Modifies an existing symbol in a solid model.
Syntax
MODIFY_SYMBOL refSymbol<:in> symbol_option<:in>
Arguments

refSymbol
Reference to symbol.

symbol_option
Structure variable of type SYMBOL_OPTION which contains the symbol
information.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
It is not possible to switch the existing symbol to another one.
Therefor changes in the path member of SYMBOL_OPTION are ignored.
Example
USER_SELECT SYMBOL symbol
READ_SYMBOL symbol symbol_options
USER_SELECT_MULTIPLE EDGE -1 arrayEdges
FOR edge REF ARRAY arrayEdges
DECLARE_STRUCT ATTACH_LEADER aLeader
aLeader.placement_type = "ON_ENTITY"
aLeader.placement_ref = edge
ADD_ARRAY_ELEM symbol_options.array_leaders aLeader
END_FOR
MODIFY_SYMBOL symbol symbol_options
§
DELETE_SYMBOL
Deletes a symbol.
Syntax
DELETE_SYMBOL refSymbol<:in>
Arguments

refSymbol
Reference to an existing drawing symbol.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS PART SYMBOL "*" allSymbols
FOR symbol REF ARRAY allSymbols
DELETE_SYMBOL symbol
END_FOR
§
SEARCH_SYMBOL_VAR_TEXT
Searches the variable text of a symbol for a specific entry and
retrieve its value.
Syntax
SEARCH_SYMBOL_VAR_TEXT refSymbol<:in> "name" paramValue<:out>
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the variable text entry in the symbol to search for. the Any
string expression is allowed.

paramValue
String Parameter which will receive the width of the drawing.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist or if the variable text was not found, unless errors
are handled by BEGIN_CATCH_ERROR.
Note
The value parameter is always in string format, even if the content
is defined as double or integer in Creo Elements/Pro.
Example
USER_SELECT SYMBOL refSymbol
SEARCH_SYMBOL_VAR_TEXT refSymbol "name" paramName
§
GET_SYMBOL_VAR_TEXT
Retrieves the variable text of a symbol by its name.
Syntax
GET_SYMBOL_VAR_TEXT refSymbol<:in> "name" text<:out>
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the variable text entry in the symbol.

text
Name of the string variable which will receive the variable text
content.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist or if the string could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
The variable text is always in string format, even if the content is
defined as double or integer in Creo Parametric.
Example
USER_SELECT SYMBOL symbol

SEARCH_SYMBOL_VAR_TEXT_NAMES symbol "*" allVarTexts

FOR varText REF ARRAY allVarTexts


GET_SYMBOL_VAR_TEXT symbol varText text
PRINT "%: %" varText text
END_FOR
§
SET_SYMBOL_VAR_TEXT
Sets the variable text of a symbol by its name.
Syntax
SET_SYMBOL_VAR_TEXT refSymbol<:in> "name" "text"
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the variable text entry in the symbol.

text
String which should be assigned to the variable text.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist or if the string could not be assigned, unless errors
are handled by BEGIN_CATCH_ERROR.
Note
The value parameter is always in string format, even if the content
is defined as double or integer in Creo Elements/Pro.
Example
USER_SELECT SYMBOL refSymbol
SET_SYMBOL_VAR_TEXT refSymbol "name" "This is a text"
§
SEARCH_SYMBOL_VAR_TEXT_NAMES
Searches the names of variable texts in a symbol.
Syntax
SEARCH_SYMBOL_VAR_TEXT_NAMES refSymbol<:in> "filter"
arrayVarTextNames<:out>
Arguments

refSymbol
Reference to an existing symbol.

filter
Filter which text names should be searched. Use an ampersand '*' to
search for all names.

arrayVarTetNames
Name of the array which will receive the found var text names.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL refSymbol
SEARCH_DRW_VAR_TEXT_NAMES refSymbol "*" arrayAllVarTextNames
FOR varTextName REF ARRAY arrayAllVarTextNames
SET_SYMBOL_VAR_TEXT refSymbol varTextName "text line"
END_FOR
§
SEARCH_SYMBOL_GROUP_NAMES
Searches the names of groups in a symbol.
Syntax
SEARCH_SYMBOL_GROUP_NAMES refSymbol<:in> "filter"
arrayGroupNames<:out>
Arguments

refSymbol
Reference to an existing symbol.

filter
Filter which text names should be searched. Use an ampersand '*' to
search for all names.

arrayGroupNames
Name of the array which will receive the found group names.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL symbol
SEARCH_SYMBOL_GROUP_NAMES symbol "*" names
FOR name REF ARRAY names
GET_SYMBOL_GROUP_EXCLUSIVE symbol name exclusive
GET_SYMBOL_GROUP_SHOWN symbol name visible
PRINT "% % %" name exclusive visible
END_FOR
§
GET_SYMBOL_GROUP_SHOWN
Examines if a symbol group is visible or not.
Syntax
GET_SYMBOL_GROUP_SHOWN refSymbol<:in> "name" visible<:out>
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the group

visible
Name of the boolean parameter which receives the information if the
group is visible.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL symbol
SEARCH_SYMBOL_GROUP_NAMES symbol "*" names
FOR name REF ARRAY names
GET_SYMBOL_GROUP_EXCLUSIVE symbol name exclusive
GET_SYMBOL_GROUP_SHOWN symbol name visible
PRINT "% % %" name exclusive visible
END_FOR
§
SET_SYMBOL_GROUP_SHOWN
Sets a symbol group visible or not visible.
Syntax
SET_SYMBOL_GROUP_SHOWN refSymbol<:in> "name" visibleBOOL
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the group

visible
The boolean parameter determines if the group is shown or not.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL symbol
SEARCH_SYMBOL_GROUP_NAMES symbol "*" names
FOR name REF ARRAY names
SET_SYMBOL_GROUP_EXCLUSIVE symbol name TRUE
END_FOR
§
GET_SYMBOL_GROUP_EXCLUSIVE
Examines if a symbol group is exclusive or independent.
Syntax
GET_SYMBOL_GROUP_EXCLUSIVE refSymbol<:in> "name" exclusive<:out>
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the group

exclusive
Name of the boolean parameter which receives the information if the
group is exclusive.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL symbol
SEARCH_SYMBOL_GROUP_NAMES symbol "*" names
FOR name REF ARRAY names
GET_SYMBOL_GROUP_EXCLUSIVE symbol name exclusive
GET_SYMBOL_GROUP_SHOWN symbol name shown
PRINT "% % %" name exclusive shown
END_FOR
§
GET_SYMBOL_POS
Retrieves the position of a symbol.
Syntax
GET_SYMBOL_POS refSymbol<:in> pos<:out>
Arguments

refSymbol
Reference to an existing symbol.

pos
Structure variable of type POINT will receive the result.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL refSymbol
GET_SYMBOL_POS refSymbol pos
PRINT "location: % % %" pos.x pos.y pos.z
§
GET_SYMBOL_NAME
Retrieves the name of a symbol.
Syntax
GET_SYMBOL_NAME refSymbol<:in> paramName<:out>
Arguments

refSymbol
Reference to an existing symbol.

paramName
Parameter which receives the name information of the symbol.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL refSymbol
GET_SYMBOL_NAME refSymbol name
PRINT "Symbol name: %" name
§
PURGE_UNUSED_SYMBOLS
Purges symbols which are not used on the solid model. This command
requires Creo 4.0 M090 / Creo 5.0.4.0 or above.
Syntax
PURGE_UNUSED_SYMBOLS refMdl<:in>
Arguments

refMdl
Reference to the solid model for which the symbols should be purged.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
PURGE_UNUSED_SYMBOLS PART
§
About Commands for Geometric Tolerance Annotations
Commands for reading, modifying and creating geometric tolerances
annotations in solids and drawings.
The following commands are available:
CREATE_GTOL — to create a new geometric tolerance.
READ_GTOL — to read the definition of a geometric tolerance from
the annotation.
MODIFY_GTOL — to modify a geometric tolerance.
DELETE_GTOL — to delete a geometric tolerance.
CREATE_GTOL_CREO4 — to create a new geometric tolerance with the
new functionality in Creo 4.0 and above.
READ_GTOL_CREO4 — to read the definition of a geometric tolerance
with the new functionality in Creo 4.0 and above.
MODIFY_GTOL_CREO4 — to modify a geometric tolerance with the new
functionality in Creo 4.0 and above.
GET_GTOL_TEXT — to read the text of a geometric tolerance.
SET_GTOL_TEXT — to set the text of a geometric tolerance.
GET_GTOL_VALUE — to read the value of a geometric tolerance.
SET_GTOL_VALUE — to set the value of a geometric tolerance.
§
CREATE_GTOL
Creates a geometric tolerance in solids or drawings. This command
requires Pro/ENGINEER Wildfire 5 or above.
Syntax
CREATE_GTOL model gtol_data<:in> ref_gtol<:out>
Arguments

model
Model in which the gtol should be created. Models are specified in
the following manner.

gtol_data
Structure variable of type GTOL_DATA which contains the gtol
definition.

ref_gtol
Name of the reference which should receive the information about the
created gtol annotation.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
This functionality is based on the legacy pre-Creo 4.0 geometrical
tolerance functionality. Since the internal Creo API was removed in
Creo 9.0, it is now re-implemented on by a conversion. Therefore, it
is strongly recommended to replace it by CREATE_GTOL_CREO4.
Example
DECLARE_STRUCT GTOL_DATA gtol_data
gtol_data.type = "SURFACE"

GET_MDL_ANNOTATION_PLANE ASSEMBLY "FRONT"


gtol_data.mdl_refs.annotation_plane
gtol_data.mdl_refs.location.x = -50
gtol_data.mdl_refs.location.y = 100
gtol_data.mdl_refs.location.z = 0

USER_SELECT SURFACE gtol_data.mdl_refs.entity_ref


gtol_data.mdl_refs.placement_type = "LEADER"

DECLARE_STRUCT LEADER leader


USER_SELECT EDGE leader.placement_ref
ADD_ARRAY_ELEM gtol_data.mdl_refs.array_leaders leader

CREATE_GTOL target gtol_data gtol


§
READ_GTOL
Reads a geometric tolerance definition of solids or drawings. This
command requires Pro/ENGINEER Wildfire 5 or above.
Syntax
READ_GTOL ref_gtol<:in> gtol_data<:out>
Arguments

ref_gtol
Reference to an existing geometric tolerance.

gtol_data
Structure variable of type GTOL_DATA which receives the gtol
definition.
Error handling
The program execution will be canceled if the reference to the
geometric tolerance does not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
This functionality is based on the legacy pre-Creo 4.0 geometrical
tolerance functionality. Since the internal Creo API was removed in
Creo 9.0, it is now re-implemented on by a conversion. Therefore, it
is strongly recommended to replace it by READ_GTOL_CREO4.
Example
USER_SELECT GTOL gtol
READ_GTOL gtol gtol_data
PRINT "Type: %" gtol_data.type
§
MODIFY_GTOL
Modifies a geometric tolerance in solids or drawings. This command
requires Pro/ENGINEER Wildfire 5 or above.
Syntax
MODIFY_GTOL ref_gtol<:in> gtol_data<:in>
Arguments

ref_gtol
Reference to an existing geometric tolerance.

gtol_data
Structure variable of type GTOL_DATA which contains the gtol
definition.
Error handling
The program execution will be canceled if the reference to the
geometric tolerance does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
This functionality is based on the legacy pre-Creo 4.0 geometrical
tolerance functionality. Since the internal Creo API was removed in
Creo 9.0, it is now re-implemented on by a conversion. Therefore, it
is strongly recommended to replace it by MODIFY_GTOL_CREO4.
Example
USER_SELECT GTOL gtol
READ_GTOL gtol gtol_data
gtol_data.symbols.enable_statistical_tolerance = TRUE
gtol_data.tol_value.overall_tolerance_value = 0.01
MODIFY_GTOL gtol gtol_data
§
DELETE_GTOL
Deletes a geometric tolerance from a solids or a drawing. This
command requires Pro/ENGINEER Wildfire 5 or above.
Syntax
DELETE_GTOL ref_gtol<:in>
Arguments

ref_gtol
Reference to an existing geometric tolerance.
Error handling
The program execution will be canceled if the reference to the
geometric tolerance does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS mdl GTOL "*" allGtols

FOR gtol REF ARRAY allGtols


DELETE_GTOL gtol
END_FOR
§
CREATE_GTOL_CREO4
Creates a geometric tolerance in solids or drawings with the new
functionality in Creo 4.0 and above. This command requires Creo 4.0
or above.
Syntax
CREATE_GTOL_CREO4 model gtol_data<:in> ref_gtol<:out>
Arguments

model
Model in which the gtol should be created. Models are specified in
the following manner.

gtol_data
Structure variable of type GTOL_CREO4_DATA which contains the gtol
definition.

ref_gtol
Name of the reference which should receive the information about the
created gtol annotation.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_ANNOTATION_PLANE PART "TOP" annotation_plane

DECLARE_STRUCT GTOL_CREO4_DATA gtol_option


gtol_option.text.text_above = "above"

gtol_option.type = "LINE"
gtol_option.value = "0.02"

SEARCH_MDL_REFS PART SURFACE "*" gtol_option.array_references

! placement
gtol_option.placement.location.x = 100
gtol_option.placement.location.z = -100
gtol_option.placement.annotation_plane = annotation_plane

! search the references for the leaders


SEARCH_MDL_REF PART EDGE "EDGE_TOP" edgeTop
SEARCH_MDL_REF PART EDGE "EDGE_LEFT" edgeLeft

! use SET_REF_POS to indicate the edge position in model coordinates


DECLARE_STRUCT POINT pnt
pnt.x = 25
pnt.y = 0
pnt.z = 25

SET_REF_POS NULL edgeLeft pnt


SET_REF_POS NULL edgeTop pnt

gtol_option.placement.placement_type = "LEADERS"

DECLARE_STRUCT LEADER leader


leader.placement_ref = edgeLeft
ADD_ARRAY_ELEM gtol_option.placement.array_leaders leader
leader.placement_ref = edgeTop
ADD_ARRAY_ELEM gtol_option.placement.array_leaders leader

! datum references
DECLARE_STRUCT GTOL_CREO4_DATUM_REF datum_ref
datum_ref.value = "0.07"
datum_ref.primary = "A"
datum_ref.secondary = "B"
datum_ref.tertiary = "C"

ADD_ARRAY_ELEM gtol_option.array_datum_refs datum_ref

datum_ref.value = "0.03"
datum_ref.primary = ""
datum_ref.secondary = "X"
datum_ref.tertiary = ""

ADD_ARRAY_ELEM gtol_option.array_datum_refs datum_ref

gtol_option.share_datum_refs = TRUE

! indicators
DECLARE_STRUCT GTOL_CREO4_INDICATOR indicator
indicator.type = "DIRECTION_FEATURE"
indicator.symbol = "ANGULARITY"
indicator.datum = "A"
ADD_ARRAY_ELEM gtol_option.array_indicators indicator

! modifiers
gtol_option.modifiers.all_around = TRUE
gtol_option.modifiers.unilateral = TRUE
! text
gtol_option.text.text_above = "above"
gtol_option.text.align_text_above = "LEFT"
gtol_option.text.box_text_above = TRUE

gtol_option.text.text_below = "below"
gtol_option.text.align_text_below = "CENTER"

gtol_option.text.text_left = "left"

gtol_option.text.text_right = "right"

! create the gtol in the solid model


CREATE_GTOL_CREO4 PART gtol_option gtol

! Show the gtol also on the drawing


SEARCH_MDL_REF PART DRAWING "*" drw
SEARCH_DRW_VIEW drw "main_view" * view
SHOW_DRW_ANNOTATION view gtol
§
READ_GTOL_CREO4
Reads a geometric tolerance definition of solids or drawings with the
new functionality in Creo 4.0 and above. This command requires Creo
4.0 or above.
Syntax
READ_GTOL_CREO4 ref_gtol<:in> gtol_data<:out>
Arguments

ref_gtol
Reference to an existing geometric tolerance.

gtol_data
Structure variable of type GTOL_CREO4_DATA which receives the gtol
definition.
Error handling
The program execution will be canceled if the reference to the
geometric tolerance does not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT GTOL gtol

READ_GTOL_CREO4 gtol gtol_option

PRINT "type: %" gtol_option.type


PRINT "value: %" gtol_option.value

FOR reference REF ARRAY gtol_option.array_references


PRINT "%" reference
END_FOR

PRINT "placement_type: %" gtol_option.placement.placement_type


PRINT "placement_ref: %" gtol_option.placement.placement_ref
PRINT "location: %/%/%" gtol_option.placement.location.x
gtol_option.placement.location.y gtol_option.placement.location.z

PRINT "annotation_plane: %" gtol_option.placement.annotation_plane

FOR leader REF ARRAY gtol_option.placement.array_leaders


PRINT "--- leader ---"
PRINT "arrow_type: %" leader.arrow_type
PRINT "placement_ref: %" leader.placement_ref
END_FOR

PRINT "--- datum_refs ---"

FOR datum_ref REF ARRAY gtol_option.array_datum_refs


PRINT "--- datum_ref ---"
PRINT "value: %" datum_ref.value
PRINT "primary: %" datum_ref.primary
PRINT "secondary: %" datum_ref.secondary
PRINT "tertiary: %" datum_ref.tertiary
END_FOR
PRINT "share_datum_refs: %" gtol_option.share_datum_refs

FOR indicator REF ARRAY gtol_option.array_indicators


PRINT "--- indicator --"
PRINT "type: %" indicator.type
PRINT "symbol: %" indicator.symbol
PRINT "datum: %" indicator.datum
END_FOR

PRINT "--- modifiers ---"


PRINT "all_over: %" gtol_option.modifiers.all_over
PRINT "all_around: %" gtol_option.modifiers.all_around
PRINT "unilateral: %" gtol_option.modifiers.unilateral
PRINT "flip: %" gtol_option.modifiers.flip
PRINT "boundary: %" gtol_option.modifiers.boundary

PRINT "--- text ---"


PRINT "text_above: %" gtol_option.text.text_above
PRINT "align_text_above: %" gtol_option.text.align_text_above
PRINT "box_text_above: %" gtol_option.text.box_text_above
PRINT "text_below: %" gtol_option.text.text_below
PRINT "align_text_below: %" gtol_option.text.align_text_below
PRINT "box_text_below: %" gtol_option.text.box_text_below
PRINT "text_left: %" gtol_option.text.text_left
PRINT "text_right: %" gtol_option.text.text_right
§
MODIFY_GTOL_CREO4
Modifies a geometric tolerance in solids or drawings with the new
functionality in Creo 4.0 and above. This command requires Creo 4.0
or above.
Syntax
MODIFY_GTOL_CREO4 ref_gtol<:in> gtol_data<:in>
Arguments

ref_gtol
Reference to an existing geometric tolerance.

gtol_data
Structure variable of type GTOL_CREO4_DATA which contains the gtol
definition.
Error handling
The program execution will be canceled if the reference to the
geometric tolerance does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT GTOL gtol

READ_GTOL_CREO4 gtol gtol_option

! modify the value


gtol_option.value = 0.01

! modify leader arrows


GET_ARRAY_SIZE gtol_option.placement.array_leaders nLeaders
DECLARE_VARIABLE INTEGER n

n = 0
WHILE n < nLeaders

GET_ARRAY_ELEM gtol_option.placement.array_leaders n leader

leader.arrow_type = "DOUBLE_ARROW"

SET_ARRAY_ELEM gtol_option.placement.array_leaders n leader


n++
END_WHILE

! move gtol position


gtol_option.placement.location.x += 10

MODIFY_GTOL_CREO4 gtol gtol_option


§
GET_GTOL_TEXT
Reads the text of a geometric tolerance definition of solids or
drawings. This command requires Pro/ENGINEER Wildfire 5 or above.
Syntax
GET_GTOL_TEXT ref_gtol<:in> gtol_text<:out>
Arguments

ref_gtol
Reference to an existing geometric tolerance.

gtol_text
Structure variable of type GTOL_TEXT which receives the gtol text
definition.
Error handling
The program execution will be canceled if the reference to the
geometric tolerance does not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT GTOL gtol
GET_GTOL_TEXT gtol gtol_text
gtol_text.text_right = "right of the gtol"
SET_GTOL_TEXT gtol gtol_text
§
SET_GTOL_TEXT
Sets the text of a geometric tolerance in solids or drawings. This
command requires Pro/ENGINEER Wildfire 5 or above.
Syntax
SET_GTOL_TEXT ref_gtol<:in> gtol_text<:in>
Arguments

ref_gtol
Reference to an existing geometrical reference.

gtol_text
Structure variable of type GTOL_TEXT which contains the gtol
definition.
Error handling
The program execution will be canceled if the reference to the
geometric tolerance does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT GTOL gtol
GET_GTOL_TEXT gtol gtol_text
gtol_text.text_right = "right of the gtol"
SET_GTOL_TEXT gtol gtol_text
§
GET_GTOL_VALUE
Reads the value of a geometric tolerance in solids or drawings. This
command requires Creo Parametric 4.0 or above.
Syntax
GET_GTOL_VALUE ref_gtol<:in> value_text<:out>
Arguments

ref_gtol
Reference to an existing geometric tolerance.

value_text
Name of the variable of text string which will receive the value of
the geometric tolerance.
Error handling
The program execution will be canceled if the reference to the
geometric tolerance does not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT GTOL gtol
GET_GTOL_VALUE gtol value
PRINT "gtol_value: %" value
SET_GTOL_VALUE gtol "0.001"
§
SET_GTOL_VALUE
Sets the value of a geometric tolerance in solids or drawings. This
command requires Creo Parametric 4 or above.
Syntax
SET_GTOL_VALUE ref_gtol<:in> "value"
Arguments

ref_gtol
Reference to an existing geometrical reference.

value
String expression containing the value of the geometric tolerance.
Error handling
The program execution will be canceled if the reference to the
geometric tolerance does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT GTOL gtol
GET_GTOL_value gtol value
PRINT "gtol_value: %" value
SET_GTOL_VALUE gtol "0.001"
§
About Commands for Surface Finish Annotations
Commands for surface finishes in solids.
The following commands are available:
CREATE_SURFFINISH — to create a surface finish in a solid model.
READ_SURFFINISH — to retrieve the information from a surface finish
in a solid model.
MODIFY_SURFFINISH — to modify a surface finish in a solid model.
GET_SURFFINISH_VALUE — to retrieve the value from a surface
finish.
§
CREATE_SURFFINISH
Creates a surface finish in a solid model.
Syntax
CREATE_SURFFINISH model<:in> surffinish_option<:in>
refSurfFinish<:out>
Arguments

model
Reference to the model in which the surface finish should be created.

surffinishl_option
Structure variable of type SURFACE_FINISH which contains the
definition of the surface finish which includes the symbol
definition.

refSurfFinish
Name of the reference which should receive the information about the
created surface finish annotation.
Error handling
The program execution will be canceled if the model reference is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note
You can use custom surface finish symbols. To use the standard ones
from Creo, compose the path by reading the configuration of
pro_surface_finish_dir.
Example
DECLARE_STRUCT SURFACE_FINISH options

GET_CONFIG_OPTION "pro_surface_finish_dir" surfFinishDir

options.symbol_options.path = surfFinishDir +
"\\generic\\standard.sym"

options.symbol_options.placement_type = "FREE"
options.symbol_options.view_orientation = "FRONT"
options.symbol_options.flat_to_screen = FALSE

options.symbol_options.placement_type = "WITH_LEADER"
DECLARE_STRUCT ATTACH_LEADER aLeader
aLeader.placement_type = "ON_ENTITY"

USER_SELECT SURFACE PlacementReference


aLeader.placement_ref = PlacementReference
ADD_ARRAY_ELEM options.symbol_options.array_leaders aLeader

GET_REF_POS THIS PlacementReference aPos

options.symbol_options.placement_pos.x = aPos.x + 0
options.symbol_options.placement_pos.y = aPos.y + 15
options.symbol_options.placement_pos.z = aPos.z + 0

CREATE_SURFFINISH PlacementReference options surffin


§
READ_SURFFINISH
Retrieves the information from a surface finish in a solid model.
Syntax
READ_SURFFINISH refSurfFinish<:in> surffinish_option<:out>
Arguments

refSurfFinish
Existing reference to a surface finish

surffinishl_option
Name of the structure variable of type SURFACE_FINISH which receives
the definition of the surface finish which includes the symbol
definition.
Error handling
The program execution will be canceled if the surface finish
reference is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFFINISH surffin
READ_SURFFINISH surffin options
options.value = "44"
options.name = "new_surffinish"

USER_SELECT_MULTIPLE SURFACE -1 arraySurfaces

FOR surface REF ARRAY arraySurfaces


DECLARE_STRUCT ATTACH_LEADER aLeader
aLeader.placement_type = "ON_ENTITY"
aLeader.placement_ref = surface

ADD_ARRAY_ELEM options.symbol_options.array_leaders aLeader


END_FOR

MODIFY_SURFFINISH surffin options


§
MODIFY_SURFFINISH
Modifies the surface finish in a solid model.
Syntax
MODIFY_SURFFINISH refSurfFinish<:in> surffinish_option<:in>
Arguments

refSurfFinish
Existing reference to a surface finish

surffinishl_option
Structure variable of type SURFACE_FINISH which contains the
definition of the surface finish which includes the symbol
definition.
Error handling
The program execution will be canceled if the surface finish
reference is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
It is not possible to switch the existing symbol in the surface
finish to another one. Therefor changes in the symbol_options.path
member of SURFACE_FINISH are ignored.
Example
USER_SELECT SURFFINISH surffin
READ_SURFFINISH surffin options
options.value ="44"
options.name = "new_surffinish"

USER_SELECT_MULTIPLE SURFACE -1 arraySurfaces

FOR surface REF ARRAY arraySurfaces


DECLARE_STRUCT ATTACH_LEADER aLeader
aLeader.placement_type = "ON_ENTITY"
aLeader.placement_ref = surface

ADD_ARRAY_ELEM options.symbol_options.array_leaders aLeader


END_FOR

MODIFY_SURFFINISH surffin options


§
GET_SURFFINISH_VALUE
Retrieves the value from a surface finish created by a symbol from
the variable text in roughness_height. In case variable text does not
exists an error occurs.
Syntax
GET_SURFFINISH_VALUE refSurfFinish<:in> value<:out>
Arguments

refSurfFinish
Existing reference to a surface finish

value
Name of a variable of type DOUBLE to receive the value.
Error handling
The program execution will be canceled if the surface finish
reference is not existing or no variable text roughness_height is
available, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION surffin
BEGIN_CATCH_ERROR
GET_SURFFINISH_VALUE surffin value
END_CATCH_ERROR
PRINT "%" value
§
About Commands for Datum Tag Annotations
Commands for Datum tag annotations.
The following commands are available:
GET_DATUM_TAG_LABEL — to retrieve the label of a datum tag.
SET_DATUM_TAG_LABEL — to set the datum of a datum tag.
GET_DATUM_TAG_ATTACHMENT — to retrieve the attachment reference of
a datum tag.
§
GET_DATUM_TAG_LABEL
Retrieves the label of a datum tag. For the new Creo 4.0 datum tags
this is the label for legacy datum tags it is the name of the related
datum plane.
Syntax
GET_DATUM_TAG_LABEL refDatumTag<:in> label<:out>
Arguments

refDatumTag
Reference to an existing datum tag.

label
String variable which will receive the label.
Error handling
The program execution will be canceled if the reference to the datum
tag does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS PART DATUM_TAG "*" allDatumTags
FOR tag REF ARRAY allDatumTags
GET_DATUM_TAG_LABEL tag label
PRINT "Datum tag label: %" label
END_FOR
§
SET_DATUM_TAG_LABEL
Sets the label of a datum tag. For the new Creo 4.0 datum tags this
is the label, for legacy datum tags it is the name of the related
datum plane.
Syntax
SET_DATUM_TAG_LABEL refDatumTag<:in> "label"
Arguments

refDatumTag
Reference to an existing datum tag.

label
This is the text for the label. Any string expression is allowed.
Error handling
The program execution will be canceled if the reference to the label
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DATURM_TAG tag
SET_DATUM_TAG_LABEL tag "A"
§
GET_DATUM_TAG_ATTACHMENT
Retrieves the reference to the attachment of the datum tag.
Syntax
GET_DATUM_TAG_ATTACHMENT refDatumTag<:in> refAttachment<:out>
Arguments

refDatumTag
Reference to an existing datum tag.

refAttachment
Name of the reference which will receive the attachment reference of
the datum tag.
Error handling
The program execution will be canceled if the reference to the datum
tag does not exist or the attachment reference could not be
determined, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DATUM_TAG tag
GET_DATUM_TAG_ATTACHMENT tag refAttachment
About Commands for Model Visualization States
Commands for model operations. Commands for the following topics are
available:
Model Orientations — commands for creating, showing and analyzing
model orientations.
Model Simplified Representations — commands for modifying
simplified representations.
Model Cross Sections — to create, show and analyze cross sections.
Model Exploded States — to create and activate exploded states.
Model Layer States — commands for creating and showing layer
states.
Model Combined Views — commands for creating and showing combined
views.
About Commands for Model Orientations
The following commands are available to create, set and analyze model
orientations:
CREATE_ORIENTATION — to orient a model and save the view.
SET_ORIENTATION — to set the current view of a model.
SET_ORIENTATION_BY_REF — to set the current view of a model by
specifying orientation references.
GET_ORIENTATION_MATRIX — to retrieve a named view or the current
view of a model and store the value as a matrix.
SET_ORIENTATION_MATRIX — to set the current view of a model by a
matrix.
CREATE_ORIENTATION_MATRIX — to create an orientation from by
matrix.
GET_NAMED_ORIENTATIONS — to retrieve the names of existing
orientations from a model.
DELETE_ORIENTATION — to delete one or many orientations from a
solid model.
SET_ORIENTATION_NAME — to rename an orientation of a solid model.
ZOOM_TO_REF — to zoom to a reference in the current model on the
screen.
ZOOM_TO_POS — to zoom to a position in the current model on the
screen.
GET_ZOOM_POS — to retrieve center point and zoom factor of the
current model on the screen.
CREATE_ORIENTATION
Creates orientation of parts and assemblies and saves it as a view.
Syntax
CREATE_ORIENTATION model reference_face1<:in> orient1
reference_face2<:in> orient2 "view_name"
Arguments

model
Existing reference for a model.

reference_face1
Existing reference to first surface or datum plane.

orient1
Determines orientation for refFace1. This could be on of the
following: FRONT, BACK, TOP, BOTTOM, LEFT, RIGHT.

reference_face2
Existing reference to second surface or datum plane.

orient2
Determines orientation for refFace2. This could be on of the
following: FRONT, BACK, TOP, BOTTOM, LEFT, RIGHT.

view_name
Name of the view which should be created. Any string expression is
allowed.
Error handling
The program execution will be canceled if model or references are not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS PLANE XY XY
SEARCH_MDL_REF THIS PLANE XZ XZ
SEARCH_MDL_REF THIS PLANE YZ YZ
CREATE_ORIENTATION THIS XZ TOP XY FRONT FRONT
CREATE_ORIENTATION THIS XZ TOP XY BACK BACK
CREATE_ORIENTATION THIS XZ FRONT XY BOTTOM TOP
CREATE_ORIENTATION THIS XZ BACK XY TOP BOTTOM
CREATE_ORIENTATION THIS XZ TOP XY RIGHT LEFT
CREATE_ORIENTATION THIS XZ TOP XY LEFT RIGHT
SET_ORIENTATION
Sets the current view of a model by specifying its name.
Syntax
SET_ORIENTATION model "view_name"
Arguments

model
Existing reference for a model.

view_name
Name of the view which should be set. Any string expression is
allowed.
Error handling
The program execution will be canceled if model or the view name does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_ORIENTATION THIS "MAIN"
SET_ORIENTATION_BY_REF
Sets the current view of a model by specifying its orientation
references.
Syntax
SET_ORIENTATION_BY_REF model reference_face1<:in> orient1
reference_face2<:in> orient2
Arguments

model
Existing reference for a model.

reference_face1
Existing reference to first surface or datum plane.

orient1
Determines orientation for refFace1. This could be on of the
following: FRONT, BACK, TOP, BOTTOM, LEFT, RIGHT.

reference_face2
Existing reference to second surface or datum plane.

orient2
Determines orientation for refFace2. This could be on of the
following: FRONT, BACK, TOP, BOTTOM, LEFT, RIGHT.
Error handling
The program execution will be canceled if model or the view name does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS PLANE XY XY
SEARCH_MDL_REF THIS PLANE XZ XZ
SET_ORIENTATION_BY_REF THIS XZ TOP XY FRONT
§
GET_ORIENTATION_MATRIX
Retrieves a named view or the current view of a model and stores the
value as a matrix.
Syntax
GET_ORIENTATION_MATRIX model [options] matrix<:out>
Arguments

model
Existing reference for a model.

options
The following options are supported:
VIEW_NAME "name" — to search for a view by name. In case the name
is not found or the option is not used, the current view will be
used.

matrix
Structure variable of type MATRIX.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_ORIENTATION_MATRIX THIS matrix
CREATE_ORIENTATION_MATRIX THIS matrix "CURRENT"
§
SET_ORIENTATION_MATRIX
Sets the current view of a model by specifying its orientation
matrix.
Syntax
SET_ORIENTATION_MATRIX model matrix<:in>
Arguments

model
Existing reference for a model.

matrix
Structure variable of type MATRIX.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_STRUCT MATRIX matrixOrient
matrixOrient.m11 = 1
matrixOrient.m12 = 0
matrixOrient.m13 = 0
matrixOrient.m21 = 0
matrixOrient.m22 = 1
matrixOrient.m23 = 0
matrixOrient.m31 = 0
matrixOrient.m32 = 0
matrixOrient.m33 = 1
SET_ORIENTATION_MATRIX THIS matrix
§
CREATE_ORIENTATION_MATRIX
Creates orientation by matrix and saves it as a view.
Syntax
CREATE_ORIENTATION_MATRIX model matrix<:in> "view_name"
Arguments

model
Existing reference for a model.

matrix
Structure variable of type MATRIX.

view_name
Name of the view which should be created. Any string expression is
allowed.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_ORIENTATION_MATRIX THIS matrix
CREATE_ORIENTATION_MATRIX THIS matrix "CURRENT"
§
GET_NAMED_ORIENTATIONS
Retrieves the names of existing orientations from a model.
Syntax
GET_NAMED_ORIENTATIONS model "filter" arrayNames<:out>
Arguments

model
Existing reference for a model.

filter
Filter for the orientations. Use "*" or an empty string to retrieve
all orientations. All string expressions are allowed.

arrayNames
Name of the array which will receive the orientation names.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_NAMED_ORIENTATIONS ASSEMBLY "" arrayOrientations
FOR orientation REF ARRAY arrayOrientations
PRINT "%" orientation
END_FOR
§
DELETE_ORIENTATION
Deletes one or many orientations from a solid model. This command is
available since Creo 3.0 M140 / Creo 4.0 M020 and above.
Syntax
DELETE_ORIENTATION model "name"
Arguments

model
Existing reference for a model.

name
Name of the orientation which should be deleted. In case of using
wildcard characters "*" multiple orientation could be deleted. All
string expressions are allowed.
Error handling
The program execution will be canceled if the model or the
orientation do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
DELETE_ORIENTATION PART "*"
§
SET_ORIENTATION_NAME
Renames an orientation of a solid model. This command is available
since Creo 3.0 M140 / Creo 4.0 M020 and above.
Syntax
SET_ORIENTATION_NAME model "orientation" "new_name"
Arguments

model
Existing reference for a model.

orientation
Name of the orientation which should be renamed. All string
expressions are allowed.
Error handling
The program execution will be canceled if the model or the
orientation do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_ORIENTATION_NAME PART "FRONT" "VORNE"
§
ZOOM_TO_REF
Zooms to a reference in the current model on the screen.
Syntax
ZOOM_TO_REF model reference<:in> zoom_factorDOUBLE
Arguments

model
Existing reference for a model.

reference
reference to which to zoom.

zoom_factor
Factor which is used to zoom in. In case the zoom factor is <= 0, it
will be calculated in a way that the complete model fits on the
screen.
Error handling
The program execution will be canceled if the model or the reference
do not exist or if the zooming fails, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF ASSEMBLY POINT "*" firstPoint
ZOOM_TO_REF ASSEMBLY firstPoint 1
§
ZOOM_TO_POS
Zooms to a position in the current model on the screen.
Syntax
ZOOM_TO_POS model pos<:in> zoom_factorDOUBLE
Arguments

model
Existing reference for a model.

pos
Structure variable of type POINT to specify the position.

zoom_factor
Factor which is used to zoom in. In case the zoom factor is <= 0, it
will be calculated in a way that the complete model fits on the
screen.
Error handling
The program execution will be canceled if the model does not exist or
if the zooming fails, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_STRUCT POINT pnt
pnt.x = 100
pnt.y = 0
pnt.z = 0
ZOOM_TO_POS ASSEMBLY pnt 1
§
GET_ZOOM_POS
Retrieves the zoom factor and center position of current model on the
screen.
Syntax
GET_ZOOM_POS model pos<:out> zoom_factor<:out>
Arguments

model
Existing reference for a model.

pos
Structure variable of type POINT to retrieve the position.

zoom_factor
Variable of type DOUBLE to retrieve the zoom factor.
Error handling
The program execution will be canceled if the model does not exist or
if the calculation fails, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_ZOOM_POS ASSEMBLY pnt factor
PRINT "center point: %/%/%" pnt.x pnt.y pnt.z
PRINT "zoom factor: %" factor
About Commands for Model Simplified Representations
Commands to activate or modify simplified representations. Most of
the functions are limited to assemblies and do not work for parts.
See in the detailed description of each function for more details on
that.
The following commands are available:
CREATE_SIMPREP — to create a new simplified representation.
GET_SIMPREP_DEFAULT_ACTION — to determine the default action of an
existing simplified representation.
SET_SIMPREP_DEFAULT_ACTION — to set the default action of an
existing simplified representation.
EXCLUDE_FROM_SIMPREP — to exclude a component from a simplified
representation.
INCLUDE_TO_SIMPREP — to include a component in a simplified
representation.
SUBSTITUTE_SIMPREP — to substitute a simplified representation of a
component.
ACTIVATE_SIMPREP — to activate a specified simplified
representation.
GET_ACTIVE_SIMPREP — to retrieve information about the active
simplified representation.
SET_SIMPREP_NAME — to rename a simplified representation.
SEARCH_CUSTOM_SIMPREP — to search for a custom simplified
representation.
SEARCH_CUSTOM_SIMPREPS — to search for an array of custom
simplified representations.
REMOVE_SIMPREPS — to remove custom simplified representations.
CREATE_SIMPREP
Creates a new simplified representation of a model. This works for
parts and assemblies.
Syntax
CREATE_SIMPREP model "default_action" "simprep"
Arguments

model
Model to be specified.

default_action
Default representation action to be used for the simplified
representation.

simprep
Name for the simplified representation. Any string expression is
allowed.
Example
SEARCH_MDL_REF THIS COMPONENT "SCREW" screw
CREATE_SIMPREP THIS INCLUDE "with_details"
INCLUDE_TO_SIMPREP THIS "with_details" screw
GET_SIMPREP_DEFAULT_ACTION
Determines the default action of an existing simplified
representation.
Syntax
GET_SIMPREP_DEFAULT_ACTION model "simprep" default_action
Arguments

model
Model to be specified.

simprep
Name for the simplified representation. Any string expression is
allowed.

default_action
Name of the string variable which receives the information about the
default representation action.
Example
GET_SIMPREP_DEFAULT_ACTION PART "with_details" default_action
SET_SIMPREP_DEFAULT_ACTION
Ses the default action for an existing simplified representation.
Syntax
SET_SIMPREP_DEFAULT_ACTION model "simprep" "default_action"
Arguments

model
Model to be specified.

simprep
Name for the simplified representation. Any string expression is
allowed.

default_action
Default representation action to be used for the simplified
representation.
Example
SET_SIMPREP_DEFAULT_ACTION PART "with_details" INCLUDE
EXCLUDE_FROM_SIMPREP
Exclude component from simplified representation. This works only for
assemblies, but not for parts.
Syntax
EXCLUDE_FROM_SIMPREP model_owner simp_rep model_comp<:in> |
array_model_comp<:in>
Arguments

model_owner
Model which contains the simplified representation according to model
specification.

simp_rep
Simplified representation by name.

model_comp | array_model_comp
Model or array of models which are excluded from a simplified
representation according to model specification.
Error handling
The program execution will be canceled if the owner or the component
model was not found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS COMPONENT "SCREW" screw
EXCLUDE_FROM_SIMPREP THIS "no_details" screw
INCLUDE_TO_SIMPREP
Include a component in a simplified representation. This works only
for assemblies, but not for parts.
Syntax
INCLUDE_TO_SIMPREP model_owner simp_rep model_comp<:in> |
array_model_comp<:in>
Arguments

model_owner
Model which contains the simplified representation according to model
specification.

simp_rep
Simplified representation by name.

model_comp | array_model_comp
Model or array of models which are excluded from a simplified
representation according to model specification.
Error handling
The program execution will be canceled if the owner or the component
model was not found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS COMPONENT "SCREW" screw
INCLUDE_TO_SIMPREP THIS "with_details" screw
SUBSTITUTE_SIMPREP
Substitutes a simplified representation of a component. This works
only for assemblies, but not for parts.
Syntax
SUBSTITUTE_SIMPREP model_owner simprep_owner model_component
simprep_component
Arguments

model_owner
Assembly which contains the simplified representation according to
model specification.

simprep_owner
Simplified representation of the assembly which should be modified.

model_component
Model for which the simplified representation is substituted
according to model specification.

simprep_component
Simplified representation of the component which should be used.
Error handling
The program execution will be canceled if the owner or the component
model was not found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS COMPONENT "SCREW" screw
SUBSTITUTE_SIMPREP THIS "no_details" screw "no_thread"
ACTIVATE_SIMPREP
Activates a simplified representation of a model. This works only for
assemblies, but not for parts.
Syntax
ACTIVATE_SIMPREP [option] model "simprep"
Arguments

option
The following options are supported:
FORCE — activates the simplified representation by use of a mapkey.
This option only has effect in case the model is the current model
on the screen.

model
Model to be specified.

simprep
Specifies simplified representation by name or by keyword.
Example
ACTIVATE_SIMPREP THIS "my_simprep"
ACTIVATE_SIMPREP ASSEMBLY MASTER
GET_ACTIVE_SIMPREP
Retrieves information about the active simplified representation of a
model.
Syntax
GET_ACTIVE_SIMPREP model paramSimprep<:out>
Arguments

model
Model to be specified.

paramSimprep
Name of the variable which will receive the information about the
active simplified representation.
Example
GET_ACTIVE_SIMPREP THIS simprep
PRINT "%" simprep
SET_SIMPREP_NAME
Renames a simplified representation of a model. This works only for
assemblies, but not for parts.
Syntax
SET_SIMPREP_NAME model simprep "name"
Arguments

model
Model to be specified.

simprep
Specifies simplified representation by name or by keyword.

name
New name for the simplified representation. Any string expression is
allowed.
Error handling
The program execution will be canceled if the model or the simplified
representation was not found or if it could not be renamed, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
SET_SIMPREP_NAME THIS "my_simprep" "main_rep"
SEARCH_CUSTOM_SIMPREP
Searches a model for a custom simplified representation.
Syntax
SEARCH_CUSTOM_SIMPREP model "search_name" paramSimprep<:out>
Arguments

model
Model to be specified.

search_name
Search name for the simplified representation. Any string expression
is are allowed and wildcards can be used.

paramSimprep
Name of the variable which will receive the information about the
found simplified representation.

Error handling
The program execution will be canceled if the model or the simplified
representation was not found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_CUSTOM_SIMPREP THIS "A*" simprep
REMOVE_SIMPREPS simprep
SEARCH_CUSTOM_SIMPREPS
Searches a model for an array of custom simplified representations.
Syntax
SEARCH_CUSTOM_SIMPREPS model "search_name" arraySimpreps<:out>
Arguments

model
Model to be specified.

search_name
Search name for the simplified representation. Any string expression
is are allowed and wildcards can be used.

arraySimprep
Name of the array of strings which will receive the information about
the found simplified representations.

Error handling
The program execution will be canceled if the model was not found,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_CUSTOM_SIMPREPS ASSEMBLY "*" arrayReps
FOR rep REF ARRAY arrayReps
PRINT "%" rep
END_FOR
REMOVE_SIMPREPS ASSEMBLY arrayReps
REMOVE_SIMPREPS
Removes one or an array of simplified representations.
Syntax
REMOVE_SIMPREPS model "simprep_name" | arraySimprepNames
Arguments

model
Model to be specified.

simprep_name | arraySimprepName
Name of the custom simplified representation which should be deleted
or an array of names. Any string expression is are allowed and
wildcards can be used.

Error handling
The program execution will be canceled if the model was not found,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_CUSTOM_SIMPREP THIS "A*" simprep
REMOVE_SIMPREPS simprep
About Commands for Model Styles
Commands to activate or search for styles.
The following commands are available:
ACTIVATE_STYLE — to activate a specified style.
GET_ACTIVE_STYLE — to retrieve information about the active style.
SEARCH_CUSTOM_STYLE — to search for a custom style.
SEARCH_CUSTOM_STYLES — to search for an array of custom styles.
ACTIVATE_STYLE
Activates a style of a model.
Syntax
ACTIVATE_STYLE model "style"
Arguments

model
Model to be specified.

style
Specifies style by name or by keyword.
Example
ACTIVATE_STYLE THIS "my_style"
ACTIVATE_STYLE ASSEMBLY "MASTER"
GET_ACTIVE_STYLE
Retrieves information about the active style of a model.
Syntax
GET_ACTIVE_STYLE model style<:out>
Arguments

model
Model to be specified.

style
Name of the variable which will receive the name of the active style.
Example
GET_ACTIVE_STYLE THIS style
PRINT "%" style
SEARCH_CUSTOM_STYLE
Searches a model for a custom style.
Syntax
SEARCH_CUSTOM_STYLE model "search_name" style<:out>
Arguments

model
Model to be specified.

search_name
Search name for the style. Any string expression is are allowed and
wildcards can be used.

style
Name of the variable which will receive the information about the
found style.

Error handling
The program execution will be canceled if the model or the style was
not found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_CUSTOM_STYLE THIS "A*" style
ACTIVATE_STYLE THIS style
SEARCH_CUSTOM_STYLES
Searches a model for an array of custom styles.
Syntax
SEARCH_CUSTOM_STYLES model "search_name" arrayStyles<:out>
Arguments

model
Model to be specified.

search_name
Search name for the style. Any string expression is are allowed and
wildcards can be used.

arrayStyles
Name of the array of strings which will receive the information about
the found styles.

Error handling
The program execution will be canceled if the model was not found,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_CUSTOM_STYLES ASSEMBLY "*" arrayStyles
FOR style REF ARRAY arrayStyles
PRINT "%" style
END_FOR
REMOVE_SIMPREPS ASSEMBLY arrayReps
§
About Commands for Model Cross Sections
Commands for cross sections in parts and assemblies.
The following commands are available:
CREATE_XSEC — to create a planar cross section by use of a datum
plane.
CREATE_XSEC_EX — to create a planar cross section by use of a datum
and define the intersected models.
READ_XSEC_EX — to read the definition of a planar cross section.
GET_XSEC — to retrieve a cross section from a solid model.
GET_XSECS — to retrieve cross sections from a solid model.
DELETE_XSEC — to delete a cross section from a solid model.
SET_XSEC_NAME — to set the name of an existing cross section.
ACTIVATE_XSEC — to activate a cross section of the current model.
DEACTIVATE_XSEC — to deactivate all cross sections of the current
model.
DISPLAY_XSEC — to set the visibility status of a cross section of
the current model.
GET_XSEC_PROPERTIES — to calculate cross section properties of
planar sections.
GET_XSEC_TYPE — to retrieve the type of a cross section.
§
CREATE_XSEC
Creates a planar cross section based on a reference to a datum plane.
Syntax
CREATE_XSEC reference_plane<:in> ["name"]
Arguments

reference_plane
Name of an existing reference to a datum plane.

name
Optional name of the cross section. Any string expression is
allowed.
Error handling
The program execution will be canceled if the reference is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT PLANE sectionPlane
CREATE_XSEC sectionPlane
§
CREATE_XSEC_EX
Creates a planar cross section based on a reference to a datum plane,
coordinate system or coordinate system axis and define the
intersected models. This command is only available for Creo 2.0 and
above.
Syntax
CREATE_XSEC_EX model<:in> reference<:in> "name" xsec_options<:in>
refXSec<:out>
Arguments

model
Model in which the cross section should be created.

reference
Name of an existing reference to a datum plane, a coordinate system
or an coordinate system axis.

name
Name of the cross section. Use an empty string for the default name.
Any string expression is allowed.

xsec_options
Structure variable of type XSEC_OPTION to define the cross section.

refXSec
Name for the variable which should receive a reference to the created
cross section.
Error handling
The program execution will be canceled if the reference to the model
or to the datum does not exist or if the cross section could not be
created, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Since Creo 4.0 M140 / Creo 6.0 M040 / Creo 7.0.2.0 and above some API
was deprecated by PTC and therefor coordinate systems or coordinate
system axis can no longer be used as a reference.
Example
USER_SELECT PLANE | CSYS | CSYS_AXIS sel

DECLARE_STRUCT XSEC_OPTION options


options.include_quilts = FALSE
options.model_option = "EXCLUDE_SELECTED"
options.axis = "AXIS_Y"
options.offset = 0.0;
options.use_offset = FALSE
options.flip = FALSE

USER_SELECT_MULTIPLE MODEL -1 options.models


CREATE_XSEC_EX THIS sel "test" options refXsec
ACTIVATE_XSEC refXsec
§
READ_XSEC_EX
Reads the definition of an existing planar cross section.
Syntax
READ_XSEC_EX refXSec<:in> xsec_options<:out>
Arguments

refXSec
Existing reference to the cross sections.

xsec_options
Structure variable of type XSEC_OPTION to receive the definition of
the cross section.
Error handling
The program execution will be canceled if the reference to the cross
section does not exist or if the definition could not be read, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
GET_XSEC ASSEMBLY "TEST" xsec

READ_XSEC_EX xsec xsec_option

PRINT "use_offset: %" xsec_option.use_offset


PRINT "offset: %" xsec_option.offset
PRINT "axis: %" xsec_option.axis
PRINT "model_option: %" xsec_option.model_option

FOR mdl REF ARRAY xsec_option.models


PRINT "%" mdl
END_FOR

PRINT "include_quilts: %" xsec_option.include_quilts


PRINT "flip: %" xsec_option.flip
PRINT "ref_section: %" xsec_option.ref_section
§
GET_XSEC
Retrieve a cross section from a solid model. This command is only
available for Creo 2.0 and above.
Syntax
GET_XSEC model<:in> "name" refXsec<:out>
Arguments

model
Model in which the cross section should be created.

name
Name of the cross section. Any string expression is allowed.

refXSec
Name of the variable which receive a reference to the cross section.
Error handling
The program execution will be canceled if the reference to the model
does not exist or the cross section could not be found, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
GET_XSEC PART "XSEC0001" refXsec
DELETE_XSEC refXsec
§
GET_XSECS
Retrieve cross sections from a solid model. This command is only
available for Creo 2.0 and above.
Syntax
GET_XSECS model<:in> "name" arrayRefXsec<:out>
Arguments

model
Model in which the cross section should be created.

name
Name of the cross section. Any string expression is allowed.

arrayRefXSec
Name of the array which will receive the cross section references.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_XSECS PART "*" arrayXsecs
FOR xsec REF ARRAY arrayXsecs
DELETE_XSEC xsec
END_FOR
§
DELETE_XSEC
Deletes a cross sections from a solid model. This command is only
available for Creo 2.0 and above.
Syntax
DELETE_XSECS refXsec<:in>
Arguments

refXSec
Reference to the cross section which will be deleted.
Error handling
The program execution will be canceled if the reference to the cross
section does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_XSECS PART "*" arrayXsecs
FOR xsec REF ARRAY arrayXsecs
DELETE_XSEC xsec
END_FOR
§
SET_XSEC_NAME
Sets the name of an existing cross section.
Syntax
SET_XSEC_NAME refXsec<:in> "name"
Arguments

refXSec
Reference to the cross section which will be renamed.

name
New name for the cross section. Any string expression is allowed.
Error handling
The program execution will be canceled if the reference to the cross
section does not exist or it could not be renamed, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
GET_XSEC PART "xsec0001" xsec
BEGIN_CATCH_ERROR
SET_XSEC_NAME xsec "MyXsec"
END_CATCH_ERROR
§
ACTIVATE_XSEC
Activates a cross section of the current model by its name or by
reference.
Syntax
ACTIVATE_XSEC refXsec | "name"
Arguments

refXSec | name
Reference to the cross section feature or name of the cross section.
Any string expression is allowed.
Note
The command works with a mapkey therefor it only operates on the
current model and occurring errors will not be reported.
Example
ACTIVATE_XSEC "sample"
§
DEACTIVATE_XSEC
Deactivates the cross sections of the current model.
Syntax
DEACTIVATE_XSEC [refXsec]

refXSec
Optional reference to the cross section.
Note
The command works with a mapkey therefor it only operates on the
current model and occurring errors will not be reported.
Example
DEACTIVATE_XSEC
§
DISPLAY_XSEC
Sets the visibility status of a cross section of the current model.
Syntax
DISPLAY_XSEC refXsec | "name" stateBOOL
Arguments

refXSec | name
Reference to the cross section feature or name of the cross section.
Any string expression is allowed.

state
Boolean parameter determines if the cross section should be displayed
or not.
Note
The command works with a mapkey therefor it only operates on the
current model and occurring errors will not be reported.
Example
DISPLAY_XSEC "sample" TRUE
§
GET_ACTIVE_XSEC
Determines the active cross sections from a solid model. This command
is only available for Creo 4.0 M080, Creo 5.0.3.0, Creo 6.0.0.0 and
above.
Syntax
GET_ACTIVE_XSEC model<:in> refXsec<:out>
Arguments

model
Model from which the active cross section should be determined.

refXSec
Reference to the active cross section.
Error handling
The program execution will be canceled if the model does not exist or
the active cross section could not be determined, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
RETRIEVE_MDL "sample.prt" mdl

BEGIN_CATCH_ERROR
GET_ACTIVE_XSEC mdl xsec
END_CATCH_ERROR

PRINT "%" xsec


§
GET_XSEC_PROPERTIES
Calculates the cross section properties of a planar section similar
to Analysis > Model > X-Section Mass Properties. In case the
coordinate system is from another model, a temporary one will be
created for the measurement.
Syntax
GET_XSEC_PROPERTIES [options] model "name" reference_csys<:in>
mass_properties<:out>
Arguments

options
The following options are supported:
ONLY_TRANSLATION_INVARIANT valueBOOL — to limit the calculation to
the translation invariant properties volume, surface_area, density,
mass and center_of_gravity in order to avoid the creation of a
temporary coordinate system. Default is FALSE.

model
Model from which the mass properties should be calculated according
model specification.

name
Name of the planar cross section. Any string expression is allowed.
The names can also be specified by using wildcards.

reference_csys
The coordinate system which is used for the calculation. If NULL is
specified the default coordinate system will be used.

mass_properties
Structure variable of type MASS_PROPERTIES which receives the
calculate result.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_XSEC_PROPERITES THIS "SAMPLE" NULL mass
PRINT "Volume: % surface area: %" mass.volume mass.surface_area
PRINT "Center of gravity (% % %)" mass.center_of_gravity.x
mass.center_of_gravity.y mass.center_of_gravity.z
§
GET_XSEC_TYPE
Retrieves the type of a cross section.
Syntax
GET_XSEC_TYPE model "name" type<:out>
Arguments

model
Model from which the cross section types should be determined
according model specification.

name
Name of the cross section. Any string expression is allowed. The
names can also be specified by using wildcards.

type
Name of the variable which will receive the cross section type. The
following types are available:
PLANAR
OFFSET
PATTERN
Error handling
The program execution will be canceled if the model or the cross
section are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_XSEC_TYPE PART name type
PRINT "%" type
About Commands for Model Layer States
Commands for layer states in parts and assemblies. All commands
require Creo Parametric 2.0 and above.
The following commands are available:
CREATE_LAYER_STATE — to create a layer state.
GET_LAYER_STATES — to retrieve the names of the layer states.
REMOVE_LAYER_STATE — to remove layer states from a model.
ACTIVATE_LAYER_STATE — to activate a layer state in a model.
SAVE_LAYER_STATE — to a layer state in a model.
GET_ACTIVE_LAYER_STATE — to detect the active layer state.
GET_LAYER_STATE_LAYERS — to get retrieve the names of all layers in
a layer state.
GET_LAYER_STATE_LAYER_STATUS — to retrieve the status of a layer in
a layer state.
SET_LAYER_STATE_LAYER_STATUS — to set the status of a layer in a
layer state.
REMOVE_LAYER_STATE_LAYER — to remove layers from a layer state.
GET_LAYER_STATE_HIDDEN_REFS — to retrieve all references which are
hidden by a layer state.
SET_LAYER_STATE_REF_STATUS — to add or remove references to and
from a layer state.
§
CREATE_LAYER_STATE
Creates a layer state in a solid model. This command requires Creo
Parametric 2.0 or above.
Syntax
CREATE_LAYER_STATE model "layer_state"
Arguments

model
Model in which the layer state should be created according model
specification.

layer_state
Name of the layer state. Any string expression is allowed.
Error handling
The program execution will be canceled if the model could not be
found or the layer state was not created, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
CREATE_LAYER_STATE ASSEMBLY "my_layer_state"
§
GET_LAYER_STATES
Retrieves the names of the layer states of a solid model. This
command requires Creo Parametric 2.0 or above.
Syntax
GET_LAYER_STATES model arrayLayerStates<:out>
Arguments

model
Model in which the layer state should be searched according model
specification.

arrayLayerStates
Name of the variable of type array which receives the layer state
names.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_LAYER_STATES PART allLayerStates
FOR layer_state REF ARRAY allLayerStates
PRINT "%" layer_state
END_FOR
§
REMOVE_LAYER_STATE
Removes layer states from a solid model. This command requires Creo
Parametric 2.0 or above.
Syntax
REMOVE_LAYER_STATE model "layer_state"
Arguments

model
Model in which the layer state should be removed according model
specification.

layer_steate
Name of the layer state to remove. Any string expression is allowed
and wildcards can be used.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Note
When using wildcards, this command works on all layer state which are
matching the name description. The command will also not fail, if no
layer state is found.
Example
REMOVE_LAYER_STATE PART "*"
§
ACTIVATE_LAYER_STATE
Activates a layer state in a solid model. This command requires Creo
Parametric 2.0 or above.
Syntax
ACTIVATE_LAYER_STATE model "layer_state"
Arguments

model
Model in which the layer state should be activated according model
specification.

layer_state
Name of the layer state to activate. Any string expression is allowed
and wildcards can be used.
Error handling
The program execution will be canceled if the model or the layer
state could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Layer states could only be activated in the current model on the
screen. In case the layer state of another model should be activated,
it will temporarily appear in an accessory window in order to
activate the layer state. Use an empty string to de-active a layer
state.
Example
ACTIVATE_LAYER_STATE PART "my_layer_state"
§
SAVE_LAYER_STATE
Saves a layer state in a solid model. This command requires Creo
Parametric 2.0 or above. For Creo 2.0 before M170 and Creo 3.0 before
M050, the command will not cause an error, but also not save the
layer state.
Syntax
SAVE_LAYER_STATE model "layer_state"
Arguments

model
Model in which the layer state should be saved according model
specification.

layer_state
Name of the layer state to save. Any string expression is allowed and
wildcards can be used.
Error handling
The program execution will be canceled if the model or the layer
state could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Layer states could only be save in the current model on the screen.
In case the layer state of another model should be activated, it will
temporarily appear in an accessory window in order to activate the
layer state.
Example
SAVE_LAYER_STATE PART "my_layer_state"
§
GET_ACTIVE_LAYER_STATE
Detects the active layer state. This command requires Creo Parametric
2.0 or above.
Syntax
ACTIVATE_LAYER_STATE model name<:out>
Arguments

model
Model for which the active layer state is detected according model
specification.

name
Name of the variable of type string which will receive the
information of the active layer state.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case no layer state is active, the result will be an empty string.
Example
GET_ACTIVE_LAYER_STATE PART active_state
PRINT "state: %" active_state
§
GET_LAYER_STATE_LAYERS
Retrieves the names of all layers in a layer state. This command
requires Creo Parametric 2.0 or above.
Syntax
GET_LAYER_STATE_LAYERS model "layer_state" arrayLayers<:out>
Arguments

model
Model in which the layer state should be retrieved according model
specification.

layer_state
Name of the layer state. Any string expression is allowed and
wildcards can be used.

arrayLayers
Name of the variable of type array which receives the layer state
names.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_ACTIVE_LAYER_STATE PART state
GET_LAYER_STATE_LAYERS PART state allLayers
FOR layer REF ARRAY allLayers
PRINT "%" layer
END_FOR
§
GET_LAYER_STATE_LAYER_STATUS
Retrieves the layer visibility information in a layer state. This
command requires Creo Parametric 2.0 or above.
Syntax
GET_LAYER_STATE_LAYER_STATUS model "layer_state" "layer"
visibility<:out>
Arguments

model
Model in which the visibility state should be retrieved according
model specification.

layer_state
Name of the layer state. Any string expression is allowed and
wildcards can be used.

layer
Name of the layer. Any string expression is allowed and wildcards can
be used.

visibility
Name of the output variable which receives the layer status as a
string variable.
DISPLAY—layer is displayed.
BLANK—layer is blanked.
ISOLATE—layer is isolated.
HIDDEN_LINE—layer shows components in hidden line display.
Error handling
The program execution will be canceled if the model, the layer state
or the layer could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_LAYER_STATE_LAYER_STATUS PART "my_layer_state" "00-Datums" status
PRINT "%" status
§
SET_LAYER_STATE_LAYER_STATUS
Sets the layer visibility information in a layer state. This command
requires Creo Parametric 2.0 or above.
Syntax
SET_LAYER_STATE_LAYER_STATUS model "layer_state" "layer" "visibility"
Arguments

model
Model in which the visibility state should be set according model
specification.

layer_state
Name of the layer state. Any string expression is allowed and
wildcards can be used.

layer
Name of the layer. Any string expression is allowed and wildcards can
be used.

visibility
Visibility state. Any string expression is allowed. The following
states are supported:
DISPLAY—layer is displayed.
BLANK—layer is blanked.
ISOLATE—layer is isolated.
HIDDEN_LINE—layer shows components in hidden line display.
Error handling
The program execution will be canceled if the model, the layer state
or the layer could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_LAYER_STATE_LAYER_STATUS PART "my_layer_state" "00-Datums" BLANK
SET_LAYER_STATE_LAYER_STATUS PART "my_layer_state" "00-Surfaces"
BLANK
ACTIVATE_LAYER_STATE "my_layer_state" "00-Datums"
§
REMOVE_LAYER_STATE_LAYER
Removes layers from a layer state. This command requires Creo
Parametric 2.0 or above.
Syntax
REMOVE_LAYER_STATE_LAYER model "layer_state" "layer"
Arguments

model
Model in which the visibility state should be set according model
specification.

layer_state
Name of the layer state. Any string expression is allowed and
wildcards can be used.

layer
Name of the layer. Any string expression is allowed and wildcards can
be used.
Error handling
The program execution will be canceled if the model or the layer
state could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
When using wildcards, this command works on all layers which are
matching the name description. The command will also not fail, if no
layer is found.
Example
REMOVE_LAYER_STATE_LAYER PART "my_layer_state" "00*"
§
GET_LAYER_STATE_HIDDEN_REFS
Retrieves all references which are hidden by a distinct layer state.
This command requires Creo Parametric 2.0 or above.
Syntax
GET_LAYER_STATE_HIDDEN_REFS model "layer_state" arrayHiddenRefs<:out>
Arguments

model
Model in which the layer state should be retrieved according model
specification.

layer_state
Name of the layer state. Any string expression is allowed and
wildcards can be used.

arrayHiddenRefs
Name of the variable of type array which receives the hidden
references.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_LAYER_STATE_HIDDEN_REFS PART "my_layer_state" allHiddenRefs
FOR hidden_reference REF ARRAY allHiddenRefs
PRINT "%" hidden_reference
END_FOR
§
SET_LAYER_STATE_REF_STATUS
Adds or removes references to and from a layer state in a solid
model. The layer state should be saved afterwards in order to make
the changes active. This command requires Creo Parametric 2.0 or
above.
Syntax
SET_LAYER_STATE_REF_STATUS model "layer_state" reference<:in>
visibility
Arguments

model
Model in which a reference should be displayed or blanked according
model specification.

layer_state
Name of the layer state. Any string expression is allowed and
wildcards can be used.

reference
Reference to add or remove from the layer state.

visibility
DISPLAY—reference is displayed and therefor removed from the layer
state.
BLANK—reference is blanked and therefor added to the layer state.
Error handling
The program execution will be canceled if the model, the layer state
or the reference could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_ACTIVE_LAYER_STATE PART layer_state
GET_LAYER_STATE_HIDDEN_REFS PART layer_state allHiddenRefs
FOR hidden_reference REF ARRAY allHiddenRefs
SET_LAYER_STATE_REF_STATUS PART layer_state hidden_reference
DISPLAY
END_FOR
SAVE_LAYER_STATE PART layer_state
x
: ;">
§
About Commands for Model Exploded States
Commands for exploded states.
EXPLODE_MDL — to explode an assembly.
ACTIVATE_EXPLODE_STATE — to activate explode state of an assembly.
GET_ACTIVE_EXPLODE_STATE — to detect the active explosion state of
an assembly.
CREATE_EXPLODE_STATE — to create an explode state in an assembly.
READ_EXPLODE_STATE — to read the definition of an explode state
from an assembly.
MODIFY_EXPLODE_STATE — to modify an explode state in an assembly.
Additional to the command the logical expression IS_EXPLODED can test
if a model is exploded or not.
§
EXPLODE_MDL
Explodes or Un-explodes an assembly.
Syntax
EXPLDOE_MDL model state
Arguments

model
Model which is to be exploded or unexploded according to model
specification.

state
State is either TRUE or FALSE.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
EXPLODE_MDL THIS TRUE
§
ACTIVATE_EXPLODE_STATE
Activates a specific explode state in an assembly.
Syntax
ACTIVATE_EXPLODE_STATE model "state"
Arguments

model
Model for which the explode state should be activated according to
model specification.

state
Name of the explode state in Creo Elements/Pro.
Error handling
The program execution will be canceled if the model or the state
could not be found, unless errors are handled by BEGIN_CATCH_ERROR.
Note
This command does not explode the model. This is done by the command
EXPLODE_MDL.
Example
ACTIVATE_EXPLODE_STATE THIS "Sample"
EXPLODE_MDL THIS TRUE
§
GET_ACTIVE_EXPLODE_STATE
Detects the active explosion state of an assembly.
Syntax
GET_ACTIVE_EXPLODE_STATE model name<:out>
Arguments

model
Assembly model for which the active explode state is detected
according model specification.

name
Name of the variable of type string which will receive the
information of the active explode state.
Error handling
The program execution will be canceled if the model could not be
found or the state could not be detected, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
GET_ACTIVE_EXPLODE_STATE ASSEMBLY explode_state
PRINT "explode_state: %" explode_state
§
CREATE_EXPLODE_STATE
Creates an explode state in an assembly. This command requires Creo
Parametric 2.0 or above.
Syntax
CREATE_EXPLODE_STATE model "state" array_explode_options<:in>
Arguments

model
Model for which the explode state should be created according to
model specification.

state
Name of the explode state.

array_explode_options
Array of structure variables of type EXPLODE_OPTION which define
translations and rotations in the explosion.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_ARRAY arrayExplodeOptions

DECLARE_STRUCT EXPLODE_OPTION explode_option1


explode_option1.type = "TRANSLATE"
explode_option1.direction.y = 1.0
explode_option1.value = 100
SEARCH_MDL_REFS ASSEMBLY COMPONENT "*pin*"
explode_option1.array_components
ADD_ARRAY_ELEM arrayExplodeOptions explode_option1

DECLARE_STRUCT EXPLODE_OPTION explode_option2


explode_option2.type = "ROTATE"
explode_option2.direction.y = 1.0
explode_option2.center.x = 100
explode_option2.value = 45
SEARCH_MDL_REFS ASSEMBLY COMPONENT "plate"
explode_option2.array_components
ADD_ARRAY_ELEM arrayExplodeOptions explode_option2

CREATE_EXPLODE_STATE ASSEMBLY "sample" arrayExplodeOptions


§
READ_EXPLODE_STATE
Reads in the definition of an explode state from an assembly. This
command requires Creo Parametric 2.0 or above.
Syntax
READ_EXPLODE_STATE model "state" array_explode_options<:out>
Arguments

model
Model for which the explode state should be created according to
model specification.

state
Name of the explode state.

array_explode_options
Name of the array of structure variables of type EXPLODE_OPTION which
which will receive the explode state definition.
Error handling
The program execution will be canceled if the model does not exist or
the state could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
READ_EXPLODE_STATE ASSEMBLY "example1" arrayExplodeOptions
MODIFY_EXPLODE_STEATE ASSEMBLY "example2" arrayExplodeOptions
§
MODIFY_EXPLODE_STATE
Modifies an explode state in an assembly. This command requires Creo
Parametric 2.0 or above.
Syntax
MODIFY_EXPLODE_STATE model "state" array_explode_options<:in>
Arguments

model
Model for which the explode state should be created according to
model specification.

state
Name of the explode state.

array_explode_options
Array of structure variables of type EXPLODE_OPTION which define
translations and rotations in the explosion.
Error handling
The program execution will be canceled if the model does not exist or
the state could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
READ_EXPLODE_STATE ASSEMBLY "example1" arrayExplodeOptions
MODIFY_EXPLODE_STATE ASSEMBLY "example2" arrayExplodeOptions
§
About Commands for Combined Views
The following commands are available to create, set and analyze
combined views:
GET_ACTIVE_COMB_VIEW — to retreive the name of the active combined
view.
SET_ACTIVE_COMB_VIEW — to set the active combined view.
GET_COMB_VIEWS — to retrieve all combined views of a mode.
GET_COMB_VIEW_PROPS — to retrieve the properties of a combined
view.
CREATE_COMB_VIEW — to create a new combined view.
MODIFY_COMB_VIEW — to modify an existing combined view.
DELETE_COMB_VIEW — to delete an existing combined view.
SET_COMB_VIEW_ANNOTATIONS — to set the annotations of a combined
view.
ADD_COMB_VIEW_ANNOTATIONS — to add annotations to a combined view.
GET_COMB_VIEW_ANNOTATIONS — to retrieve annotations of a combined
view.
REMOVE_COMB_VIEW_ANNOTATIONS — to remove annotations from a
combined view.
GET_COMB_VIEW_ANNOTATION_VISIBILITY — to retrieve the visibility
state of an annotation in a combined view.
SET_COMB_VIEW_ANNOTATION_VISIBILITY — to set the visibility state
of annotations in a combined view.
GET_COMB_VIEW_VISIBILITY_CONTROL — to retrieve the visibility
control setting for annotations and supplemental geometry of a
combined view.
SET_COMB_VIEW_VISIBILITY_CONTROL — to set the visibility control
setting for annotations and supplemental geometry of a combined
view.
SET_COMB_VIEW_NAME — to rename an existing combined view.
GET_COMB_VIEW_PUBLISH_STATE — to retrieve the information if a
combined view is published.
§
GET_ACTIVE_COMB_VIEW
Retrieves the name of the active combined view. This command requires
Creo Parametric 1.0 or above.
Syntax
GET_ACTIVE_COMB_VIEW model combined_view<:out>
Arguments

model
The specified model.

combined_view
Variable which will receive the name of the combined view.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_ACTIVE_COMB_VIEW PART comb_view_name
PRINT "Name of the active combined view: %" comb_view_name
§
SET_ACTIVE_COMB_VIEW
Sets the active combined view. This command requires Creo Parametric
1.0 or above.
Syntax
SET_ACTIVE_COMB_VIEW model "combined_view"
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.
Error handling
The program execution will be canceled if the mode or the combined
state are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_ACTIVE_COMB_VIEW PART "DEFAULT"
§
GET_COMB_VIEWS
Retrieves all combined views of a model. This command requires Creo
Parametric 1.0 or above.
Syntax
GET_COMB_VIEWS model arrayCombView<:out>
Arguments

model
The specified model.

arrayCombView
Array which will receive all combined views of the model.
Error handling
The program execution will be canceled if the mode is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_COMB_VIEWS PART arrayCombViews
FOR comb_view REF ARRAY arrayCombViews
PRINT "%" comb_view
END_FOR
§
GET_COMB_VIEW_PROPS
Retrieves the properties of a combined view. This command requires
Creo Parametric 1.0 or above.
Syntax
GET_COMB_VIEW_PROPS model "combined_view" comb_view_props<:out>
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

comb_view_props
Structure variable of type COMB_VIEW_PROPS which receives the
properties of the combined view.
Error handling
The program execution will be canceled if the mode or the combined
state are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_ACTIVE_COMB_VIEW PART comb_view
GET_COMB_VIEW_PROPS PART comb_view props
PRINT "orientation: %" props.orientation
PRINT "simp_rep: %" props.simp_rep
PRINT "style: %" props.style
PRINT "cross_section: %" props.cross_section
PRINT "exclude_clipped_components: %"
props.exclude_clipped_components
PRINT "explode: %" props.explosion
PRINT "show_exploded: %" props.show_exploded
PRINT "layer: %" props.layer
§
CREATE_COMB_VIEW
Creates a new combined view. This command requires Creo Parametric
1.0 or above.
Syntax
CREATE_COMB_VIEW model comb_view_props<:in> "combined_view"
Arguments

model
The specified model.

comp_view_props
Structure variable of type COMB_VIEW_PROPS which contains the
properties of the combined view.

combined_view
Name of the combined view. Any string expression is allowed.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_COMB_VIEW_ACTIVE PART comb_view
GET_COMB_VIEW_PROPS PART comb_view props
PRINT "orientation: %" props.orientation
PRINT "simp_rep: %" props.simp_rep
PRINT "style: %" props.style
PRINT "cross_section: %" props.cross_section
PRINT "exclude_clipped_components: %"
props.exclude_clipped_components
PRINT "explode: %" props.explosion
PRINT "show_exploded: %" props.show_exploded
PRINT "layer: %" props.layer
§
MODIFY_COMB_VIEW
Modifies and existing combined view. This command requires Creo
Parametric 1.0 or above.
Syntax
MODIFY_COMB_VIEW model "combined_view" comb_view_props<:in>
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

comb_view_props
Structure variable of type COMB_VIEW_PROPS which contains the
properties of the combined view.
Error handling
The program execution will be canceled if the mode or the combined
state are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_COMB_VIEW_PROPS ASSEMBLY "comb0001" props
props.simp_rep = "no_screws"
props.cross_section = "xsec0001"
MODIFY_COMB_VIEW ASSEMBLY "comb0001" props
§
DELETE_COMB_VIEW
Deletes an existing combined view of a model. This command requires
Creo Parametric 1.0 or above.
Syntax
DELETE_COMB_VIEW model "combined_view"
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.
Error handling
The program execution will be canceled if the model or the combined
view do not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Removing the default combined view is not possible.
Example
GET_COMB_VIEWS PART combViews
FOR combView REF ARRAY combViews
DELETE_COMB_VIEW PART combView
END_FOR
§
SET_COMB_VIEW_ANNOTATIONS
Sets the annotations of a combined view. This command requires Creo
Parametric 1.0 or above.
Syntax
SET_COMB_VIEW_ANNOTATIONS model "combined_view" refAnnotation |
arrayAnnotations<:in>
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

refAnnoation | arrayAnnotations
Single reference variable or array of references to annotation
elements or annotation features. In case of an annotation feature all
contained annotation elements are used.
Error handling
The program execution will be canceled if the model or the
annotations are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE featAnnotation
SET_COMB_VIEW_ANNOTATIONS THIS "my_view" featAnnotation
§
ADD_COMB_VIEW_ANNOTATIONS
Adds annotations to a combined view. This command requires Creo
Parametric 1.0 or above.
Syntax
ADD_COMB_VIEW_ANNOTATIONS model "combined_view" refAnnotation |
arrayAnnotations<:in>
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

refAnnoation | arrayAnnotations
Single reference variable or array of references to annotation
elements or annotation features. In case of an annotation feature all
contained annotation elements are used.
Error handling
The program execution will be canceled if the model or the
annotations are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_FEAT THIS FEAT_TYPE "ANNOTATION" arrayFeatAnnotations
FOR featAnnotation REF ARRAY arrayFeatAnnotations
ADD_COMB_VIEW_ANNOTATIONS THIS "my_view" featAnnotation
END_FOR
§
GET_COMB_VIEW_ANNOTATIONS
Retrieves the annotations of a combined view. This command requires
Creo Parametric 1.0 or above.
Syntax
GET_COMB_VIEW_ANNOTATIONS model "combined_view"
arrayAnnotations<:out>
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

arrayAnnotations
Array variable which receives the information about Single reference
variable or array of references to annotation elements or annotation
features. In case of an annotation feature all contained annotation
elements are used.
Error handling
The program execution will be canceled if the model or the
annotations are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_COMB_VIEW_ANNOTATIONS THIS "my_view" arrayAnnotations
FOR annotation REF ARRAY arrayAnnotations
PRINT "%" annotation
END_FOR
§
REMOVE_COMB_VIEW_ANNOTATIONS
Removes annotations from a combined view. This command requires Creo
Parametric 1.0 or above.
Syntax
REMOVE_COMB_VIEW_ANNOTATIONS model "combined_view" refAnnotation |
arrayAnnotations<:in>
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

refAnnoation | arrayAnnotations
Single reference variable or array of references to annotation
elements or annotation features. In case of an annotation feature all
contained annotation elements are used.
Error handling
The program execution will be canceled if the model or the
annotations are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_COMB_VIEW_ANNOTATIONS THIS "my_view" arrayAnnotations
REMOVE_COMB_VIEW_ANNOTATIONS THIS "my_view" arrayAnnotations
§
GET_COMB_VIEW_ANNOTATION_VISIBILITY
Retrieves the visibility state of an annotation in a combined view.
This command requires Creo Parametric 1.0 or above.
Syntax
GET_COMB_VIEW_ANNOTATION_VISIBILITY model "combined_view"
annotation<:in> visibility<:out>
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

annotation
Annotation or annotation feature. In case of an annotation feature
the first annotation is used.

visibility
Name of the boolean parameter which receives the visibility state.
Error handling
The program execution will be canceled if the model or the annotation
are not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL my_symbol
GET_COMB_VIEW_ANNOTATION_VISIBILITY THIS "my_view" my_symbol visible
PRINT "Visibility state: %" visible
§
SET_COMB_VIEW_ANNOTATION_VISIBILITY
Sets the visibility state of annotations in a combined view. This
command requires Creo Parametric 1.0 or above.
Syntax
SET_COMB_VIEW_ANNOTATION_VISIBILITY model "combined_view"
refAnnotation | arrayAnnotations<:in> visibilityBOOL
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

refAnnotation | arrayAnnotations
Single reference variable or array of references to annotation
elements or annotation features. In case of an annotation feature all
contained annotation elements are used.

visibility
The boolean variable determines if the annotations are visible in the
combined view.
Error handling
The program execution will be canceled if the model or the annotation
are not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SYMBOL my_symbol
SET_COMB_VIEW_ANNOTATION_VISIBILITY THIS "my_view" my_symbol FALSE
§
GET_COMB_VIEW_VISIBILITY_CONTROL
Retrieves the visibility control setting for annotations and
supplemental geometry of a combined view.
Syntax
GET_COMB_VIEW_VISIBILITY_CONTROL model "combined_view"
annotations_visiblity_control<:in>
suppl_geometry_visibility_control<:out>
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

annotations_visibility_control
Name of the boolean variable which receives the state of the
visibility control for annotations.

suppl_geometry_visibility_control
Name of the boolean variable which receives the state of the
visibility control for supplemental geometry.
Error handling
The program execution will be canceled if the model or the combined
view are not existing or if the visibility control could not be
retrieved, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_COMB_VIEW_VISIBILITY_CONTROL PART "Comb0001" annot_visib_control
supplgeom_visib_control
PRINT "annot_visib_control: %" annot_visib_control
PRINT "supplgeom_visib_control: %" supplgeom_visib_control
§
SET_COMB_VIEW_VISIBILITY_CONTROL
Sets the visibility control setting for annotations and supplemental
geometry of a combined view. The command requires Creo 4.0 M100, Creo
5.0.5.0, Creo 6.0.1.0 or above.
Syntax
SET_COMB_VIEW_VISIBILITY_CONTROL model "combined_view"
annotations_visiblity_controlBOOL
suppl_geometry_visibility_controlBOOL
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

annotations_visiblity_control
The boolean variable determines the state of the of the visibility
control for annotations.

suppl_geometry_visibility_control
The boolean variable determines the state of the of the visibility
control for supplemental geometry.
Error handling
The program execution will be canceled if the model or the combined
view are not existing or if the visibility control could not be set,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
If the annotations visibility control is disabled the one of the
supplemental geometry will be disabled too.
Example
SET_COMB_VIEW_VISIBILITY_CONTROL PART "Comb0001" FALSE TRUE
§
SET_COMB_VIEW_NAME
Renames an existing combined view of a model. This command requires
Creo Parametric 1.0 or above.
Syntax
SET_COMB_VIEW_NAME model "combined_view" "name"
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

name
New name for the combined view. Any string expression is allowed.
Error handling
The program execution will be canceled if the model or the combined
view do not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Renaming the default combined view is not possible.
Example
GET_COMB_VIEWS PART combViews
FOR combView REF ARRAY combViews
SET_COMB_VIEW_NAME PART combView combView + "_1"
END_FOR
§
GET_COMB_VIEW_PUBLISH_STATE
Retrieves the information if a combined view is published.
Syntax
GET_COMB_VIEW_PUBLISH_STATE model "combined_view" publish_state<:out>
Arguments

model
The specified model.

combined_view
Name of the combined view. Any string expression is allowed.

publish_state
Name of the boolean parameter which retrieves the information if the
combined view is published.
Error handling
The program execution will be canceled if the model does not exist or
the publish state could not be retrieved, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
GET_COMB_VIEW_PUBLISH_STATE mdl "COMB0001" state
PRINT "state: %" state
About Commands for Data Sharing and Flexibility
Commands for creating data sharing and setting flexibility. Both
subjects are placed in one common folder since the concept of varied
items applies to inheritance features and to flexible components.
Commands for the following topics are available:
Date Sharing Features — to create data sharing features.
Flexibility — to set or unset flexibility.
SET_VARIED_ITEM_STATE — to set the state of a varied feature item for
an inheritance feature or a flexible component.
SET_VARIED_ITEM_VALUE — to set the value of a varied dimension or
parameter item for an inheritance feature or a flexible component.
INSERT_VARIED_ITEM — to insert a dimension, a parameter or a feature
as varied item for an inheritance feature or a flexible component.
REMOVE_VARIED_ITEM — to remove a dimension, a parameter or a feature
from the varied items of an inheritance feature or a flexible
component.
GET_VARIED_ITEMS — to collect varied items of an inheritance feature
or a flexible component.
About Commands for Data Sharing Features
Commands for creating data sharing features. These commands are only
available in Creo Elements/Pro Wildfire 4 and above and they required
the Creo Elements/Pro AAX module.
The following commands are available:
CREATE_PUBLISHED_GEOMETRY — to create published geometry features.
CREATE_COPY_GEOMETRY — to create copy geometry features.
CREATE_GENERAL_MERGE — to create merge and inheritance features.
GET_GENERAL_MERGE_FEATURE — to accesses a specific member of a
general merge feature.
GET_GENERAL_MERGE_FEATURE_NUM — to retrieve the number of features
in the general merge model.
CREATE_SHRINKWRAP — to create shrink wrap features
CREATE_PUBLISHED_GEOMETRY
Creates a published geometry feature. This command requires Creo
Elements/Pro Wildfire 4 or above and the AAX module.
Syntax
CREATE_PUBLISHED_GEOMETRY model arrayReferences<:in>
refPublishedGeometry<:out>
Arguments

model
Model in which the feature should be created. Models are specified in
the following manner.

arrayReferences
Array with references which should be included in the published
geometry.

refPublishedGeometry
Name of the variable which should receive the reference to the
published geometry feature.
Error handling
The program execution will be canceled if model or array are not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS THIS SURFACE "*" allSurfaces
CREATE_PUBLISHED_GEOMETRY THIS allSurfaces publicGeom
CREATE_COPY_GEOMETRY
Creates a copy geometry feature. This command requires Creo
Elements/Pro Wildfire 4 or above and the AAX module.
Syntax
CREATE_COPY_GEOMETRY model copy_geom_option<:in> refCopyGeom<:out>
Arguments

model
Model in which the feature should be created. Models are specified in
the following manner.

copy_geometry_options
Structure variable of type COPY_GEOMETRY_OPTION contains the
definition of the copy geometry which should be created.

refCopyGeom
Name of the variable which should receive the reference to the copy
geometry feature.
Error handling
The program execution will be canceled if the model is not existing
of if the copy geometry feature could not be created, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL targetMdl
USER_SELECT MODEL sourceMdl
DECLARE_STRUCT COPY_GEOMETRY_OPTION option
SEARCH_MDL_REFS sourceMdl SURFACE "*" option.references
option.use_published_geometry = FALSE
CREATE_COPY_GEOMETRY targetMdl option publicGeom
CREATE_GENERAL_MERGE
Creates merge and inheritance features.
Syntax
CREATE_GENERAL_MERGE source target general_merge_option<:in>
refGenMerge<:out>
CONTRAINT1
CONTRAINT2
...
END_CREATE_GENERAL_MERGE
Arguments

source
Source model for the general merge operation. Models are specified in
the following manner.

target
Target model in which the general merge feature should be created.
Models are specified in the following manner.

general_merge_option
Structure variable of type GENERAL_MERGE_OPTION contains the
definition of the general merge which should be created.

refGenMerge
Name of the variable which should receive the reference to the
general merge feature.

Constraints
Multiple constraints can be defined. More information is in the
chapter how to specify constraints.
Error handling
The program execution will be canceled if the feature creation fails,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT PART target
USER_SELECT PART source
SEARCH_MDL_REF target CSYS "CS0" targetCsys
SEARCH_MDL_REF source CSYS "CS0" sourceCsys

DECLARE_STRUCT GENERAL_MERGE_OPTION option


option.merge = FALSE
option.external = TRUE

CREATE_GENERAL_MERGE source target option refGenMerge


CSYS targetCsys sourceCsys
END_CREATE_GENERAL_MERGE
GET_GENERAL_MERGE_FEATURE
Accesses a specific feature of a general merge model.
Syntax
GET_GENERAL_MERGE_FEATURE [options] refGeneralMerge<:in> indexINT
refFeature<:out>
Arguments

options
The following options are supported:
ALLOW_SUPPRESSED — to include also suppressed features.

refGeneralMerge
Existing reference to a general merge feature or an element of it.

index
Index to specify the element of the feature. 0 means the general
merge feature itself, 1 means first feature of the general merge
model.

refFeature
If the general merge feature is a normal merge it will show up with
zero features.
Error handling
The program execution will be canceled if the supplied reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
If the general merge feature is a normal merge only the
Example
GET_GENERAL_MERGE_FEATURE_NUM ALLOW_SUPPRESSED featMerge num
DECLARE_VARIABLE INTEGER n
n = 0
WHILE n <= num
GET_GENERAL_MERGE_FEATURE ALLOW_SUPPRESSED featMerge n member
PRINT "%" member
n++
END_WHILE
GET_GENERAL_MERGE_FEATURE_NUM
Retrieves the number of features in a general merge model.
Syntax
GET_GENERAL_MERGE_FEATURE_NUM [options] refGeneralMerge<:in>
paramNumberFeatures<:out>
Arguments

options
The following options are supported:
ALLOW_SUPPRESSED — to include also suppressed features.

refGeneralMerge
Existing reference to a general merge feature or element of it.

paramNumberFeatures
Name of the parameter which will receive the number of features in
the general merge model.
Error handling
The program execution will be canceled if the supplied reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
If the general merge feature is a normal merge it will show up with
zero features.
Example
GET_GENERAL_MERGE_FEATURE_NUM ALLOW_SUPPRESSED featMerge num
DECLARE_VARIABLE INTEGER n
n = 0
WHILE n <= num
GET_GENERAL_MERGE_FEATURE ALLOW_SUPPRESSED featMerge n member
PRINT "%" member
n++
END_WHILE
CREATE_SHRINKWRAP
Creates a shrink wrap feature. This command requires Creo
Elements/Pro Wildfire 4 or above and the AAX module.
Syntax
CREATE_SHRINKWRAP model shrink_wrap_option<:in> refShrinkWrap<:out>
Arguments

model
Model in which the feature should be created. Models are specified in
the following manner.

shrink_wrap_options
Structure variable of type SHRINKWRAP_OPTION contains the definition
of the shrink wrap which should be created.

refShrinkWrap
Name of the variable which should receive the reference to the shrink
wrap feature.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL targetMdl
USER_SELECT MODEL sourceMdl
DECLARE_STRUCT SHRINKWRAP_OPTION option
ADD_ARRAY_ELEM option.included_components sourceMdl
CREATE_SHRINKWRAP targetMdl option shrinkWrapFeature
About Commands for Flexibility
Commands for setting an un-setting flexibility for a component. These
commands are only available for Creo 1.0 and above.
The following commands are available:
SET_FLEXIBLE — to make an existing component flexible and to define
its varied items.
GET_FLEXIBLE — to determines if a component is flexible.
UNSET_FLEXIBLE — to remove flexibility from a component.
SET_FLEXIBLE_PREDEFINED — to make an existing component flexible by
using its predefined varied items.
PREDEFINE_FLEXIBILITY — to predefine varied items on a model.
GET_FLEXIBLE_PREDEFINED — to test if a model has predefined varied
items.
GET_PREDEFINED_FLEXIBLE_ITEMS — to collect predefined varied items
of a model.
SET_FLEXIBLE
Makes an existing component flexible and defines its varied items.
The function requires Creo 1.0 or above.
Syntax
SET_FLEXBILE model arrayVariedItems<:in>
Arguments

model
The model which should be made flexible. Models are specified in the
following manner.

arrayVariedItems.
Array of the items which should vary for the flexible component. Use
references for features and names for dimensions and parameters.
Error handling
The program execution will be canceled if model or array are not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL mdl
SEARCH_MDL_REF mdl FEATURE "sample_feat" refFeat
DECLARE_ARRAY arrayVariedItems
ADD_ARRAY_ELEM arrayVariedItems refFeat
ADD_ARRAY_ELEM arrayVariedItems "D0"
ADD_ARRAY_ELEM arrayVariedItems "PARAMETER1"
SET_FLEXIBLE mdl arrayVariedItems
GET_FLEXIBLE
Determines if a component is flexible. The function requires Creo 1.0
or above.
Syntax
GET_FLEXBILE model is_flexible<:out>
Arguments

model
The model which should be made flexible. Models are specified in the
following manner.

is_flexible
Name of the boolean variable which receives the information if the
component is flexible or not.
Error handling
The program execution will be canceled if model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT comp
GET_FLEXIBLE comp bFlexible
PRINT "%" bFlexible
UNSET_FLEXIBLE
Removes flexibility from a component. This function requires Creo 1.0
or above.
Syntax
UNSET_FLEXBILE model
Arguments

model
The model which should be made flexible. Models are specified in the
following manner.
Error handling
The program execution will be canceled if model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL mdl
UNSET_FLEXIBLE mdl
SET_FLEXIBLE_PREDEFINED
Makes an existing component flexible by using its predefined varied
items. This function requires Creo 1.0 or above.
Syntax
SET_FLEXBILE_PREDEFINED model
Arguments

model
The model which should be made flexible. Models are specified in the
following manner.
Error handling
The program execution will be canceled if model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL mdl
SET_FLEXIBLE_PREDEFINED mdl
PREDEFINE_FLEXIBILITY
Predefines varied items on a model to be used later on when using the
model as a flexible component. This function requires Creo 1.0 or
above.
Syntax
PREDEFINE_FLEXBILITY model arrayVariedItems<:in>
Arguments

model
The model for which the varied items are to be defined. Models are
specified in the following manner.

arrayVariedItems.
Array of the items which should vary for the flexible component. Use
references for features and names for dimensions and parameters. In
case of an empty array, existing predefined flexibility is removed.
Error handling
The program execution will be canceled if model or array are not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL mdl
DECLARE_ARRAY arrayVariedItems
ADD_ARRAY_ELEM arrayVariedItems "H"
ADD_ARRAY_ELEM arrayVariedItems "PARAMETER_1"

SEARCH_MDL_REF mdl FEATURE "ROUND" refFeat


ADD_ARRAY_ELEM arrayVariedItems refFeat

PREDEFINE_FLEXIBILITY mdl arrayVariedItems


GET_FLEXIBLE_PREDEFINED
Determines if a model as predefined varied items for flexibility.
This function requires Creo 1.0 or above.
Syntax
GET_FLEXBILE_PREDEFINED model has_predefined_flexibility<:out>
Arguments

model
The model which should be tested for predefined flexibility. Models
are specified in the following manner.

has_predefined_flexibility
Name of the boolean variable which receives the information if the
model has predefined flexibility.
Error handling
The program execution will be canceled if model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL mdl
GET_FLEXIBLE_PREDEFINED mdl has_predefined_flexibility
PRINT "%" has_predefined_flexibility
GET_PREDEFIND_FLEXIBLE_ITEMS
Retrieves an array of predefined flexible items. References are used
for features and strings for parameters and dimensions. This function
requires Creo 1.0 or above.
Syntax
GET_PREDEFINED_FLEXIBLE_ITEMS model arrayVariedItems<:out>
Arguments

model
The model for which the predefined flexible items should be
retrieved. Models are specified in the following manner.

arrayVariedItems
Name for the array variable which will receive the information about
predefined flexible items. References are used for features and
strings for parameters and dimensions.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_PREDEFINED_FLEXIBLE_ITEMS mdl arrayVariedItems
FOR varied_item REF ARRAY arrayVariedItems
PRINT "%" varied_item
END_FOR
SET_VARIED_ITEM_STATE
Sets the state of a varied item of an inheritance feature or a
flexible component. This function requires Pro/ENGINEER Wildfire 4 or
above.
Syntax
SET_VARIED_ITEM_STATE [options] model refFeature<:in> 'state'
Arguments

options
The following options are available:
INCLUDE_CHILDREN includeBOOL — determines if also the state of the
children of the specified feature should be set. Default is FALSE.

model
The flexible model for which the feature should be set. Models are
specified in the following manner.

refFeature
Existing reference to a varied item of an inheritance feature or a
flexible component.

state
SUPPRESSED — to suppress the feature.
RESUMED — to resume the feature.
Error handling
The program execution will be canceled if the model or the reference
is not existing or the state could note be set, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refFeature
SET_VARIED_ITEM_STATE refFeature refFeature SUPPRESSED
SET_VARIED_ITEM_VALUE
Sets the value of a varied item of an inheritance feature or a
flexible component. This function requires Pro/ENGINEER Wildfire 4 or
above.
Syntax
SET_VARIED_ITEM_VALUE model "item_name" valueSTRNUM
Arguments

model
The flexible model for which the feature should be set. Models are
specified in the following manner.

item_name
Name of the varied item. Any string expression is allowed. Also
wildcards are allowed to specify the instance name.

value
Value which should be set to the item Any string expression or math
expression is allowed.
Error handling
The program execution will be canceled if the model does not exist or
the value could not be set, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_FLEXIBLE_PREDEFINED mdl
SET_VARIED_ITEM_VALUE mdl "length" 100.0
INSERT_VARIED_ITEM
Inserts a parameter, a dimension or a feature as varied item to an
inheritance feature or a flexible component. This function requires
Creo 1.0 or above.
Syntax
INSERT_VARIED_ITEM model itemVAR
Arguments

model
The flexible model for which the varied item should be set. Models
are specified in the following manner.

item
Reference for feature items or names for dimensions and parameters
which should be appended to the list of varied items.
Error handling
The program execution will be canceled if the flexible model is not
existing or the varied item could note be inserted, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF inherited FEATURE "feat1" refFeat1
INSERT_VARIED_ITEM inherited "DM"
INSERT_VARIED_ITEM inherited refFeat1
SET_VARIED_ITEM_STATE inherited refFeat SUPPRESSED
SET_VARIED_ITEM_VALUE inherited "DM" 11.25
REMOVE_VARIED_ITEM
Removes a parameter, a dimension or a feature as varied item for an
inheritance feature or a flexible component. This function requires
Creo 1.0 or above.
Syntax
REMOVE_VARIED_ITEM model itemVAR
Arguments

model
The flexible model from which the varied item should be removed.
Models are specified in the following manner.

item
Reference of features items of name for dimensions and parameters
which should be removed from the list of varied items.
Error handling
The program execution will be canceled if the flexible model is not
existing or the varied item could not be removed, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF inherited FEATURE "feat1" refFeat1
REMOVE_VARIED_ITEM inherited refFeat1
REMOVE_VARIED_ITEM inherited "DM"
GET_VARIED_ITEMS
Retrieves an array of varied items. References are used for features
and strings for parameters and dimensions. This function requires
Creo 1.0 or above.
Syntax
GET_VARIED_ITEMS model arrayVariedItems<:out>
Arguments

model
The flexible model for which the varied items should be found. Models
are specified in the following manner.

arrayVariedItems
Name for the array variable which will receive the information about
predefined flexible items. References are used for features and
strings for parameters and dimensions.
Error handling
The program execution will be canceled if the item or the flexible
model is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Also a reference to an inheritance feature can be used to provide the
input model reference.
Example
GET_VARIED_ITEMS mdl arrayVariedItems
FOR varied_item REF ARRAY arrayVariedItems
PRINT "%" varied_item
END_FOR
About Commands for Measurement and Calculation
Commands for measurement and calculation similar to the analysis
functionality in Creo Elements/Pro.
The following commands are available:
MEASURE_DISTANCE — to measure distances.
MEASURE_ANGLE — to measure angles.
MEASURE_RADIUS — to measure radii.
MEASURE_DIAMETER — to measure diameters.
MEASURE_LENGTH — to measure lengths.
MEASURE_AREA — to measure areas.
CALC_OUTLINE_PARAM — to measure center points, maximum extensions
and maximum coordinates.
CALC_OUTLINE — to measure the outline of a model regarding a
specified coordinates system.
CALC_FEATURE_OUTLINE — to measure the outline of a feature
regarding a specified coordinate system.
CALC_GLOBAL_INTERFERENCE — to calculate the global interference of
an assembly.
CALC_CLEARANCE — to calculate the clearance between two parts.
CALC_RAY_INTERSECTION — to find models colliding with a ray.
CALC_SURFACE_SIDE — to determine if a reference is located on the
positive or negative side of a planar surface.
CALC_CURVE_EXTREMES — to determine minimum and maximum points from
the curves in one direction.
CALC_CURVE_POINT — to calculate the point on the curves with has a
specific distance in one direction.
CALC_CURVE_POINTS — to calculate the points on the curves with has
a specific distance in one direction.
CALC_PARAM_POS — to calculate the position on a geometrical
reference based on a parametrization value.
CALC_POS_PARAM — to calculate the uv parameter to a position on a
geometrical reference.
CALC_ORIENTATION — to determine the orientation of a curve,
composite curve or edge related to a direction vector.
CALC_TRANSFORMATION — to calculate the transformation between
models or coordinate systems.
CALC_TRANSFORM_POINT — to calculate the transformation of a point.
CALC_TRANSFORM_VECTOR — to calculate the transformation of a
vector.
CONCAT_TRANSFORMATION — to concatenate existing transformations.
CONVERT_TRANSFORMATION_TO_MATRIX — to convert a transformation to a
matrix.
CONVERT_MATRIX_TO_TRANSFORMATION — to convert a matrix to a
transformation.
NORMALIZE_MATRIX — to normalize a matrix and convert it to a right-
handed system.
INVERT_MATRIX — to calculate the inverse of a matrix.
VECTOR_NORMALIZE — to normalize a vector to the unit length 1.
VECTOR_GET_LENGTH — to calculate the length of a vector.
VECTOR_DOT_PRODUCT — to calculate the dot product of two vectors.
VECTOR_CROSS_PRODUCT — to calculate the cross product of two
vectors.
VECTOR_FROM_POINTS — to calculate the direction vector from a start
point to an end point.
CALC_FORMULA — to calculate a formula given by a string expression.
CALC_FRACTION — to calculate fraction values and strings.
CALC_POINT_ON_LINE — to calculate if a point is located on a line
or a segment and its projection point on it.
EXEC_MDLCHECK — to perform a ModelCHECK analysis.
CHECK_EXTRUDE_FEATURE — to inspect if the sketched contour of an
extrude feature exceeds the geometry.
MEASURE_DISTANCE
Computes the distance between two specified references.
Syntax
MEASURE_DISTANCE [options] reference1<:in> reference2<:in>
parameterResult<:out>
Arguments

options
The following options are supported:
ENABLE_CHECKBOX1 valueBOOL — corresponds to the checkbox in the
measure distance dialog related to the first reference. Default is
TRUE.

ENABLE_CHECKBOX2 valueBOOL — corresponds to the checkbox in the


message distance dialog related to the second reference. Default is
TRUE.
The options are effective since Creo 2.0 M190 / Creo 3.0 M070 / Creo
4.0 F000 or above. Before these versions they won't have impact on
the measuring results.

reference1
Name of an existing reference.

reference2
Name of an existing reference.

parameterResult
New parameter that receives the measured result.
Error handling
The program execution will be canceled if the references do not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
MEASURE_DISTANCE plane1 plane2 dist_plane1_plane2
MEASURE_ANGLE
Computes the angle between two specified references.
Syntax
MEASURE_ANGLE reference1<:in> [reference2<:in>] parameterResult<:out>
Arguments

reference1
Name of an existing reference for measuring the angle from.

reference2
Optional name of an existing reference for measuring the angle to.

parameterResult
New parameter that receives the measured result.
Error handling
The program execution will be canceled if the references do not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
If reference2 is not specified the angle of an arc could be measured.
Example
MEASURE_ANGLE plane1 plane2 angle_plane1_plane2
MEASURE_ANGLE cyl_surface angle_cyl_surface
MEASURE_RADIUS
Computes the radius of a specified reference.
Syntax
MEASURE_RADIUS reference1<:in> parameterResult
Arguments

reference1
Name of an existing reference.

parameterResult
New parameter that receives the measured result.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
MEASURE_RADIUS cylinder radius_cylinder
MEASURE_DIAMETER
Computes the diameter of a specified reference.
Syntax
MEASURE_DIAMETER reference1<:in> parameterResult<:out>
Arguments

reference1
Name of an existing reference for measuring its diameter.

parameterResult
New parameter that receives the measured result.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
MEASURE_DIAMETER cylinder diam_cylinder
MEASURE_LENGTH
Computes the length of a specified reference.
Syntax
MEASURE_LENGTH reference1<:in> parameterResult<:out>
Arguments

reference1
Name of an existing reference.

parameterResult
New parameter that receives the measured result.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
MEASURE_LENGTH edge length_edge
MEASURE_AREA
Computes the area of selected surface references.
Syntax
MEASURE_AREA reference<:in> | arrayReferences<:in>
parameterResult<:out>
Arguments

reference | arrayReferences
Name of an existing surface reference or of an array of surface
references.

parameterResult
New parameter that receives the measured result.
Error handling
The program execution will be canceled if the reference or the array
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
MEASURE_AREA surface area_surface
CALC_OUTLINE_PARAM
Calculates center and size of a model with respect to a coordinate
system and stores it in a parameter.
Syntax
CALC_OUTLINE_PARAM [options] referenceCsys<:in> option
parameter<:out>
Arguments

options
The following options are supported:

INCLUDE_NONSOLID valueBOOL — determines if non solid surfaces


should be includes. Default is FALSE.

INCLUDE_DATUMS valueBOOL — determines if datums should be included


in the calculation. Default is FALSE.

INCLUDE_FACETS valueBOOL — determines if facets should be included


in the calculation. Default is FALSE.

INCLUDE_CURVES valueBOOL — determines if curves should be included


in the calculation. Default is FALSE.

referenceCsys
Name of a reference coordinate system.

option
X_POS_CENTER — X coordinate of center point with respect to
coordinate system.
Y_POS_CENTER — Y coordinate of center point with respect to
coordinate system.
Z_POS_CENTER — Z coordinate of center point with respect to
coordinate system.
X_SIZE — Size of stamp reference part in x direction with respect
to coordinate system.
Y_SIZE — Size of stamp reference part in y direction with respect
to coordinate system.
Z_SIZE — Size of stamp reference part in z direction with respect
to coordinate system.
X_MAX — Maximum x value with respect to coordinate system.
Y_MAX — Maximum y value with respect to coordinate system.
Z_MAX — Maximum z value with respect to coordinate system.
X_MIN — Minimum x value with respect to coordinate system.
Y_MIN — Minimum y value with respect to coordinate system.
Z_MIN — Minimum z value with respect to coordinate system.

parameter
New parameter that receives the measured result.
Note
The model which is examined is the owner of the coordinate system.
Only solid geometry is regarded. Surfaces are not considered.
Example
USER_SELECT CSYS refCsys
CALC_OUTLINE_PARAM refCsys X_POS_CENTER position_in_x
§
CALC_OUTLINE
Calculates the outline of a model, including its sub components
regarding the specified coordinate system.
Syntax
CALC_OUTLINE [options] reference_origin<:in> model<:in> outline<:out>
Arguments

options
The following options are supported:

INCLUDE_NONSOLID valueBOOL — determines if non solid surfaces


should be includes. Default is FALSE.

INCLUDE_DATUMS valueBOOL — determines if datums should be included


in the calculation. Default is FALSE.

INCLUDE_FACETS valueBOOL — determines if facets should be included


in the calculation. Default is FALSE.

INCLUDE_CURVES valueBOOL — determines if curves should be included


in the calculation. Default is FALSE.

reference_origin
Determines the origin and orientation for calculating the outline of
the model. The following situations have to be regarded:
origin is a coordinate system
The model outline will be calculated regarding this coordinate
system.
NULL
The model outline will be calculated in local coordinates of the
model.
Any other reference
The model outline will be calculated respect to owner of this
reference.

model
Reference to the model whose outline should be calculated.

outline
Structure variable of type BOX will receive the outline coordinates
of the model.
Error handling
The program execution will be canceled if the coordinate system or
the model does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT CSYS refCsys
CALC_OUTLINE refCsys ASSEMBLY outline
PRINT "min: % / % / %" outline.x1 outline.y1 outline.z1
PRINT "max: % / % / %" outline.x2 outline.y2 outline.z2
§
CALC_FEATURE_OUTLINE
Calculates the outline of a feature by its solid surfaces, regarding
the specified coordinate system.
Syntax
CALC_FEATURE_OUTLINE reference_origin<:in> refFeature<:in>
outline<:out>
Arguments

reference_origin
Determines the origin and orientation for calculating the outline of
the feature. The following situations have to be regarded:
origin is a coordinate system
The feature outline will be calculated regarding this coordinate
system.
NULL
The feature outline will be calculated in local coordinates of the
model.
Any other reference
The feature outline will be calculated respect to owner of this
reference.

refFeature
Reference to the feature whose outline should be calculated.

outline
Structure variable of type BOX will receive the outline coordinates
of the model.
Error handling
The program execution will be canceled if the coordinate system or
the feature does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT CSYS refCsys
USER_SELECT FEATURE refFeature
CALC_FEATURE_OUTLINE refCsys refFeature outline
PRINT "min: % / % / %" outline.x1 outline.y1 outline.z1
PRINT "max: % / % / %" outline.x2 outline.y2 outline.z2
§
CALC_GLOBAL_INTERFERENCE
Calculates the global interference of an assembly similar to Analysis
> Model > Global Interference.
Syntax
CALC_GLOBAL_INTERFERENCE options refMdl<:in> arrayInterference<:out>
Arguments

options
The following options are supported:
USE_QUILTS — To use visible quilts in the interference calculation.
CHECK_SUBASMS — use only sub assemblies for the calculation.

refMdl
Reference to an existing model.

arrayInterfaces
Array which receives the interference calculation. Elements are
structure variables of type INTERFERENCE.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Intersections are only determined between visible elements which are
interfering. In case one model contains the other without any
interfering surfaces, it will not be considered as interfering.
Example
CALC_GLOBAL_INTERFERENCE ASSEMBLY arrayIntersections
FOR intersection REF ARRAY arrayIntersections
PRINT "Intersection:"
PRINT "Model1 %" intersection.model1
PRINT "Mode21 %" intersection.model2
PRINT "Volume %" intersection.volume
END_FOR
§
CALC_CLEARANCE
Calculates the clearance between two parts similar to Analysis >
Model > Pairs Clearance.
Syntax
CALC_CLEARANCE type ref1<:in> ref2<:in> clearance<:out>
Arguments

type
The following types are supported:
SURFACE_CLEARANCE — to calculate the clearance between two surfaces
or quilts.
PART_CLEARANCE — to calculate the clearance between two parts.
Quilts are not considered.
PART_INCL_QUILT_CLEARANCE — to calculate the clearance between
parts. Quilts are included in the calculation.

ref1
Depending on the option. Reference to a surface, or quilt or an
existing model.

ref2
Depending on the option. Reference to a surface, or quilt or an
existing model.

clearance
Name of the structure variable of type CLEARANCE.
Error handling
The program execution will be canceled if the references do not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Intersections are only determined between visible elements which are
interfering. In case one model contains the other without any
interfering surfaces, it will not be considered as interfering. There
are some restrictions in Creo Elements/Pro:
For the type SURFACE_CLEARANCE no intersection will be found. For
intersections the structure member distance will be zero.
Intersections from quilts are not added to the interf_volume member
of the structure.
Example
USER_SELECT PART part1
USER_SELECT PART part2
CALC_CLEARANCE PART_CLEARANCE part1 part2 clearance

PRINT "result %" clearnace.result


PRINT "distance %" clearance.distance
PRINT "interference %" clearance.interference
PRINT "interf_volume %" clearance.interf_volume
PRINT "pnt_in_ref1 % % %" clearance.pnt_in_ref1.x
clearance.pnt_in_ref1.y clearance.pnt_in_ref1.z
PRINT "pnt_in_ref2 % % %" clearance.pnt_in_ref2.x
clearance.pnt_in_ref2.y clearance.pnt_in_ref2.z
§
CALC_RAY_INTERSECTION
Calculates the intersected model of a ray. Only visible models are
considered. For each model the information about ray intrusion and
extrusion is calculated. The output is sorted by the intruding order
of the different models.
Syntax
CALC_RAY_INTERSECTION refMdl<:in> [option] direction point<:in>
vector<:in> arrayIntersections<:out>
Arguments

refMdl
Reference to an existing model in which the ray is send out.

option
The following options are supported:
INNER_INTERSECTIONS — calculates all intersections of a ray in a
model. Without this option only the top most and bottom most
intersections inside a model are considered.
EXTREMUM — only the model with the first intrusion and the one with
the last extrusion is considered. So the output array can have zero
elements (if the ray does not hit any model), one element (if one
model has minimal intrusion and maximal extrusion) or two elements.
SORT_TO_OUT — normally the result array is sorted according to the
intrusion of the models. This option sorts it to the extrusion.

RAY_RADIUS radiusDOUBLE — uses another ray radius than the


configured one which is by default 0.001. See also Users Guide
configuration option RAY_RADIUS. The ray radius units are measured
in 1/1000 of screen size.

USE_MDL_UNITS valueBOOL — treats a specified RAY_RADIUS as model


units and converts the values internally. The calculation is not
exact and there can be derivations up to 20%.

RAY_LENGTH lengthDOUBLE — restricts the ray to a specific length.

direction
The following directions are supported:
POSITIVE — to search only in positive ray direction.
NEGATIVE — to search only in negative ray direction.
BOTH — to search in both ray directions.

point
Structure variable of type POINT specifies the start point of the
ray.

vector
Structure variable of type VECTOR specifies the start vector of the
ray.

arrayIntersections
Array which receives the intersection calculation. Elements are
structure variables of type RAY_INTERSECTION.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case of searching in one direction either intruding or extruding
surface may not be defined. As intruding or extruding point in this
case the ray point is used.
Example
DECLARE_STRUCT POINT pnt
DECLARE_STRUCT VECTOR vec
pnt.x = 0
pnt.y = 100
pnt.z = 0
vec.x = 0
vec.y = 10
vec.z = 0
CALC_RAY_INTERSECTION ASSEMBLY POSITIVE pnt vec arrayIntersections
FOR ray_intersect REF ARRAY arrayIntersections
PRINT "Ray intersection"
PRINT "Model: %" ray_intersect.model
PRINT "point in: % % %" ray_intersect.pnt_in.x
ray_intersect.pnt_in.y ray_intersect.pnt_in.z
PRINT "point out: % % %" ray_intersect.pnt_out.x
ray_intersect.pnt_out.y ray_intersect.pnt_out.z
PRINT "distance: %" ray_intersect.distance
PRINT "surface in: %" ray_intersect.surface_in
PRINT "surface out: %" ray_intersect.surface_out
END_FOR
§
CALC_SURFACE_SIDE
Determines if a reference is located on the positive or negative side
of a planar surface. The surface direction is the norm vector of the
theoretical projection point.
Syntax
CALC_SURFACE_SIDE refSurface<:in> refOrient<:int> parameter<:out>
Arguments

refSurface
Reference to the planar surface of which the side should be
determined.

refOrient
Reference to determine the orientation.

parameter
Name of the string parameter which receives the result. The following
results are possible:
POSITIVE — in case the orientation reference is located in positive
direction.
NEGATIVE — in case the orientation reference is located in negative
direction.
ON_SURFACE — in case the orientation reference is located on the
surface.
Error handling
The program execution will be canceled if the references do not exist
or if the surface in not planar, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Although all kind of geometrical references are valid to determine
the orientation it is recommended to use points or coordinate
systems. For other references which extensions (like axis or
surfaces) the selection point or the mid point are used to indicate
their location.
Example
USER_SELECT FACE surface
USER_SELECT POINT|CSYS ref
CALC_SURFACE_SIDE surface ref side
PRINT "%" side
§
CALC_CURVE_EXTREMES
Calculates the extreme points of the curves in one direction.
Syntax
CALC_CURVE_EXTREMES origin<:in> refCurve<:in> | arrayCurves<:in>
point<:in> direction<:in> point_min<:out> point_max<:out>
Arguments

origin
Determines the origin for which the extreme values have to be
evaluated:
origin is a coordinate system
Extreme values will be calculated regarding the default coordinate
system of the curve.
NULL
Extreme values will be calculated for the model to which the curve
belongs.
Any other reference
Extreme values will be calculated regarding the default coordinate
system of the indicated model.

refCurve | arrayCurves
Reference to the curve or array of curve references for which the
extreme values are to be calculated.

point
Structure variable of type POINT specifies the origin.

vector
Structure variable of type VECTOR specifies direction in which to
search.

point_min
Structure variable of type POINT which receives the minimal point on
the curve.

point_max
Structure variable of type POINT which receives the maximum point on
the curve.
Error handling
The program execution will be canceled if the curve or the origin
references do not exist or the extremes could not be calculated,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT CURVE refCurve
DECLARE_STRUCT POINT point
DELCARE_STRUCT VECTOR direction
direction.x = 1

CALC_CURVE_EXTREMES NULL refCurve point direction pnt_min pnt_max


PRINT "min: %/%/% max: %/%/%" pnt_min.x pnt_min.y pnt_min.z pnt_max.x
pnt_max.y pnt_max.z
§
CALC_CURVE_POINT
Calculates the point on the curves with has a specific distance in
one direction.
Syntax
CALC_CURVE_POINT origin<:in> refCurve<:in> | arrayCurves<:in>
point<:in> direction<:in> distance<:in> point_calc<:out>
Arguments

origin
Determines the origin for which the distance values have to be
evaluated:
origin is a coordinate system
Extreme values will be calculated regarding the default coordinate
system of the curve.
NULL
Extreme values will be calculated for the model to which the curve
belongs.
Any other reference
Extreme values will be calculated regarding the default coordinate
system of the indicated model.

refCurve | arrayCurves
Reference to the curve or array of curve references for which the
extreme values are to be calculated.

point
Structure variable of type POINT specifies the origin.

direction
Structure variable of type VECTOR specifies direction in which to
search.

distance
Distance value how far the calculated position should be located from
the supplied point coordinates.

point_calc
Structure variable of type POINT which receives the calculated point.
Error handling
The program execution will be canceled if the curve or the origin
references do not exist or the point could not be calculated, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT CURVE refCurve
DECLARE_STRUCT POINT point
DECLARE_STRUCT VECTOR direction
direction.x = 1

CALC_CURVE_POINT NULL refCurve point direction 0.0 pnt_calc


PRINT "calculated point: %/%/%" pnt_calc.x pnt_calc.y pnt_calc.z
§
CALC_CURVE_POINTS
Calculates the points on the curves with have a specific distance in
one direction.
Syntax
CALC_CURVE_POINTS origin<:in> refCurve<:in> | arrayCurves<:in>
point<:in> direction<:in> distance<:in> arrayPointsCalc<:out>
Arguments

origin
Determines the origin for which the distance values have to be
evaluated:
origin is a coordinate system
Extreme values will be calculated regarding the default coordinate
system of the curve.
NULL
Extreme values will be calculated for the model to which the curve
belongs.
Any other reference
Extreme values will be calculated regarding the default coordinate
system of the indicated model.

refCurve | arrayCurves
Reference to the curve or array of curve references for which the
extreme values are to be calculated.

point
Structure variable of type POINT specifies the origin.

direction
Structure variable of type VECTOR specifies direction in which to
search.

distance
Distance value how far the calculated position should be located from
the supplied point coordinates.

arrayPointsCalc
Array variable which receives the calculated points as structure
variables of type POINT.
Error handling
The program execution will be canceled if the curve or the origin
references do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT CURVE refCurve
DECLARE_STRUCT POINT point
DECLARE_STRUCT VECTOR direction
direction.x = 1

CALC_CURVE_POINTS NULL refCurve point direction arrayPointsCalc


FOR pnt_calc REF ARRAY arrayPointsCalc
PRINT "calculated point: %/%/%" pnt_calc.x pnt_calc.y pnt_calc.z
END_FOR
§
CALC_PARAM_POS
Calculates a position on a geometrical reference based on a
parametrization between 0 and 1. For edges and curves only one
parameter is used. For surfaces two are required.
Syntax
CALC_PARAM_POS origin<:in> refGeometry<:in> paramU<:in>, paramV<:in>
position<:out>
Arguments

origin
Determines the origin for which the position is calculated.
origin is a coordinate system
The position will be calculated regarding this coordinate system.
NULL
The position will be calculated for the default coordinate system
of the model which contains the geometry reference.
Any other reference
The position will be calculated for the default coordinate system
of the model which contains this reference.

refGeometry
Reference to a geometrical item on which the position is calculated.

paramU
Variable of type double with a value between 0 and 1. Any math
expression is allowed.

paramV
Variable of type double with a value between 0 and 1. Any math
expression is allowed.

position
Structure variable of type POINT receives the result.
Error handling
The program execution will be canceled if the origin or the
geometrical reference do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF ASSEMBLY COMPONENT "*" mdlPart
SEARCH_MDL_REF mdlPart EDGE "TEST_EDGE" myEdge
CALC_PARAM_POS ASSEMBLY myEdge 0.5 0.0 pos
SET_REF_POS ASSEMBLY myEdge pos
§
CALC_POS_PARAM
Calculates the uv parametrization parameters between 0 and 1 for a
given position on geometry. For edges and curves the v parameter is
0.
Syntax
CALC_POS_PARAM origin<:in> refGeometry<:in> position<:in>
paramU<:out>, paramV<:out>
Arguments

origin
Determines the origin for which the uv parameters are calculated.
origin is a coordinate system
The parameters will be calculated regarding this coordinate system.
NULL
The parameters will be calculated for the default coordinate system
of the model which contains the geometry reference.
Any other reference
The parameters will be calculated for the default coordinate system
of the model which contains this reference.

refGeometry
Reference to a geometrical item for which the parameters are
calculated.

position
Structure variable of type POINT determines the position.

paramU
Variable of type double which receives the u parameter information..

paramV
Variable of type double which receives the v parameter information.
Error handling
The program execution will be canceled if the origin or the
geometrical reference do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART SURFACE "DIA_SURFACE_FRONT" PlacementReference
SEARCH_MDL_REF PART POINT "SF_PNT1" PlacementPoint
GET_REF_POS NULL PlacementPoint position
DECLARE_STRUCT UV_PARAM uv_param
CALC_POS_PARAM NULL PlacementReference position uv_param.u uv_param.v
!
! create surface finish on selection point of the surface
!
DECLARE_STRUCT SURFACE_FINISH surface_finish_option
surface_finish_option.value = 32
!
! set the symbol options
!
surface_finish_option.symbol_options.named_orientation = TRUE
surface_finish_option.symbol_options.view_orientation = "FRONT"
GET_CONFIG_OPTION "pro_surface_finish_dir" surfFinishDir
surface_finish_option.symbol_options.path = surfFinishDir +
"\\generic\\standard.sym"

! placement options
surface_finish_option.symbol_options.placement_type = "ON_ENTITY"
surface_finish_option.symbol_options.placement_ref =
PlacementReference
SET_REF_UV_PARAM surface_finish_option.symbol_options.placement_ref
uv_param
surface_finish_option.symbol_options.height = 1.0

CREATE_SURFFINISH PlacementReference surface_finish_option surffin


§
CALC_ORIENTATION
Determines the orientation of a curve, a composite curve or an edge
related to a direction vector.
Syntax
CALC_ORIENTATION refCurveOrEdge<:in> vector<:in> [options]
parameter<:out>
Arguments

refCurveOrEdge
Reference to a curve, a composite curve or an edge.

vector
Structure variable of type VECTOR. Defines the direction from which
the curve or edge is regarded.

options
The following options are supported:
ORIGIN refOrigin — to use an origin to calculate the orientation.

parameter
Name of the string parameter which receives the result. The following
results are possible:
CW — the curve is clockwise oriented related to the direction
vector.
CCW — the curve is counter clockwise oriented related to the
direction vector.
AMBIGUOUS — the orientation of the curve can not be determined
related to the direction vector.
Error handling
The program execution will be canceled if the references to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPOSITE_CURVE curve
USER_SELECT CSYS csys
GET_CSYS_VECTOR NULL csys "X" vecDirection
CALC_ORIENTATION curve vecDirection orient
PRINT "%" orient
§
CALC_TRANSFORMATION
Calculates the transformation between two models or coordinate
systems.
Syntax
CALC_TRANSFORMATION refFrom<:in> refTo<:in> transformation<:out>
Arguments

refFrom
Reference to the model from which the transformation is calculated.
In case the reference is a coordinate system, this will be its
orientation will be used for the transformation, otherwise the
orientation of the model will be used.

refTo
Reference to the model to which the transformation is calculated. In
case the reference is a coordinate system, this will be its
orientation will be used for the transformation, otherwise the
orientation of the model will be used.

transformation
Structure variable of type TRANSFORMATION will receive the
calculation result.
Error handling
The program execution will be canceled if the references do not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT CSYS coord
CALC_TRANSFORMATION ASSEMBLY coord transform
PRINT "displacement: % % % " transform.trans_x transform.trans_y
transform.trans_z
PRINT "rotation: % % % " transform.rot_x transform.rot_y
transform.rot_z
§
CALC_TRANSFORM_POINT
Calculates the transformation of a point.
Syntax
CALC_TRANSFORM_POINT transformation<:in> point_in<:in>
point_out<:out>
Arguments

transformation
Existing structure variable of type TRANSFORMATION.

point_in
Existing structure variable of type POINT.

point_out
Structure variable of type POINT will receive the calculation result.
Example
SER_SELECT PART mdl
CALC_TRANSFORMATION ASSEMBLY mdl transformation
DECLARE_STRUCT POINT pnt
pnt.x = 0
pnt.y = 0
pnt.z = 0
CALC_TRANSFORM_POINT transformation pnt pnt_in_part
PRINT "Point in part: % % %", pnt_in_part.x pnt_in_part.y
pnt_in_part.z
§
CALC_TRANSFORM_VECTOR
Calculates the transformation of a vector.
Syntax
CALC_TRANSFORM_VECTOR transformation<:in> vector_in<:in>
vector_out<:out>
Arguments

transformation
Existing structure variable of type TRANSFORMATION.

vector_in
Existing structure variable of type VECTOR.

vector_out
Structure variable of type VECTOR will receive the result.
Example
USER_SELECT PART mdl
CALC_TRANSFORMATION ASSEMBLY mdl transformation
DECLARE_STRUCT VECTOR vec
vec.x = 0
vec.y = 0
vec.z = 0
CALC_TRANSFORM_VECTOR transformation vec vec_in_part
PRINT "Vector in part: % % %", vec_in_part.x vec_in_part.y
vec_in_part.z
§
CONCAT_TRANSFORMATION
Concatenates two transformations.
Syntax
CONCAT_TRANSFORMATION transform1<:in> transform2<:in>
transformationResult<:out>
Arguments

transform1
Existing structure variable of type TRANSFORMATION.

transform2
Existing structure variable of type TRANSFORMATION.

transformationResult
Name of structure variable of type TRANSFORMATION will receive
calculation result.
Example
USER_SELECT MODEL model1
USER_SELECT MODEL model2
CALC_TRANSFORMATION model1 ASSEMBLY transModel1ToAsm
CALC_TRANSFORMATION ASSEMBLY model2 transAsmToModel2
CONCAT_TRANSFORMATION model1 model2 transModel1ToModel2
§
CONVERT_TRANSFORMATION_TO_MATRIX
Converts a transformation to a matrix.
Syntax
CONVERT_TRANSFORMATION_TO_MATRIX transform<:in> matrix<:out>
Arguments

transform
Existing structure variable of type TRANSFORMATION.

matrix
Name of structure variable of type MATRIX will receive the
calculation result.
Example
USER_SELECT MODEL model
CALC_TRANSFORMATION model ASSEMBLY transModelToAsm
CONVERT_TRANSFORMATION_TO_MATRIX transModelToAsm matrixModelToAsm
§
CONVERT_MATRIX_TO_TRANSFORMATION
Converts a matrix to a transformation by calculating its Euler
Angles.
Syntax
CONVERT_MATRIX_TO_TRANSFORMATION matrix<:in> transformation<:out>
Arguments

matrix
Existing structure variable of type MATRIX.

transform
Name of structure variable of type TRANSFORMATION will receive the
calculation result.
Example
USER_SELECT MODEL model
GET_ORIENTATION_MATRIX model matrix
CONVERT_MATRIX_TO_TRANSFORMATION matrix transform
§
NORMALIZE_MATRIX
Normalizes a matrix and converts it to a right-hand system if
required.
Syntax
NORMALIZE_MATRIX matrix<:in> [options]
Arguments

matrix
Existing structure variable of type MATRIX.

options
The following options are supported:
UPDATE_VECTOR number<:in> — in case a matrix is not a right-handed
system usually the last direction vector is changed. With this option
the vector can be chosen. 0 is the first direction vector, 1 the
second and 2 the last.
Example
NORMALIZE_MATRIX matrix UPDATE_VECTOR 0
§
INVERT_MATRIX
Calculates the inverse of a matrix.
Syntax
INVERT_MATRIX matrix<:in>
Arguments

matrix
Existing structure variable of type MATRIX.
Example
INVERT_MATRIX matrix
§
VECTOR_NORMALIZE
Normalizes a vector to the unit length 1.
Syntax
NORMALIZE_VECTOR vector<:in>
Arguments

vector
Existing structure variable of type VECTOR.
Example
DECLARE_STRUCT VECTOR vec
vec.x = 100
vec.y = 100
vec.z = 0
VECTOR_NORMALIZE vec
PRINT "vec: %/%/%" vec.x vec.y vec.z
§
VECTOR_GET_LENGTH
Calculates the length of a vector.
Syntax
VECTOR_GET_LENGTH vector<:in> length<:out>
Arguments

vector
Existing structure variable of type VECTOR.

length
Name of the variable which receives the calculated length as a double
value.
Example
DECLARE_STRUCT VECTOR vec
vec.x = 100
vec.y = 100
vec.z = 0
VECTOR_GET_LENGTH vec length
PRINT "length: %" length
§
VECTOR_DOT_PRODUCT
Calculates the dot product (also called scalar product or inner
product) of two vectors.
Syntax
VECTOR_DOT_PRODUCT vector1<:in> vector2<:in> dot_product<:out>
Arguments

vector1
Existing structure variable of type VECTOR.

vector2
Existing structure variable of type VECTOR.

dot_product
Name of the variable which receives the calculated dot product as a
double value.
Example
! calculates the angle between two vectors by the formula:
! cos(a) = |v1 * v2| / |vec1|*|vec2|

VECTOR_DOT_PRODUCT vec1 vec2 valueDot

VECTOR_GET_LENGTH vec1 lenVec1


VECTOR_GET_LENGTH vec2 lenVec2

DECLARE_VARIABLE DOUBLE angle


angle = acos(abs(valueDot)/ (lenVec1 * lenVec2))

PRINT "Angle: %" angle * 180/PI


§
VECTOR_CROSS_PRODUCT
Calculates the cross product (also called vector product or outer
product) of two vectors.
Syntax
VECTOR_CROSS_PRODUCT vector1<:in> vector2<:in>
vector_cross_product<:out>
Arguments

vector1
Existing structure variable of type VECTOR.

vector2
Existing structure variable of type VECTOR.

vector_cross_product
Name of the structure variable of type VECTOR which will receive the
calculated cross product vector.
Example
! calculates the angle between two vectors by the formula:
! sin(a) = |cross<v1, v2| / |vec1|*|vec2|

VECTOR_CROSS_PRODUCT vec1 vec2 vecCross

VECTOR_GET_LENGTH vecCross lenCross


VECTOR_GET_LENGTH vec1 lenVec1
VECTOR_GET_LENGTH vec2 lenVec2

DECLARE_VARIABLE DOUBLE angle


angle = asin(lenCross / (lenVec1 * lenVec2))

PRINT "Angle: %" angle * 180/PI


§
VECTOR_FROM_POINTS
Calculates the direction vector from a start point to an end point.
Syntax
VECTOR_FROM_POINTS pntFrom<:in> pntTo2<:in> vector_direction<:out>
Arguments

pntFrom
Existing structure variable of type POINT for the start point of the
vector.

pntTo
Existing structure variable of type POINT for the end point of the
vector.

vector_directiont
Name of the structure variable of type VECTOR which will receive the
calculated direction vector from the first to the second point..
Example
DECLARE_STRUCT POINT pnt1
DECLARE_STRUCT POINT pnt2

pnt1.x = 100
pnt1.y = 0
pnt1.z = 0

pnt2.x = 0
pnt2.y = 100
pnt2.z = 24

VECTOR_FROM_POINTS pnt1 pnt2 vecDirection


PRINT "%/%/%" vecDirection.x vecDirection.y vecDirection.z
§
CALC_FORMULA
Calculates a formula by a string expression. Variable used in the
formula must be available in SmartAssembly. Otherwise the calculation
fails.
Syntax
CALC_FORMULA "formula" result<:out>
Arguments

formula
Formula which should be calculated. Any string expression is allowed.

result
Variable of type double which receives the calculation result.
Error handling
The program execution will be canceled if the formula can't be
calculated, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_VARIABLE DOUBLE D1 12.0
DECLARE_VARIABLE DOUBLE D2 73.2
CALC_FORMULA "D1 + D2" result
PRINT "Result: %" result
§
CALC_FRACTION
Calculates fraction values and strings.
Syntax
CALC_FRACTION [option] numberDOUBLE denominatorINT fraction<:out>
Arguments

option
The following options are supported:
REDUCE valueBOOL — determines if the denominator should be reduced.
As default it will not be reduced.

number
Number which for which the fraction should be calculated.

denominator
Denominator for which the fraction should be calculated.

fraction
Name of the structure variable of type FRACTION.
Example
CALC_FRACTION REDUCE TRUE 1.5 32 fraction
PRINT "integer: %" fraction.integer
PRINT "remainder: %" fraction.remainder
PRINT "denominator: %" fraction.denominator
PRINT "fraction_string: %" fraction.fraction_string
§
CALC_POINT_ON_LINE
Calculates if a point is located on a line or a segment and its
projection point on it.
Syntax
CALC_POINT_ON_LINE [option] point<:in> line<:in> varPntOnLine<:out>
proj_point<:out>
Arguments

option
The following options are supported:
ON_SEGMENT valueBOOL — determines if the test if done for the line or
for the segment. As default it will be calculated regarding the line.

point
Structure variable of type POINT defines the point to calculate.

line
Structure variable of type LINE defines the line or the segment which
should be used for the test.

varPntOnLine
Name of the boolean variable which receives the result of the
calculation.

proj_point
Name of the structure variable of type POINT which receives the
projection point information.
Example
SEARCH_MDL_REF PART POINT "start" startPoint
SEARCH_MDL_REF PART POINT "end" endPoint

DECLARE_STRUCT LINE line


GET_REF_POS NULL startPoint line.pnt_from
GET_REF_POS NULL endPoint line.pnt_to

SEARCH_MDL_REF PART POINT "PNT_ON_LINE" pnt1


GET_REF_POS NULL pnt1 pnt

CALC_POINT_ON_LINE ON_SEGMENT TRUE pnt line bOnLine pntProj


§
EXEC_MDLCHECK
Performs a ModelCHECK analysis similar to Analysis > ModelCHECK >
ModelCHECK Interactive.
Syntax
EXEC_MDLCHECK refMdl<:in> mdlcheck_option<:in> mdlcheck_result<:out>
Arguments

refMdl
Reference to an existing model.

mdlcheck_option
Existing structure variable of type MDLCHECK_OPTION.

mdlcheck_result
Structure variable of type MDLCHECK_RESULT will receive the results.
Error handling
The program execution will be canceled if the model does not exist of
the ModelCHECK analysis fails, unless errors are handled by
BEGIN_CATCH_ERROR.

Note
In some situations ModelCHECK is prompting the user if all models of
a drawing should be executed. This can be answered by the MAPKEY
command with option EXEC_AT_END if it is placed before the
EXEC_MDLECHECK command.
Example
DECLARE_STRUCT MDLCHECK_OPTION option
option.show_results = FALSE
! Enter the mapkey "Y" to answer the question from ModelCHECK.
MAPKEY "Y" EXEC_AT_END
EXEC_MDLCHECK mdl option result
PRINT "% errors" result.num_errors
PRINT "% warnings" result.num_warnings
§
CHECK_EXTRUDE_OUTLINE
Inspects if the sketched contour of an extrude feature exceeds the
geometry. This is typically used to test if an extruded cut is
completely or partly outside the solid geometry.
Syntax
CHECK_EXTRUDE_OUTLINE [options] reference_to_extrude<:in>
result<:out>
Arguments

options
The following options are supported:

USE_INSERT_MODE valueBOOL — determines if the prior to the test the


insert mode should be set directly after the extrude feature.
Default is FALSE.

reference_to_extrude
Reference to the extrude feature.

result
Name of the boolean variable which receives the result if the outline
is inside the solid geometry. The result TRUE means that the outline
is in solid geometry while FALSE means that it exceeds the geometry.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE cut_feature
CHECK_EXTRUDE_OUTLINE USER_INSERT_MODE FALSE cut_feature
bOutlineInSolidGeometry
IF bOutlineInSolidGeometry == FALSE
PRINT "The outline is exceeded"
END_IF
About Commands for Retrieving Information
Commands for retrieving different types of information like names,
types, dependencies etc.
The following commands are available:
GET_REF_ID — to retrieve the Creo Elements/Pro id of a reference.
GET_REF_ACP_OWNER — to retrieves the owner of the assembly
component path of a reference.
GER_REF_ACP_IDS — to retrieve the ids of the assembly component
path of a reference.
GET_REF_TYPE — to retrieve the type of a reference.
GET_REF_NAME — to retrieve the name of a reference.
GET_REF_VERTEX — to retrieve the vertex of an edge, curve or
composite curve reference.
GET_REF_OWNER — to retrieve the owning model of a reference. For a
reference to a model, this is the model itself.
GET_REF_PARENT — to retrieve the parent of a reference.
GET_REF_COMMON_PARENT — to retrieve the most immediate model which
includes all specified references.
GET_REF_CHILD — to retrieve a child of the reference, by specifying
the component ids.
GET_PNT_COORD — to retrieve the coordinates of a point.
GET_PNT_INDEX — to retrieve index of a point in a point feature.
GET_COMPCURVE_CURVES — to retrieve all curves of a composite curve.
GET_CURVE_COMPCURVE — to retrieve the composite curve of a curve.
GET_CURVE_PNT_RATIO — to retrieve the ratio of a selection position
on a curve.
GET_CURVE_LENGTH — to compute the length of a curve based on
optional start and end references.
GET_CURVE_AT_POS — to determine the curve among an array of curves
which contains the specified position.
GET_CURVES_AT_POS — to determine the curves among an array of
curves which contain the specified position.
GET_CURVE_TYPE — to retrieve the type of a curve.
GET_CURVE_TESSELLATION — to compute the tessellation of a curve or
a composite curve.
GET_EDGE_PNT_RATIO — to retrieve the ratio of the selection
position on an edge.
GET_EDGE_LENGTH — to compute the length of an edge based on
optional start and end reference.
GET_EDGE_AT_POS — to determine the edge among an array of edges
which contains the specified position.
GET_EDGES_AT_POS — to determine the edges among an array of edges
which contain the specified position.
GET_EDGE_TYPE — to retrieve the type of an edge.
GET_EDGE_SURFACES — to retrieve the two neighbour surfaces of an
edge.
GET_LINE_DATA — to retrieve the shape information of a linear edge
or curve.
GET_ARC_DATA — to retrieve the shape information of an arc edge or
curve.
GET_AXIS_DATA — to retrieve origin and direction of an axis.
GET_SURFACE_AT_POS — to determine the surface among an array of
surface which contains the specified position.
GET_SURFACES_AT_POS — to determine the surfaces among an array of
surfaces which contain the specified position.
GET_SURFACE_TYPE — to retrieve the geometrical type of a surface.
GET_SURFACE_SETUP_TYPE — to retrieve the setup type of a surface.
GET_SURFACE_NORM — to determine the normal vector on a surface.
GET_SURFACE_CONTOUR — to retrieve the information about one contour
of a surface.
GET_SURFACE_CONTOURS — to retrieve the information about all
contours of a surface.
GET_SURFACE_REV_AXIS — to retrieves the reference to an axis from a
cylinder or cone surface reference.
GET_SURFACE_QUILT — to retrieve the reference to a quilt from a
surface.
GET_QUILT_SURFACES — to retrieve the references of all surfaces
which belong to the quilt.
GET_INTENT_MEMBERS — to retrieve the reference of all members which
belong to an intent edge or surface.
GET_FEATURE_NAME — to retrieve the name of a feature.
GET_FEATURE_TYPE — to retrieve the type of a feature.
GET_FEATURE_FORM_TYPE — to retrieve the form type of a material
operation feature.
GET_FEATURE_TYPE_NAME — to retrieve the type name of a feature as
it shows up in the model tree in the row "Feat Type".
GET_FEATURE_SUBTYPE_NAME — to retrieves the sub type name of a
feature as it shows up in the model tree in the row "Feat Subtype".
GET_FEATURE_NUMBER — to retrieve the feature number as shown in the
model tree.
GET_FEATURE_FROM_GEOM — to retrieve the feature which owns a
geometry item.
GET_GEOM_FROM_FEATURE — to retrieve the first geometry item of a
specific type from a feature.
GET_GEOMS_FROM_FEATURE — to retrieve all geometry items of a
specific type from a feature.
GET_REF_DEPEND_CHILD — to retrieve the first dependent child
feature of a reference.
GET_REF_DEPEND_CHILD_EX — to retrieve detailed information of the
first dependent child feature of a reference.
GET_REF_DEPEND_CHILDREN — to retrieve all dependent child features
of a reference.
GET_REF_DEPEND_CHILDREN_EX — to retrieve detailed information of
all dependent child features of a reference.
GET_REF_DEPEND_PARENT — to retrieve the first dependent parent
feature of a reference.
GET_REF_DEPEND_PARENT_EX — to retrieve detailed information of the
first dependent parent feature of a reference.
GET_REF_DEPEND_PARENTS — to retrieve all dependent parent features
of a reference.
GET_REF_DEPEND_PARENTS_EX — to retrieve detailed information of all
dependent parent features of a reference.
GET_BREAKABLE_MDL_DEPENDENCY_STATE — to retrieve the installation
if a model has breakable dependencies. This helps to detect ghost
objects.
BREAK_MDL_DEPENDENCY — to break dependencies of a model. This helps
to remove references to ghost objects.
GET_MDL_DEPENDENCIES — to determine dependent models.
GET_MDL_TEXTS — to search in solid models and drawings for text
information with font definitions.
GET_REF_STATE — to retrieve the state of a reference like frozen or
active.
GET_REF_POS — to retrieve the position of a geometrical reference.
SET_REF_POS — to set the internal position on a geometrical
reference.
GET_REF_UV_PARAM — to retrieve the uv position on a geometrical
reference.
SET_REF_UV_PARAM — to set the uv position on a geometrical
reference.
GET_CSYS_VECTOR — to retrieve a direction vector from a coordinate
system.
COMPARE_REF_ORDER — to compare the order in the model tree.
GET_DIM_TEXT — to retrieve a dimension text.
GET_DIM_PREFIX — to retrieve a dimension prefix.
GET_DIM_SUFFIX — to retrieve a dimension suffix.
GET_DIM_VALUE — to retrieve a dimension value.
GET_DIM_SYMBOL — to retrieve a dimension symbol.
GET_DIM_TYPE — to retrieve the type of a dimension.
GET_DIM_SETUP_TYPE — to retrieve the setup type of a dimension.
GET_DIM_DISPLAY_TYPE — to retrieve the display type of a dimension.
GET_DIM_TOL — to retrieve upper and lower limits of a dimension
tolerance.
GET_DIM_TOL_TYPE — to retrieve the tolerance type of a dimension.
GET_DIM_TOL_TABLE — to retrieve the tolerance table of a dimension.
GET_DIM_DECIMALS — to retrieve the number of decimals values of a
dimension.
GET_DIM_BOUND — to retrieve the dimension boundary.
GET_DIM_DISPLAY_ROUNDED — to retrieve the information if the
dimension is displayed as a rounded value.
GET_DIM_DISPLAY_ROUNDED_ACCESSIBLE — to retrieve the information if
the rounded dimension value checkbox is accessible.
GET_DIM_VALUE_DISPLAY_TYPE — to retrieve the value display type of
a created dimension.
GET_DIM_OVERRIDE_VALUE — to retrieve the override value of a
created dimension.
GET_DIM_FRACTIONAL — to retrieve the information if a solid
dimension is shown in fractional format.
GET_DIM_FEATURE — to retrieve the feature which owns a dimension.
GET_FEATURE_DIMS — to retrieve all dimensions of a feature.
GET_DIM_MDL — to retrieve the model with owns a dimension.
GET_MDL_DIMS — to retrieve all dimensions of a model.
GET_MDL_PARAM_DESIGNATION_STATUS — to inquiry whether a model
parameter is designated.
GET_FEAT_PARAM_DESIGNATION_STATUS — to inquiry whether a feature or
component feature parameter is designated.
GET_ATTRIBUTE_DESIGNATION_STATUS — to inquiry which a dimension,
geometrical tolerance or surface finish is designated.
GET_MDL_PARAM_LOCK_STATUS — to read the lock status of a model
parameter.
GET_FEAT_PARAM_LOCK_STATUS — to read the lock status of a feature
parameter.
GET_REF_PARAM_LOCK_STATUS — to read the lock status of a reference
parameter.
GET_MDL_PARAM_DESCRIPTION – to read the description of a model
parameter.
GET_FEAT_PARAM_DESCRIPTION — to read the description of a feature
parameter.
GET_REF_PARAM_DESCRIPTION — to read the description of a reference
parameter.
GET_ENUMERATED_MDL_PARAM_VALUES — to retrieve all values for a
restricted enumerated model parameter.
GET_ENUMERATED_FEAT_PARAM_VALUES — to retrieve all values for a
restricted enumerated feature parameter.
GET_ENUMERATED_REF_PARAM_VALUES — to retrieve all values for a
restricted enumerated reference parameter.
GET_MDL_FAILURE_FLAG — to inspect if a model contains any failed
features.
GET_MDL_REGEN_STATE — to retrieve the regeneration state of a solid
model.
GET_UDF_DATA — to retrieve the data from an UDF.
GET_CONSEC_FEAT_PARAM_INDEX — to get the next available index for a
new consecutive parameter on feature or component feature level.
GET_CONSEC_MDL_PARAM_INDEX — to get the next available index for a
new consecutive parameter on part or assembly level.
REFERENCE_TO_STRING — to convert a reference variable to strings.
STRING_TO_REFERENCE — to construct a reference variable from
strings.
RETRIEVE_REFERENCE — to retrieve reference information stored via
SAVE_REFERENCE to a component feature.
GET_REF_ID
Gets Creo Elements/Pro id of a specified reference.
Syntax
GET_REF_ID reference<:in> parameter<:out>
Arguments

reference
Name of an existing reference.

parameter
Name of the parameter which should receive the information.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_REF_ID placement_point paramId
GET_REF_ACP_OWNER
Retrieves the owner of the assembly component path of a reference.
Syntax
GET_REF_ACP_OWNER reference<:in> refOwner<:out>
Arguments

reference
Name of an existing reference.

refOwner
Name of the reference which will receive the information about the
owner of the assembly component path.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The assembly component path of a reference describes the information
in which component a reference is located. The owner is the top level
model from which the reference was searched or selected.
Example
GET_REF_ACP_OWNER placement_point acpOwner
GET_REF_ACP_IDS
Retrieves the ids of the assembly component path of a reference.
Syntax
GET_REF_ACP_IDS reference<:in> arrayIds<:out>
Arguments

reference
Name of an existing reference.

arrayIds
Name of the array which will receive all ids of the assembly
component path as integer numbers.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The assembly component path of a reference describes the information
in which component a reference is located. The ids are corresponding
to the feature numbers which are shown for components in the model
tree.
Example
GET_REF_ACP_IDS placement_point arrayIds
FOR id REF ARRAY arrayIds
PRINT "%" id
END_FOR
GET_REF_TYPE
Gets type of a specified reference.
Syntax
GET_REF_TYPE reference<:in> parameter<:out>
Arguments

reference
Name of an existing reference.

parameter
Name of the parameter which should receive the information. The
content will be one of the reference types or UNKNOWN.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
SURFACE is the result for the different surface setup types
SOLID_SURFACE, QUILT_SURFACE and PLANE., as result. Use
GET_SURFACE_SETUP_TYPE for retrieving detailed information of the
surface setup.
Example
GET_REF_TYPE placement_point paramType
GET_REF_NAME
Gets name of a specified reference.
Syntax
GET_REF_NAME reference<:in> parameter<:out>
Arguments

reference
Name of an existing reference.

parameter
Name of the variable which will receive the name. In case there is no
name the result will be UNKNOWN.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
If the reference is a geometry item in Creo Elements/Pro and does not
have a name (for edges and surfaces unless a name as be set
manually), the program execution will fail.
Example
GET_REF_NAME placement_point paramName
GET_REF_VERTEX
Gets a vertex to a specified reference to an edge, curve or composite
curve.
Syntax
GET_REF_VERTEX referenceCurve<:in> side referenceVertex<:out>
Arguments

reference
Name of an existing reference to an edge, curve or composite curve.

side
START: Get the vertex of the start point.
END: Get the vertex of the end point.

referenceVertex
Name of the reference which will receive the vertex.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_REF_VERTEX refCurve START refVertexStart
GET_REF_VERTEX refEdge END refVertexEnd
GET_REF_OWNER
Gets the owner of a specified reference. For features and geometrical
entities the owner is the part or assembly which contains them. The
owner of a part or assembly is the model itself.
Syntax
GET_REF_OWNER reference<:in> referenceOwner<:out>
Arguments

reference
Name of an existing reference.

referenceOwner
Name of the reference which will receive the owner of the specified
reference.
Error handling
The program execution will be canceled if the reference does not
exist or the owner could not be detected, unless errors are handled
by BEGIN_CATCH_ERROR.
Note
The difference to GET_REF_PARENT is, that GET_REF_OWNER searches for
the model which contains the reference.
Example
! Assumed placement_point is in part prt001 which is a component of
assembly asm0001
! The following line gets prt0001 as owner of the point
GET_REF_OWNER placement_point mdlOwner
! The following line gets asm0001 as parent model of the point
GET_REF_PARENT placement_point mdlParent
GET_REF_PARENT
Gets the parent of the owner of a specified reference.
Syntax
GET_REF_PARENT reference<:in> referenceParent<:out>
Arguments

reference
Name of an existing reference.

referenceParent
Name of the reference which will receive the parent of the specified
reference.
Error handling
The program execution will be canceled if the reference does not
exist or the parent could not be detected, unless errors are handled
by BEGIN_CATCH_ERROR.
Note
The difference to GET_REF_OWNER is, that GET_REF_PARENT searches for
the model which contains the owner.
Example
! Assumed placement_point is in part prt001 which is a component of
assembly asm0001
! The following line gets prt0001 as owner of the point
GET_REF_OWNER placement_point mdlOwner
! The following line gets asm0001 as parent model of the point
GET_REF_PARENT placement_point mdlParent
§
GET_REF_COMMON_PARENT
Retrieves the most immediate model which includes all specified
references.
Syntax
GET_REF_COMMON_PARENT arrayReferences<:in> reference<:out>
Arguments

arrayReferences
Name of an existing array of references.

reference
Name of the reference for the immediate parent which includes all
specified references.
Error handling
The program execution will be canceled if the array of references
does not exist or the parent could not be detected, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS RECURSIVE ASSEMBLY COMPONENT "0815*" arrayComponents
GET_REF_COMMON_PARENT arrayComponents refParent
GET_REF_CHILD
Gets the child model of a specified reference by declaring the path.
The path is relative to the owner of the specified reference.
Syntax
GET_REF_CHILD reference<:in> "path" referenceChild<:out>
Arguments

reference
Name of an existing reference.

path
The path for the child model is build up with it component ids,
separated by dots. Any string expression is allowed.

referenceOwner
Name of the reference which will receive the child model of the
specified reference.
Error handling
The program execution will be canceled if the reference does not
exist or the child could not be detected, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
! Assumed that the point is located in the main assembly and there
exists a sub assembly with component id 17, the reference could be
retrieved by the following command:
GET_REF_CHILD placement_point 17 refChildAsm
! Assumed that the child assembly contains a part with component id
2, the reference could be retrieved by the following command:
GET_REF_CHILD placement_point 17.23 refChildPrt
GET_PNT_COORD
Determines coordinates of a point.
Syntax
GET_PNT_COORD reference_origin<:in> reference_pnt<:in> paramX<:out>
paramY<:out> paramZ<:out>
Arguments

reference_origin
Determines the origin for measuring the point coordinates. The
following situations have to be regarded:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to owner of the point in the
second argument.

reference_pnt
Reference indicating a point. This could be either a point,
coordinate system, curve start or end points, edge start or end
points or a feature which contains a point. Any other kind of
reference will cause an error.

paramX
Name of the output parameter of the x coordinate.

paramY
Name of the output parameter of the y coordinate.

paramZ
Name of the output parameter of the z coordinate.
Error handling
The program execution will be canceled if the origin reference or the
point reference do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
! measure coordinates with respect to a csys
GET_PNT_COORD ref_csys ref_pnt X Y Z
! measure coordinates with respect to the owning model
GET_PNT_COORD NULL ref_pnt X Y Z
§
GET_PNT_INDEX
Determines the index of a point inside a point feature.
Syntax
GET_PNT_INDEX reference_pnt<:in> paramIndex<:out>
Arguments

reference_pnt
Reference to a point feature.

paramIndex
Name of the output parameter for the index.
Error handling
The program execution will be canceled if the point reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT_POINT pnt
GET_PNT_INDEX pnt index
PRINT "Index: %" index
§
GET_COMPCURVE_CURVES
Retrieves an array of curves from one composite curve.
Syntax
GET_COMPCURVE_CURVES referenceCompCurve<:in> array<:out>
Arguments

referenceCompCurve
Name of an existing reference to a composite curve.

array
Name of the array which should receive the curve references.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_COMPCURVE_CURVES refCompCurve arrayCurves
GET_ARRAY_SIZE arrayCurves numCurves
DECLARE_VARIABLE INTEGER i
i = 0
WHILE i < numCurves
GET_ARRAY_ELEM arrayCurves i curve
HIGHLIGHT_REF curve
WAIT
i++
END_WHILE
§
GET_CURVE_COMPCURVE
Searches the composite curve which contains the specified curve.
Syntax
GET_CURVE_COMPCURVE reference_curve<:in> reference_compcurve<:out>
Arguments

reference_curve
Name of an existing reference to a curve.

reference_compcurve
Name of the reference which should receive the composite curve.
Error handling
The program execution will be canceled if the reference to the curve
does not exist or if no composite curve contains it, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT CURVE refCurve
GET_CURVE_COMPCURVE refCurve refCompCurve
GET_CURVE_PNT_RATIO
Computes the ratio of the selection position on a curve. This could
be used for example to calculate the ratio for a point on curve UDF
based on the selection of the user.
Syntax
GET_CURVE_PNT_RATIO reference_curve<:in> parameter_ratio<:out>
Arguments

reference_curve
Name of an existing reference to a curve or composite curve.

parameter_ratio
Name of the parameter which should receive the calculated ratio.
Note
To calculate the ratio of a curve reference this reference mus be
selected by the user. If the reference was searched through
SEARCH_MDL_REF no information about the selection position is
available and the result will be random.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT CURVE refCurve
GET_CURVE_PNT_RATIO refCurve dimRatio
CREATE_UDF pnt_on_curve THIS
UDF_REF REF_CURVE refCurve
UDF_DIM DIM_RATIO dimRatio
END_CREATE_UDF
GET_CURVE_LENGTH
Computes the length of a curve or a composite curve based on optional
start and end references.
Syntax
GET_CURVE_LENGTH reference_curve<:in> reference_start<:in>
reference_end<:in> parameter_length<:out>
Arguments

reference_curve
Reference to a curve or composite curve.

reference_start
Reference to the point of the curve which should be used as start
point for the calculation. In case of a NULL or an undefined
reference the start point of the curve is used.

reference_end
Reference to the point of the curve which should be used as end point
for the calculation. In case of a NULL or an undefined reference the
end point of the curve is used.
Error handling
The program execution will be canceled if the reference to the curve
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT CURVE | COMPOSITE_CURVE refCurve
USER_SELECT POINT pntStart
USER_SELECT POINT pntEnd
GET_CURVE_LENGTH refCurve pntStart pntEnd lengthStartEnd
GET_CURVE_LENGTH refCurve NULL pntEnd lengthEnd
GET_CURVE_LENGTH refCurve pntStart NULL lengthStart
GET_CURVE_LENGTH refCurve NULL NULL length
§
GET_CURVE_RATIO_POS
Computes a curve position based on a ratio value which describes the
offset.
Syntax
GET_CURVE_RATIO_POS reference_origin<:in> reference_curve<:in>
ratioDOUBLE pos<:out>
Arguments

reference_origin
Determines the origin for which the position on the curve is
computed:
origin is a coordinate system
Curve position will be measured with respect to this coordinate
system.
NULL
Curve position will be measured in local coordinates of the model
to which the point belongs to.
Any other reference
Curve position will be measured with respect to the indicated
model.

reference_curve
Reference to a curve or a composite curve.

ratio
Ratio value for the offset on the curve. 0 is the begin of the curve
and 1 is its end. Any math expression is allowed.

pos
Structure variable of type POINT which receives the result.
Error handling
The program execution will be canceled if the origin reference or the
curve do not exist or if the curve position could not be calculated,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF ASSEMBLY CSYS "*" csys
USER_SELECT COMPOSITE_CURVE crv

GET_REF_UV_PARAM crv uv_param


GET_CURVE_RATIO_POS csys crv uv_param.u pos

DECLARE_STRUCT DTM_PNT_OFFSET_CSYS dtm_pnt_offset_csys


dtm_pnt_offset_csys.offset_csys = csys
ADD_ARRAY_ELEM dtm_pnt_offset_csys.array_points pos

CREATE_POINTS_EX crv dtm_pnt_offset_csys feature


§
GET_CURVE_AT_POS
Determines the curve among an array of curves which contains the
specified position.
Syntax
GET_CURVE_AT_POS reference_origin<:in> arrayCurves<:in> pos<:in>
refCurve<:out>
Arguments

reference_origin
Determines the origin for which the point is described:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to the indicated model.

arrayCurves
Array of curve references.

pos
Structure variable of type POINT specifies the position.

refCurve
Variable which receives the reference to the curve which contains the
position.
Error handling
The program execution will be canceled if the origin reference or the
curve array do not exist or if the curve could not be found for the
position, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS ASSEMBLY CURVE "*" allCurves
DECLARE_STRUCT POINT pnt
pnt.x = 100
pnt.y = 0
pnt.z = 0

GET_CURVE_AT_POS NULL allCurves pnt curve


PRINT "Curve at position: %" curve
§
GET_CURVES_AT_POS
Determines the curves among an array of curves which contains the
specified position.
Syntax
GET_CURVES_AT_POS reference_origin<:in> arrayCurves<:in> pos<:in>
arrayCurvesAtPos<:out>
Arguments

reference_origin
Determines the origin for which the point is described:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to the indicated model.

arrayCurves
Array of curve references.

pos
Structure variable of type POINT specifies the position.

arrayCurvesAtPos
Variable for an array which receives all reference to curves which
contains the position.
Error handling
The program execution will be canceled if the origin reference or the
curve array do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS ASSEMBLY CURVE "*" allCurves
DECLARE_STRUCT POINT pnt
pnt.x = 100
pnt.y = 0
pnt.z = 0

GET_CURVES_AT_POS NULL allCurves pnt arrayCurvesAtPos


FOR curve_at_pos REF ARRAY arrayCurvesAtPos
PRINT "Curve at position: %" curve_at_pos
END_FOR
GET_CURVE_TYPE
Gets type of a curve or composite curve
Syntax
GET_CURVE_TYPE reference_curve<:in> parameter_type<:out>
Arguments

reference_curve
Name of an existing reference to a curve or composite curve.

parameter_type
Name of the parameter which should receive the information. The
content will be one of the curve types or UNKNOWN.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
§
GET_CURVE_TESSELLATION
Computes the tessellation of a curve or a composite curve. The result
is an array of point coordinates. A tolerance value defines the
maximum allowed deviation of lines between the points and the curve.
Syntax
GET_CURVE_TESSELLATION reference_origin<:in> reference_curve<:in>
toleranceDOUBLE array_points<:out>
Arguments

reference_origin
Determines the origin for which the point coordinates are calculated:
origin is a coordinate system
Point coordinates will be calculated with respect to this
coordinate system.
NULL
Point coordinates will be calculated in local coordinates of the
model to which the curve belongs to.
Any other reference
Point coordinates will be measured with respect to the indicated
model.

reference_curve
Reference to a curve or a composite curve.

tolerance
Tolerance value which determines the maximum deviation between line
segments of the points and the curve. Any math expression is allowed.

array_points
Array of structure variables of type POINT which receives the result.
Error handling
The program execution will be canceled if the origin reference or the
curve do not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF ASSEMBLY CSYS "*" csys
USER_SELECT COMPOSITE_CURVE crv

GET_CURVE_TESSELLATION csys crv 1.0 arrayPoints

DECLARE_STRUCT DTM_PNT_OFFSET_CSYS dtm_pnt_offset_csys


dtm_pnt_offset_csys.array_points = arrayPoints
dtm_pnt_offset_csys.offset_csys = csys

CREATE_POINTS_EX crv dtm_pnt_offset_csys feature


§
GET_EDGE_PNT_RATIO
Computes the ratio of the selection position on an edge. This could
be used for example to calculate the ratio for a point on edge UDF
based on the selection of the user.
Syntax
GET_EDGE_PNT_RATIO reference_edge<:in> parameter_ratio<:out>
Arguments

reference_edge
Name of an existing reference to an edge.

parameter_ratio
Name of the parameter which should receive the calculated ratio.
Note
To calculate the ratio of an edge reference this reference mus be
selected by the user. If the reference was searched through
SEARCH_MDL_REF no information about the selection position is
available and the result will be random.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT EDGE refEdge
GET_EDGE_PNT_RATIO refEdge dimRatio
CREATE_UDF pnt_on_edge THIS
UDF_REF REF_EDGE refEdge
UDF_DIM DIM_RATIO dimRatio
END_CREATE_UDF
§
GET_EDGE_LENGTH
Computes the length of an edge based on optional start and end
references.
Syntax
GET_EDGE_LENGTH reference_edge<:in> reference_start<:in>
reference_end<:in> parameter_length<:out>
Arguments

reference_edge
Reference to an edge.

reference_start
Reference to the point of the edge which should be used as start
point for the calculation. In case of a NULL or an undefined
reference the start point of the edge is used.

reference_end
Reference to the point of the edge which should be used as end point
for the calculation. In case of a NULL or an undefined reference the
end point of the edge is used.
Error handling
The program execution will be canceled if the reference to the edge
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT EDGE refEdge
USER_SELECT POINT pntStart
USER_SELECT POINT pntEnd
GET_EDGE_LENGTH refEdge pntStart pntEnd lengthStartEnd
GET_EDGE_LENGTH refEdge NULL pntEnd lengthEnd
GET_EDGE_LENGTH refEdge pntStart NULL lengthStart
GET_EDGE_LENGTH refEdge NULL NULL length
§
GET_EDGE_AT_POS
Determines the edge among an array of edges which contains the
specified position.
Syntax
GET_EDGE_AT_POS reference_origin<:in> arrayEdges<:in> pos<:in>
refEdge<:out>
Arguments

reference_origin
Determines the origin for which the point is described:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to the indicated model.

arrayEdges
Array of edge references.

pos
Structure variable of type POINT specifies the position.

refEdge
Variable which receives the reference to the edge which contains the
position.
Error handling
The program execution will be canceled if the origin reference or the
edge array do not exist or if the edge could not be found for the
position, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS ASSEMBLY EDGE "*" allEdges
DECLARE_STRUCT POINT pnt
pnt.x = 100
pnt.y = 0
pnt.z = 0

GET_EDGE_AT_POS NULL allEdges pnt edge


PRINT "Edge at position: %" edge
§
GET_EDGES_AT_POS
Determines the edges among an array of edges which contains the
specified position.
Syntax
GET_EDGES_AT_POS reference_origin<:in> arrayEdges<:in> pos<:in>
arrayEdgesAtPos<:out>
Arguments

reference_origin
Determines the origin for which the point is described:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to the indicated model.

arrayEdges
Array of edge references.

pos
Structure variable of type POINT specifies the position.

arrayEdgesAtPos
Variable for an array which receives all reference to edges which
contains the position.
Error handling
The program execution will be canceled if the origin reference or the
edge array do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS ASSEMBLY EDGE "*" allEdges
DECLARE_STRUCT POINT pnt
pnt.x = 100
pnt.y = 0
pnt.z = 0

GET_EDGES_AT_POS NULL allEdges pnt arrayEdgesAtPos


FOR edge_at_pos REF ARRAY arrayEdgesAtPos
PRINT "Edge at position: %" edge_at_pos
END_FOR
GET_EDGE_TYPE
Gets type of an edge.
Syntax
GET_EDGE_TYPE reference_edge<:in> parameter_type<:out>
Arguments

reference_edge
Name of an existing reference to an edge.

parameter_type
Name of the parameter which should receive the information. The
content will be one of the edge types or UNKNOWN.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
GET_EDGE_SURFACES
Retrieves the two neighbour surfaces of an edge.
Syntax
GET_EDGE_SURFACES refEdge<:in> refSurface1<:out> refSurface2<:out>
Arguments

refEdge
Name of an existing reference to an edge.

refSurface1
Name of the reference which receives the first neighbour surface.

refSurface2
Name of the reference which receives the second neighbour surface.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case a surface is not existing the command supplies an invalid
reference which can be interrogated by IF NOT REF_VALID. This
situation occurs for non closed quilt surfaces.
Example
USER_SELECT EDGE edge
GET_EDGE_SURFACES edge surface1 surface2
PRINT "%" surface1
PRINT "%" surface2
§
GET_LINE_DATA
Retrieves the shape information from a linear edge or a curve.
Syntax
GET_LINE_DATA referene_origin<:in> refEdgeOrCurve<:in> line<:out>
Arguments

reference_origin
Determines the origin for calculating the arc data. The following
situations have to be considered:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference

Point will be measured with respect to the indicated model.

refEdgeOrCurve
Name of an existing reference to an edge or a curve of type LINE.

line
Name of the structure variable of type LINE.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT EDGE edge
GET_EDGE_TYPE edge type
IF type == "LINE"
GET_LINE_DATA NULL edge lineData
PRINT "from: %/%/%" lineData.pnt_from.x lineData.pnt_from.y
lineData.pnt_from.z
PRINT "to: %/%/%" lineData.pnt_to.x lineData.pnt_to.y
lineData.pnt_to.z
ELSE_IF type == "ARC"
GET_ARC_DATA NULL edge arcData
PRINT "from: %/%/%" arcData.pnt_from.x arcData.pnt_from.y
arcData.pnt_from.z
PRINT "to: %/%/%" arcData.pnt_to.x arcData.pnt_to.y
arcData.pnt_to.z
PRINT "center: %/%/%" arcData.pnt_center.x arcData.pnt_center.y
arcData.pnt_center.z
PRINT "radiusto: %" arcData.radius
END_IF
§
GET_ARC_DATA
Retrieves the shape information of an arc edge or a curve.
Syntax
GET_ARC_DATA reference_origin<:in> refEdgeOrCurve<:in> arc<:out>
Arguments

reference_origin
Determines the origin for calculating the arc data. The following
situations have to be considered:
origin is a coordinate system
Arc will be measured with respect to this coordinate system.
NULL
Arc will be measured in local coordinates of the model to which the
point belongs to.
Any other reference
Arc will be measured with respect to the indicated model.

refEdgeOrCurve
Name of an existing reference to an edge or a curve of type ARC.

arc
Name of the structure variable of type ARC.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT CURVE curve
GET_CURVE_TYPE curve type
IF type == "LINE"
GET_LINE_DATA NULL edge lineData
PRINT "from: %/%/%" lineData.pnt_from.x lineData.pnt_from.y
lineData.pnt_from.z
PRINT "to: %/%/%" lineData.pnt_to.x lineData.pnt_to.y
lineData.pnt_to.z
ELSE_IF type == "ARC"
GET_ARC_DATA NULL edge arcData
PRINT "from: %/%/%" arcData.pnt_from.x arcData.pnt_from.y
arcData.pnt_from.z
PRINT "to: %/%/%" arcData.pnt_to.x arcData.pnt_to.y
arcData.pnt_to.z
PRINT "center: %/%/%" arcData.pnt_center.x arcData.pnt_center.y
arcData.pnt_center.z
PRINT "radiusto: %" arcData.radius
END_IF
§
GET_AXIS_DATA
Retrieves origin and direction of an axis.
Syntax
GET_AXIS_DATA reference_origin<:in> refAxis<:in> axis<:out>
Arguments

reference_origin
Determines the origin for calculating the axis data. The following
situations have to be considered:
origin is a coordinate system
Axis will be measured with respect to this coordinate system.
NULL
Axis will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Axis will be measured with respect to the indicated model.

refAxis
Name of an existing reference to an axis.

axis
Name of the structure variable of type AXIS.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT AXIS axis
GET_AXIS_DATA NULL axis data
PRINT "origin: %/%/%" data.origin.x data.origin.y data.origin.z
PRINT "direction: %/%/%" data.direction.x data.direction.y
data.direction
§
GET_SURFACE_AT_POS
Determines the surface among an array of surfaces which contains the
specified position.
Syntax
GET_SURFACE_AT_POS [options] reference_origin<:in> arraySurfaces<:in>
pos<:in> refSurface<:out>
Arguments

options
The following options are supported:
PRECISION valueDOUBLE— precision of the calculation. If the
precision is set to 0.0, the accuracy is used. Default is 0.0.

reference_origin
Determines the origin for which the point is described:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to the indicated model.

arraySurfaces
Array of surface references.

pos
Structure variable of type POINT specifies the position.

refSurface
Variable which receives the reference to the surface which contains
the position.
Error handling
The program execution will be canceled if the origin reference or the
surface array do not exist or if the surface could not be found for
the position, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS ASSEMBLY SURFACE "*" allSurfaces
DECLARE_STRUCT POINT pnt
pnt.x = 100
pnt.y = 0
pnt.z = 0

GET_SURFACE_AT_POS NULL allSurfaces pnt surface


PRINT "Surface at position: %" surface
§
GET_SURFACES_AT_POS
Determines the surfaces among an array of surfaces which contains the
specified position.
Syntax
GET_SURFACES_AT_POS [options] reference_origin<:in>
arraySurfaces<:in> pos<:in> arraySurfacesAtPos<:out>
Arguments

options
The following options are supported:
PRECISION valueDOUBLE— precision of the calculation. If the
precision is set to 0.0, the accuracy is used. Default is 0.0.

reference_origin
Determines the origin for which the point is described:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to the indicated model.

arraySurfaces
Array of surface references.

pos
Structure variable of type POINT specifies the position.

arraySurfacesAtPos
Variable for an array which receives all reference to surfaces which
contains the position.
Error handling
The program execution will be canceled if the origin reference or the
surface array do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS ASSEMBLY SURFACE "*" allSurfaces
DECLARE_STRUCT POINT pnt
pnt.x = 100
pnt.y = 0
pnt.z = 0

GET_SURFACES_AT_POS NULL allSurfaces pnt arraySurfacesAtPos


FOR surface_at_pos REF ARRAY arraySurfacestPos
PRINT "Surface at position: %" surface_at_pos
END_FOR
GET_SURFACE_TYPE
Gets geometrical type of a specified surface.
Syntax
GET_SURFACE_TYPE reference<:in> parameter<:out>
Arguments

reference
Existing reference of a surface.

parameter
Name of the parameter which should receive the information. The
content will be one of the surface types or UNKNOWN.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FACE surface
GET_SURFACE_TYPE surface surfaceType
GET_SURFACE_SETUP_TYPE
Gets setup type of a specified reference.
Syntax
GET_SURFACE_SETUP_TYPE reference<:in> parameter<:out>
Arguments

reference
Existing reference of a surface.

parameter
Name of the parameter which should receive the information. The
content will be one of the surface setup types or UNKNOWN.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FACE surface
GET_SURFACE_SETUP_TYPE surface surfaceSetupType
§
GET_SURFACE_NORM
Determines the normal vector on a surface. If the surface was
selected, the normal vector is determined in the selection position.
Otherwise the center point is used.
Syntax
GET_SURFACE_NORM reference_origin<:in> reference_surface<:in>
posPoint<:out> normVector<:out>
Arguments

reference_origin
Determines the origin for measuring the point coordinates. The
following situations have to be regarded:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to owner of the point in the
second argument.

reference_surface
Reference indicating a surface. Any other kind of reference will
cause an error.

posPoint
Name of the output variable of type POINT which will receive the
origin point on the surface of the norm vector.

posVector
Name of the output variable of type VECTOR which will receive the
norm vector.
Error handling
The program execution will be canceled if the origin reference or the
surface reference do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE surf
GET_SURFACE_NORM NULL surf pnt direction
§
GET_SURFACE_CONTOUR
Retrieves the information about one contour of a surface.
Syntax
GET_SURFACE_CONTOUR reference_surface<:in> "type" contour<:out>
Arguments

reference_surface
Reference indicating a surface. Any other kind of reference will
cause an error.

type
Type of the contour which is searched. Any string expression is
allowed. The following types are available:
EXTERNAL — the outside contour of the surface.
INTERNAL — an internal contour in the surface.
BOTH — either external or internal.

contour
Structure variable of type CONTOUR which will receive the contour
information.
Error handling
The program execution will be canceled if the surface reference does
not exist or the contour is not found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_SURFACE_CONTOUR surf INTERNAL contour
PRINT "type: %" contour.type
FOR edge REF ARRAY contour.array_edges
PRINT "\t%" edge
END_FOR
§
GET_SURFACE_CONTOURS
Retrieves the information about all contours of a surface.
Syntax
GET_SURFACE_CONTOURS reference_surface<:in> "type" contourArray<:out>
Arguments

reference_surface
Reference indicating a surface. Any other kind of reference will
cause an error.

type
Type of the contour which is searched. Any string expression is
allowed. The following types are available:
EXTERNAL — the outside contour of the surface.
INTERNAL — an internal contour in the surface.
BOTH — either external or internal.

contourArray
Array of structure variables of type CONTOUR which will receive the
contour information.
Error handling
The program execution will be canceled if the surface reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_SURFACE_CONTOURS surf EXTERNAL arrayContours
FOR contour REF ARRAY arrayContours
PRINT "type: %" contour.type
FOR edge REF ARRAY contour.array_edges
PRINT "\t%" edge
END_FOR
END_FOR
§
GET_SURFACE_REV_AXIS
Retrieves the reference to an axis from a cylinder or cone surface
reference.
Syntax
GET_SURFACE_REV_AXIS reference_surface<:in> refAxis<:out>
Arguments

reference_surface
Reference to an existing surface.

refAxis
Name of the variable which will receive the axis as reference.
Error handling
The program execution will be canceled if the surface reference does
not exist or the axis could not be found, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE srf
GET_SURFACE_REV_AXIS srf axis
PRINT "%" axis
§
GET_SURFACE_QUILT
Retrieves the reference to a quilt from a surface.
Syntax
GET_SURFACE_QUILT refSurface<:in> refQuilt<:out>
Arguments

refSurface
Reference to an existing surface.

refQuilt
Name of the variable which will receive the quilt as reference.
Error handling
The program execution will be canceled if the surface reference does
not exist or the quilt could not be found, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE srf
GET_SURFACE_QUILT srf quilt
PRINT "%" quilt
§
GET_QUILT_SURFACES
Retrieves the references of all surfaces which belong to the quilt.
Syntax
GET_QULT_SURFACES refQuilt<:in> arraySurfaces<:out>
Arguments

refQuilt
Reference to an existing quilt or to a surface which belongs to this
quilt.

arraySurfaces
Name of the array variable which will receive the references of the
contained surfaces.
Error handling
The program execution will be canceled if the quilt reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT QUILT qlt
GET_QUILT_SURFACES qlt surfaces
FOR surface REF ARRAY surfaces
PRINT "%" surface
END_FOR
§
GET_INTENT_MEMBERS
Retrieves the references of all members which belong to an intent
edge or surface.
Syntax
GET_INTENT_MEMBERS refIntent<:in> arrayIntentMembers<:out>
Arguments

refIntent
Reference to an existing intent edge or surface.

arrayIntentMembers
Name of the array variable which will receive the references of the
edges or surfaces which belong to the intent object.
Error handling
The program execution will be canceled if the intent reference does
not exit, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT INTENT_SURFACE intent
GET_INTENT_MEMBERS intent members
FOR member REF ARRAY members
PRINT "%" member
END_FOR
§
GET_FEATURE_NAME
Gets name of a specified feature.
Syntax
GET_FEATURE_NAME reference<:in> parameter<:out>
Arguments

reference
Name of an existing reference.

parameter
Name of the parameter which should receive the feature name
information. In case the name could not be determined it will be
UNKNOWN.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Unlike GET_REF_NAME this command shows the feature name of a
component feature.
Example
GET_FEATURE_NAME feature name
GET_FEATURE_TYPE
Retrieves type of a feature
Syntax
GET_FEATURE_TYPE reference_feature<:in> parameter_type<:out>
Arguments

reference_feature
Existing reference to a feature.

parameter_type
Name of the parameter which should receive the feature type.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The feature type follows the internal names in Creo. These differ
slightly from the types listed in the Creo Elements/Pro search tool.
In some situations material operation features share the same type.
Some of them can be distingished by the command
GET_FEATURE_FORM_TYPE.
Example
USER_SELECT FEATURE feat
GET_FEATURE_TYPE feat type
PRINT "Type: %" type
GET_FEATURE_FORM_TYPE
Retrieves the form type of a material operation feature. This form
type is not available of all kind of features and restricted to the
ones which are supported in Creo Toolkit.
Syntax
GET_FEATURE_FORM_TYPE reference_feature<:in> form_type<:out>
Arguments

reference_feature
Existing reference to a feature.

form_type
Name of the parameter which should receive the feature form type.
The following form types are available:
EXTRUDE — for feature which have been created by an extrusion
operation.
REVOLVE — for feature which have been created by a revolve
operation.
SWEEP — for feature which have been created by a sweep operation.
BLEND — This is currently not is use.
USE_SURFS — for solidify features.
FLAT — for flat fill features.
COPY — this is currently not in use.
SHUT — this is currently not in use.
SKIRT_EXT — for the moldbase skirt surface extension feature.
SKIRT_FILL — for the moldbase skirt surface fill feature.
PRTSPLIT — this is currently not in use.
UNKNOWN — for all other features.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
GET_FEATURE_FORM_TYPE feat form_type
PRINT "Form type: %" form_type
GET_FEATURE_TYPE_NAME
Retrieves the type name of a feature as it shows up in the model tree
in the row "Feat Type".
Syntax
GET_FEATURE_TYPE_NAME reference_feature<:in> parameter_type<:out>
Arguments

reference_feature
Existing reference to a feature.

parameter_type
Name of the parameter which should receive the feature type name.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The feature type name shows up in the configured Creo Elements/Pro
language and can differ between Creo Elements/Pro versions. Use
GET_FEATURE_TYPE if you have to distinguish between feature types in
the program file. GET_FEATURE_TYPE_NAME should only be used for
information output.
Example
USER_SELECT FEATURE feat
GET_FEATURE_TYPE_NAME feat type_name
PRINT "Type name: %" type_name
GET_FEATURE_SUBTYPE_NAME
Retrieves the subtype name of a feature as it shows up in the model
tree in the row "Feat Subtype".
Syntax
GET_FEATURE_SUBTYPE_NAME reference_feature<:in> parameter_type<:out>
Arguments

reference_feature
Existing reference to a feature.

parameter_type
Name of the parameter which should receive the feature type.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The feature sub type name shows up in the configured Creo
Elements/Pro language and can differ between Creo Elements/Pro
versions. Use GET_FEATURE_TYPE if you have to distinguish between
feature types in the program file. GET_FEATURE_SUBTYPE_NAME should
only be used for information output.
Example
USER_SELECT FEATURE feat
GET_FEATURE_SUBTYPE_NAME feat subtype_name
PRINT "Sub type name: %" subtype_name
GET_FEATURE_NUMBER
Retrieves the feature number as shown in the model tree.
Syntax
GET_FEATURE_NUMBER reference_feature<:in> parameter_number<:out>
Arguments

reference_feature
Existing reference to a feature.

parameter_number
Name of the parameter which should receive the feature number
Example
USER_SELECT FEATURE feat
GET_FEATURE_NUMBER feat number
PRINT "Feat #: %" number
GET_FEATURE_FROM_GEOM
Retrieves reference to a feature based on the specified reference to
a geometrical element (for example an edge, an axis etc.)
Syntax
GET_FEATURE_FROM_GEOM refGeom<:in> refFeature<:out>
Arguments

refGeom
Existing reference to a geometrical element in Creo Elements/Pro.

refFeature
Reference which will receive the feature which contains the
geometrical element.
Error handling
The program execution will be canceled if the geometry reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
To access a geometrical element from a feature use
GET_GEOM_FROM_FEATURE command.
GET_GEOM_FROM_FEATURE
Retrieves a geometry reference from a feature reference of the
specified type.
Syntax
GET_GEOM_FROM_FEATURE [options] referenceFeature<:in> type
referenceGeometry<:out>
Arguments

options
The following options are supported:
ALLOW_INACTIVE — to include also inactive geometry references.

referenceFeature
Name of an existing reference to a feature.

type
Geometrical types from the reference types.

referenceGeometry
Name of the reference which should receive the retrieved geometry
reference.
Error handling
The program execution will be canceled if the feature reference does
not exist or the geometry could not be detected, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
This command is useful if a geometrical reference needs to be
received from a feature reference. For example is a geometrical axis
should be retrieved from a feature with type AXIS. to access the
feature containing the geometrical element use GET_FEATURE_FROM_GEOM.
Example
GET_GEOM_FROM_FEATURE refFeatAxis AXIS refGeomAxis
§
GET_GEOMS_FROM_FEATURE
Retrieves all geometry references from a feature reference of the
specified type.
Syntax
GET_GEOMS_FROM_FEATURE [options] referenceFeature<:in> type
arrayGeometry<:out>
Arguments

options
The following options are supported:
ALLOW_INACTIVE — to include also inactive geometry references.

referenceFeature
Reference to an existing feature.

type
Geometrical type from the reference types.

arrayGeometry
Array which will receive the all geometrical references of the
specified type.
Error handling
The program execution will be canceled if the feature reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
This command is useful if all geometrical references should be
received from a feature. In case only one element is required, use
GET_GEOM_FROM_FEATURE.
§
GET_REF_DEPEND_CHILD
Determines child feature of a specified reference.
Syntax
GET_REF_DEPEND_CHILD [options] reference<:in> dependency
reference<:out>
Arguments

options
The following options are supported:
ALLOW_SUPPRESSED — also suppressed child features will be found.

MODEL_DEPENDENCIES valueBOOL — determines if model children should


be reported, instead the ones of the component. Default is FALSE.

reference
Existing reference to a feature or a geometrical item.

dependency
Determines if internal dependencies (in the same model), external
dependencies (to another mode) or both should be searched. To
determine the desired behaviour the following options are available:
INTERNAL — Search dependent features with local scope.
EXTERNAL — Search dependent features with external scope.
ALL — Search dependent features with all scope. Local scopes have
priority.

reference
Name of the reference which will receive the retrieved information.
Error handling
The program execution will be canceled if the supplied reference does
not exist or if no child feature could be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
This command will cause an error if no child feature was found unless
this is not handled. In case more than one child feature exists, the
first one will be found. For handling an arbitrary number of children
the command GET_REF_DEPEND_CHILDREN should be used.
Example
USER_SELECT FEATURE refFeature
GET_REF_DEPEND_CHILD refFeature INTERNAL childFeature
§
GET_REF_DEPEND_CHILD_EX
Determines child feature of a specified reference and provides
detailed information. This command extends the old
GET_REF_DEPEND_CHILD command.
Syntax
GET_REF_DEPEND_CHILD_EX [options] reference<:in> dependency
ext_ref<:out>
Arguments

options
The following options are supported:
MODEL_DEPENDENCIES valueBOOL — determines if model children should
be reported, instead the ones of the component. Default is FALSE.

reference
Existing reference to a feature or a geometrical item.

dependency
Determines if internal dependencies (in the same model), external
dependencies (to another mode) or both should be searched. To
determine the desired behaviour the following options are available:
INTERNAL — Search dependent features with local scope.
EXTERNAL — Search dependent features with external scope.
ALL — Search dependent features with all scope. Local scopes have
priority.

ext_ref
Structure variable of type EXT_REF which receives the retrieved
information.
Error handling
The program execution will be canceled if the supplied reference does
not exist or if no child feature could be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
This command will cause an error if no child feature was found unless
this is not handled. In case more than one child feature exists, the
first one will be found. For handling an arbitrary number of children
the command GET_REF_DEPEND_CHILDREN_EX should be used.
Example
USER_SELECT FEATURE refFeature
GET_REF_DEPEND_CHILD_EX refFeature INTERNAL ext_ref
PRINT "Reference to %" ext_ref.item_to
PRINT "State: %" ext_ref.state
§
GET_REF_DEPEND_CHILDREN
Determines child features of a specified reference.
Syntax
GET_REF_DEPEND_CHILDREN [options] reference<:in> dependency
array<:out>
Arguments

options
The following options are supported:
ALLOW_SUPPRESSED — also suppressed child features will be found.

MODEL_DEPENDENCIES valueBOOL — determines if model children should


be reported, instead the ones of the component. Default is FALSE..

reference
Existing reference to a feature or a geometrical item.

dependency
Determines if internal dependencies (in the same model), external
dependencies (to another model) or both should be searched. To
determine the desired behaviour the following options are available:
INTERNAL — Search dependent features with local scope.
EXTERNAL — Search dependent features with external scope.
ALL — Search dependent features with all scope. Local scopes have
priority.

array
Name of the array which will receive the retrieved information.
Error handling
The program execution will be canceled if the supplied reference does
not exist or if a error occurs when searching for child features,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refFeature
GET_REF_DEPEND_CHILDREN refFeature ALL arrayChildFeatures
§
GET_REF_DEPEND_CHILDREN_EX
Determines child features of a specified reference and provides
detailed information. This command extends the old
GET_REF_DEPEND_CHILDREN command.
Syntax
GET_REF_DEPEND_CHILDREN_EX [options] reference<:in> dependency
array<:out>
Arguments

options
The following options are supported:
MODEL_DEPENDENCIES valueBOOL — determines if model children should
be reported, instead the ones of the component. Default is FALSE.

reference
Existing reference to a feature or a geometrical item.

dependency
Determines if internal dependencies (in the same model), external
dependencies (to another model) or both should be searched. To
determine the desired behaviour the following options are available:
INTERNAL — Search dependent features with local scope.
EXTERNAL — Search dependent features with external scope.
ALL — Search dependent features with all scope. Local scopes have
priority.

array
Name of the array which will receive the retrieved information.
Elements are structure variables of type EXT_REF.
Error handling
The program execution will be canceled if the supplied reference does
not exist or if a error occurs when searching for child features,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refFeature
GET_REF_DEPEND_CHILDREN_EX refFeature ALL arrayChildFeatures
§
GET_REF_DEPEND_PARENT
Determines parent feature of a specified reference.
Syntax
GET_REF_DEPEND_PARENT [options] reference<:in> dependency
reference<:out>
Arguments

options
The following options are supported:
ALLOW_SUPPRESSED — also suppressed parent features will be found.

MODEL_DEPENDENCIES valueBOOL — determines if model parents should


be reported, instead the ones of the component. Default is FALSE.

reference
Existing reference to a feature or a geometrical item.

dependency
Determines if internal dependencies (in the same model), external
dependencies (to another mode) or both should be searched. To
determine the desired behaviour the following options are available:
INTERNAL — Search dependent features with local scope.
EXTERNAL — Search dependent features with external scope.
ALL — Search dependent features with all scope. Local scopes have
priority.

reference
Name of the reference which will receive the retrieved information.
Error handling
The program execution will be canceled if the supplied reference does
not exist or if no parent feature could be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
This command will cause an error if no parent feature was found
unless this is not handled. In case more than one parent feature
exists, the first one will be found. For handling an arbitrary number
of parents the command GET_REF_DEPEND_PARENTS should be used.
Example
USER_SELECT FEATURE refFeature
GET_REF_DEPEND_PARENT ALLOW_SUPPRESSED refFeature EXTERNAL
parentFeature
§
GET_REF_DEPEND_PARENT_EX
Determines parent feature of a specified reference and provides
detailed information. This command extends the old
GET_REF_DEPEND_PARENT_EX command.
Syntax
GET_REF_DEPEND_PARENT_EX [options] reference<:in> dependency
reference<:out>
Arguments

options
The following options are supported:
MODEL_DEPENDENCIES valueBOOL — determines if model parents should
be reported, instead the ones of the component. Default is FALSE.

reference
Existing reference to a feature or a geometrical item.

dependency
Determines if internal dependencies (in the same model), external
dependencies (to another mode) or both should be searched. To
determine the desired behaviour the following options are available:
INTERNAL — Search dependent features with local scope.
EXTERNAL — Search dependent features with external scope.
ALL — Search dependent features with all scope. Local scopes have
priority.

reference
Structure variable of type EXT_REF which receives the retrieved
information.
Error handling
The program execution will be canceled if the supplied reference does
not exist or if no parent feature could be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
This command will cause an error if no parent feature was found
unless this is not handled. In case more than one parent feature
exists, the first one will be found. For handling an arbitrary number
of parents the command GET_REF_DEPEND_PARENTS_EX should be used.
Example
USER_SELECT FEATURE refFeature
GET_REF_DEPEND_PARENT_EX refFeature EXTERNAL ext_ref
PRINT "Referenct to %" ext_ref.item_to
PRINT "State: %" ext_ref.state
§
GET_REF_DEPEND_PARENTS
Determines parent features of a specified reference.
Syntax
GET_REF_DEPEND_PARENTS [options] reference<:in> dependency
array<:out>
Arguments

options
The following options are supported:
ALLOW_SUPPRESSED — also suppressed parent features will be found.

MODEL_DEPENDENCIES valueBOOL — determines if model parents should


be reported, instead the ones of the component. Default is FALSE.

reference
Existing reference to a feature or a geometrical item.

dependency
Determines if internal dependencies (in the same model), external
dependencies (to another mode) or both should be searched. To
determine the desired behaviour the following options are available:
INTERNAL — Search dependent features with local scope.
EXTERNAL — Search dependent features with external scope.
ALL — Search dependent features with all scope. Local scopes have
priority.

array
Name of the array which will receive the retrieved information.
Error handling
The program execution will be canceled if the supplied reference does
not exist or if a error occurs when searching for parent features,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refFeature
GET_REF_DEPEND_PARENTS ALLOW_SUPPRESSED refFeature BOTH
arrayParentFeatures
§
GET_REF_DEPEND_PARENTS_EX
Determines parent features of a specified reference. This command
extends the old GET_REF_DEPEND_PARENTS command.
Syntax
GET_REF_DEPEND_PARENTS_EX [options] reference<:in> dependency
array<:out>
Arguments

options
The following options are supported:
MODEL_DEPENDENCIES valueBOOL — determines if model parents should
be reported, instead the ones of the component. Default is FALSE.

reference
Existing reference to a feature or a geometrical item.

dependency
Determines if internal dependencies (in the same model), external
dependencies (to another mode) or both should be searched. To
determine the desired behaviour the following options are available:
INTERNAL — Search dependent features with local scope.
EXTERNAL — Search dependent features with external scope.
ALL — Search dependent features with all scope. Local scopes have
priority.

array
Name of the array which will receive the retrieved information.
Elements are structure variables of type EXT_REF.
Error handling
The program execution will be canceled if the supplied reference does
not exist or if a error occurs when searching for parent features,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refFeature
GET_REF_DEPEND_PARENTS_EX refFeature ALL arrayParentFeatures
§
GET_BREAKABLE_MDL_DEPENDENCY_STATE
Retrieves the installation if a model has breakable dependencies.
This helps to detect ghost objects. This function requires Creo
Parametric 2.0 or above.
Syntax
GET_BREAKABLE_MDL_DEPENDENCY_STATE model<:in> state<:out>
Arguments

model
The specified model.

state
Name of the boolean variable which receives the information if a
model has breakable dependencies.
Error handling
The program execution will be canceled if the supplied model does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_BREAKABLE_MDL_DEPENDENCY_STATE ASSEMBLY state
PRINT "%" state
§
BREAK_MDL_DEPENDENCIES
Break dependencies of a model. This helps to remove references to
ghost objects. This function requires Creo Parametric 2.0 or above.
Syntax
BREAK_MDL_DEPENDENCIES model<:in>
Arguments

model
The specified model.
Error handling
The program execution will be canceled if the supplied model does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
BREAK_MDL_DEPENDENCIES ASSEMBLY
§
GET_MDL_DEPENDENCIES
Determines dependent models.
Syntax
GET_MDL_DEPENDENCIES model<:in> array_dependent_models<:out>
Arguments

model
The specified model.

array_dependent_models
Name of the array which will receive the retrieved information. Each
array element is a string containing model name with extension.
Error handling
The program execution will be canceled if the supplied model does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_DEPENDENCIES THIS array_dependent_mdl_names
FOR depencent_mdl_name REF ARRAY array_dependent_mdl_names
BEGIN_CATCH_ERROR
RETRIEVE_MDL depencent_mdl_name mdl_dependent
END_CATCH_ERROR

IF NOT REF_VALID mdl_dependent


PRINT "External mdl missing %" depencent_mdl_name
END_IF
END_FOR
§
GET_MDL_TEXTS
Searches solid models and drawings for text information with font
definitions. In parts and assemblies the sketches from extrusions and
curve features are searched for this text information. In drawings it
is searched in table texts and notes.
Syntax
GET_MDL_TEXTS model<:in> array_text_information<:out>
Arguments

model
The specified model.

array_text_information
Name of the array which will receive the retrieved information.
Elements are structure variables of type TEXT.
Error handling
The program execution will be canceled if the supplied model does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
For more information about fonts, see the Specify Fonts section.
Example
GET_MDL_TEXTS THIS arrayText
FOR text REF ARRAY arrayText
PRINT "% %" text.text text.font_name
END_FOR
GET_REF_STATE
Reports the current state of a reference by a string parameter. For
example a state can be active or frozen.
Syntax
GET_REF_STATE reference<:in> paramState<:out>
Arguments

reference
Existing reference to a geometrical item.

paramState
Parameter which will receive the reference state. The following types
are existing:
REF_ACTIVE — if the reference is active.
REF_EXCLUDED — if the referenced entity is excluded by simplified
representation or family table.
REF_FROZEN — if the referenced entity is not in session.
REF_SUPPRESSED — if the referenced entity is suppressed.
REF_MISSING — if the referenced entity is missing.
REF_FROZEN_PLACE — if the reference entity can not be updated.
REF_INVALID — if the referenced entity is not valid.
REF_ALTERNATE — if it is any other state.
REF_NOT_FOUND — if the reference state was not found.
Error handling
he program execution will be canceled if the supplied reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS PLANE "DTM1" PLN_DTM1
GET_REF_STATE PLN_DTM1 state
§
GET_REF_POS
Retrieves position of a geometrical reference. If the reference was
selected the pick position of the mouse is supplied. In case the
reference was searched the result will be the center position.
Syntax
GET_REF_POS reference_origin<:in> reference<:in> pos<:out>
Arguments

reference_origin
Determines the origin for measuring the point coordinates. The
following situations have to be regarded:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to the indicated model.

reference
Geometrical reference. This could be points, curves, axis, surfaces
etc.

pos
Structure variable of type POINT will receive the result.
Error handling
The program execution will be canceled if the origin reference or the
point reference do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
ASSEMBLE THIS
PACKAGED
END_ASSEMBLE

USER_SELECT CURVE curve


GET_REF_POS NULL curve pos

DECLARE_STRUCT TRANSFORMATION transform


transform.trans_x = pos.x
transform.trans_y = pos.y
transform.trans_z = pos.z

SET_COMP_POS THIS transform


§
SET_REF_POS
Sets the internal position on a geometrical reference. This is
especially helpful if the reference was searched and not selected.
For example the exact location on an edge could be specified. In case
the location is not on the geometrical reference the closest position
will be used.
Syntax
SET_REF_POS origin<:in> reference<:in> pos<:in>
Arguments

origin
Determines the origin of the position.
origin is a coordinate system
The position is transformed from this coordinate system.
NULL
The position is transformed from the default coordinate system of
the model which contains the geometry reference.
Any other reference
The position is transformed from the default coordinate system of
the model which contains this reference.

reference
Geometrical reference. This could be points, curves, axis, surfaces
etc.

pos
Structure variable of type POINT contains the position.
Error handling
The program execution will be canceled if the origin reference or the
geometrical reference do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF ASSEMBLY COMPONENT "*" mdlPart
SEARCH_MDL_REF mdlPart EDGE "TEST_EDGE" myEdge
CALC_PARAM_POS ASSEMBLY myEdge 0.5 0.0 pos
SET_REF_POS ASSEMBLY myEdge pos
§
GET_REF_UV_PARAM
Retrieves the uv position on a geometrical reference. If the
reference was selected, the pick position of the mouse is supplied.
In other cases the uv position is set to 0/0. For edges and curves
only the u value is used.
Syntax
GET_REF_UV_PARAM reference<:in> uv_param<:out>
Arguments

reference
Geometrical reference. This could be a quilt, surface, edge and or
curve.

uv_param
Structure variable of type UV_PARAM will receive the result.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF ASSEMBLY CSYS "*" csys
USER_SELECT COMPOSITE_CURVE crv

GET_REF_UV_PARAM crv uv_param


GET_CURVE_RATIO_POS csys crv uv_param.u pos

DECLARE_STRUCT DTM_PNT_OFFSET_CSYS dtm_pnt_offset_csys


dtm_pnt_offset_csys.offset_csys = csys
ADD_ARRAY_ELEM dtm_pnt_offset_csys.array_points pos

CREATE_POINTS_EX crv dtm_pnt_offset_csys feature


§
SET_REF_UV_PARAM
Sets the uv position on a geometrical reference like quilt, surface,
edge or curve. This is required for placing a symbol or a surface
finish on a surface.
Syntax
SET_REF_UV_PARAM reference<:in> uv_param<:in>
Arguments

reference
Geometrical reference. This could be a quilt, surface, edge and
curve.

uv_param
Structure variable of type UV_PARAM.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART SURFACE "DIA_SURFACE_FRONT" PlacementReference
SEARCH_MDL_REF PART POINT "SF_PNT1" PlacementPoint
GET_REF_POS NULL PlacementPoint position
DECLARE_STRUCT UV_PARAM uv_param
CALC_POS_PARAM NULL PlacementReference position uv_param.u uv_param.v
!
! create surface finish on selection point of the surface
!
DECLARE_STRUCT SURFACE_FINISH surface_finish_option
surface_finish_option.value = 32
!
! set the symbol options
!
surface_finish_option.symbol_options.named_orientation = TRUE
surface_finish_option.symbol_options.view_orientation = "FRONT"
GET_CONFIG_OPTION "pro_surface_finish_dir" surfFinishDir
surface_finish_option.symbol_options.path = surfFinishDir +
"\\generic\\standard.sym"

! placement options
surface_finish_option.symbol_options.placement_type = "ON_ENTITY"
surface_finish_option.symbol_options.placement_ref =
PlacementReference
SET_REF_UV_PARAM surface_finish_option.symbol_options.placement_ref
uv_param
surface_finish_option.symbol_options.height = 1.0

CREATE_SURFFINISH PlacementReference surface_finish_option surffin


§
GET_CSYS_VECTOR
Retrieves a direction vector from a coordinate system.
Syntax
GET_CSYS_VECTOR reference_origin<:in> refCsys<:in> "axis_name"
vector<:out>
Arguments

reference_origin
Determines the origin for the direction vector. The following
situations have to be regarded:
origin is a coordinate system
Direction vector will be calculated with respect to this coordinate
system.
NULL
Direction vector will be calculate for the model to which the
coordinate system belongs.
Any other reference
Direction vector will be calculate with respect to the indicated
model.

refCsys
Reference to the coordinate system.

axis_name
Name of the axis. This should be either X, Y or Z. Any string
expression is allowed.

vector
Structure variable of type VECTOR will receive the result.
Error handling
The program execution will be canceled if the origin reference or the
csys reference do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPOSITE_CURVE curve
USER_SELECT CSYS csys
GET_CSYS_VECTOR NULL csys "X" vecDirection
CALC_ORIENTATION curve vecDirection orient
PRINT "%" orient
§
COMPARE_REF_ORDER
Compares the order of two references in the model tree.
Syntax
COMPARE_REF_ORDER reference1<:in> reference2<:in> order<:out>
Arguments

reference1
First reference to compare.

reference2
Second reference to compare.

order
Name of the integer variable which will receive the result. The
result is:
-1 — in case the reference 1 is located before reference 2 in the
model tree.
0 — in case reference 1 and reference 2 are located at the same
position.
1 — in case the reference 1 is located after reference 2 in the
model tree.
Error handling
The program execution will be canceled if the references do not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT PART part1
USER_SELECT PART part2

COMPARE_REF_ORDER part1 part2 order

IF order < 0
PRINT "part1 is before part2
ELSE_IF order == 0
PRINT "part1 is identical to part2"
ELSE
PRINT "part1 comes after part 2
END_IF
§
GET_DIM_TEXT
Read the text from a specified dimension.
Syntax
GET_DIM_TEXT options refDim<:in> paramText<:out>
Description

options
The following options are supported:
INCLUDE_PREFIX valueBOOL — includes the dimension prefix to the
retrieved text. Default is TRUE.

INCLUDE_SUFFIX valueBOOL — includes the dimension suffix to the


retrieved text. Default is TRUE.

refDim
Existing reference to a dimension.

paramText
Name of the parameter which will receive the dimension text.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_TEXT dim text
§
GET_DIM_PREFIX
Read the prefix from a specified dimension.
Syntax
GET_DIM_PREFIX refDim<:in> prefix<:out>
Description

refDim
Existing reference to a dimension.

prefix
Name of the variable which will receive the dimension prefix.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_PREFIX dim prefix
PRINT "prefix: %" prefix
§
GET_DIM_SUFFIX
Read the suffix from a specified dimension.
Syntax
GET_DIM_SUFFIX refDim<:in> suffix<:out>
Description

refDim
Existing reference to a dimension.

suffix
Name of the variable which will receive the dimension suffix.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_SUFFIX dim suffix
PRINT "suffix: %" suffix
§
GET_DIM_VALUE
Read the value from a specified dimension.
Syntax
GET_DIM_VALUE refDim<:in> paramValue<:out>
Description

refDim
Existing reference to a dimension.

paramValue
Name of the parameter which will receive the dimension value.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_VALUE dim value
§
GET_DIM_SYMBOL
Reads the symbol from a specified dimension.
Syntax
GET_DIM_SYMBOL referenceDimension<:in> [WITH_SESSION_ID]
parameterSymbol<:out>
Arguments

referenceDimension
Name of an existing reference to a dimension.

WITH_SESSION_ID
Optional flag indicating that the Creo Elements/Pro session id is
included in the parameter symbol.

parameterSymbol
Name of the parameter which will receive the dimension symbol.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DIMENSION D2 dimD2
GET_DIM_SYMBOL dimD2 WITH_SESSION_ID symbolDim2
§
GET_DIM_TYPE
Retrieves the type of a dimension.
Syntax
GET_DIM_TYPE refDim<:in> paramType<:out>
Description

refDim
Existing reference of a dimension.

paramType
Parameter which will receive the dimension type. The following types
are existing:
LINEAR — for linear dimensions.
RADIUS — for radial dimensions.
DIAMETER — for diameter dimensions.
ANGLE — for angular dimensions.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_TYPE dim type
§
GET_DIM_SETUP_TYPE
Retrieves the setup type of a dimension.
Syntax
GET_DIM_SETUP_TYPE refDim<:in> paramType<:out>
Description

refDim
Existing reference of a dimension.

paramType
Parameter which will receive the setup dimension type. The following
types are existing:
REGULAR — for a normal dimension which is neither a reference nor
an ordinate dimension.
REFERENCE — for a reference dimension.
ORDINATE — or an ordinate dimension.
ORDINATE_REFERENCE — for a reference ordinate dimension.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_SETUP_TYPE dim type
PRINT "%" type
§
GET_DIM_DISPLAY_TYPE
Retrieves the display type of a dimension.
Syntax
GET_DIM_DISPLAY_TYPE refDim<:in> paramDisplayType<:out>
Description

refDim
Existing reference of a dimension.

paramDisplayType
Parameter which will receive the display dimension type. The
following types are existing:
BASIC — for basic dimensions.
INSPECTION — for inspection dimensions.
NORMAL — for dimensions which are neither basic nor inspection
dimensions.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_DISPLAY_TYPE dim displayType
§
GET_DIM_TOL
Reads the upper and lower limit from a tolerance of a dimension.
Syntax
GET_DIM_TOL refDim<:in> paramUpperLimit<:out> paramLowerLimit<:out>
Description

refDim
Existing reference to a dimension.

paramUpperLimit
Name of the parameter which will receive the upper limit of the
tolerance.

paramLowerLimit
Name of the parameter which will receive the lower limit of the
tolerance
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_TOL dim upperLimit lowerLimit
§
GET_DIM_TOL_TYPE
Retrieves the tolerance type of a dimension.
Syntax
GET_DIM_TOL_TYPE refDim<:in> paramTolType<:out>
Description

refDim
Existing reference of a dimension.

paramTolType
Parameter which will receive the tolerance type. The following types
are existing:
NOMINAL— if only the nominal value without a tolerance is shown.
LIMITS — if upper and lower limit of the dimension are shown.
PLUS_MINUS — if plus and minus tolerances are shown.
PLUS_MINUS_SYM — if plus and minus tolerances are shown by a single
value.
PLUS_MINUS_SYM_SUPERSCRIPT — if plus and minus tolerances are shown
by a single value in a superscript line.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_TOL_TYPE dim tolType
§
GET_DIM_TOL_TABLE
Retrieves the tolerance table of a dimension.
Syntax
GET_DIM_TOL_TYPE refDim<:in> table_type<:out> table_name<:out>
table_column<:out>
Description

refDim
Existing reference of a dimension.

table_type
Variable of type string which will receive the tolerance table type.
The following types are existing:
NONE— no tolerance table is used.
GENERAL— the general tolerance table is used.
BROKEN_EDGE — the broken edge tolerance table is used.
SHAFT — a shaft tolerance table is used.
HOLE — a hole tolerance table is used.

table_name
Variable of type string which will receive the name of the tolerance
table. Names are only used for shaft and hole tolerance tables. In
all other cases the string will be empty.

table_column
Variable of type integer which will receive the row of the tolerance
table. The rows are only used for shaft and hole tolerance tables. In
all other cases the value will be -1.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_TOL_TABLE dim table_type table_name row
§
GET_DIM_DECIMALS
Reads the number of decimal places of a dimension.
Syntax
GET_DIM_DECIMALS refDim<:in> paramDecPlaces<:out>
Description

refDim
Existing reference to a dimension.

paramDecimalPlaces
Name of the parameter which will receive the number of decimal places
of the dimension.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_DECIMALS dim numDecPlaces
§
GET_DIM_BOUND
Retrieves the dimension boundary.
Syntax
GET_DIM_BOUND refDim<:in> boundary<:out>
Description

refDim
Existing reference to a dimension.

boundary
Name of the string variable which will receive the boundary types.
Valid types are NOMINAL, UPPER, LOWER or MIDDLE.
Error handling
The program execution will be canceled if the dimension reference
does not exist or the boundary could not be retrieved, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_BOUND dim boundary
§
GET_DIM_DISPLAY_ROUNDED
Retrieves the information if the dimension is displayed as a rounded
value. This function requires Pro/ENGINEER Wildfire 5 / Creo
Elements/Pro 5 or above.
Syntax
GET_DIM_DISPLAY_ROUNDED refDim<:in> paramDimDispRounded<:out>
Description

refDim
Existing reference to a dimension.

paramDimDispRounded
Name of the boolean parameter which will receive the information if
the dimension is displayed as a rounded value.
Error handling
The program execution will be canceled if the dimension reference
does not exist or the status cannot be retrieved, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_DISPLAY_ROUNDED dim paramDimDispRounded
IF paramDimDispRounded == TRUE
PRINT "Dimension is displayed as a rounded value"
END_IF
§
GET_DIM_DISPLAY_ROUNDED_ACCESSIBLE
Retrieves the information if the rounded dimension value of the
dimension properties is accessible. This function requires
Pro/ENGINEER Wildfire 5 / Creo Elements/Pro 5 or above.
In case the involved feature has be created in an earlier
Pro/ENGINEER release, the checkbox for angular dimensions is not
accessible.
Syntax
GET_DIM_DISPLAY_ROUNDED_ACCESSIBLE refDim<:in>
paramDimDispRoundedAccessible<:out>
Description

refDim
Existing reference to a dimension.

paramDimDispRoundedAccessible
Name of the boolean parameter which will receive the information if
the rounded dimension value checkbox is accessible.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_DISPLAY_ROUNDED_ACCESSIBLE dim paramDimDispRoundedAccessible
IF paramDimDispRoundAccessible == TRUE
PRINT "Dimension display rounded state can be accessed"
END_IF
§
GET_DIM_VALUE_DISPLAY_TYPE
Reads the value display type for a created dimension.
Syntax
GET_DIM_VALUE_DISPLAY_TYPE refDim<:in> valueDisplayType<:out>
Description

refDim
Existing reference to a dimension.

valueDisplayType
Name of the string variable which will receive the value display
type. The following types are existing:
NOMINAL — to display the nominal dimension.
OVERRIDE — to display the override value.
TOLERANCE_ONLY — to display only the tolerance information.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_VALUE_DISPLAY_TYPE dim valueDisplayType
PRINT "value display type:%" valueDisplayType
§
GET_DIM_OVERRIDE_VALUE
Reads the dimension override value from a created dimension.
Syntax
GET_DIM_OVERRIDE_VALUE refDim<:in> valueOverride<:out>
Description

refDim
Existing reference to a dimension.

valueOverride
Name of the double variable which will receive the value of the
dimension override.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Override values for non created dimensions are returned as 0.0.
Example
USER_SELECT DIMENSION dim
GET_DIM_OVERRIDE_VALUE dim valueDimOverride
PRINT "override: %" valueDimOverride
§
GET_DIM_FRACTIONAL
Retrieves the information if a solid dimension is shown in fractional
format.
Syntax
GET_DIM_FRACTIONAL refDim<:in> formatFractionalBOOL<:out>
Description

refDim
Existing reference to a dimension.

formatFractional
Name of the boolean parameter which will receive the information if
the dimension is in fractional format.
Error handling
The program execution will be canceled if the dimension reference
does not exist or the format cannot be retrieved, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS PART DIMENSION "*" allDims
FOR dim REF ARRAY allDims
GET_DIM_FRACTIONAL dim fractional

IF fractional == TRUE
fractional = FALSE
ELSE
fractional = TRUE
END_IF

SET_DIM_FRACTIONAL dim fractional


END_FOR
§
GET_DIM_FEATURE
Retrieves the feature which owns the dimension.
Syntax
GET_DIM_FEATURE refDim<:in> refFeature<:out>
Description

refDim
Existing reference to a dimension.

refFeature
Name of the reference which will receive the retrieved feature.
Error handling
The program execution will be canceled if the dimension reference
does not exist or the feature could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_FEATURE dim refFeature
§
GET_FEATURE_DIMS
Retrieves the dimensions of a feature.
Syntax
GET_FEATURE_DIMS refFeature<:in> arrayDimensions<:out>
Description

refFeature
Existing reference to a feature.

arrayDimensions
Name of the array which will receive the retrieved dimensions.
Error handling
The program execution will be canceled if the feature reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
GET_FEATURE_DIMS feature arrayDims
FOR dim REF ARRAY arrayDims
GET_DIM_SYMBOL dim symbol
GET_DIM_VALUE dim value
PRINT "%: %" symbol value
END_FOR
§
GET_DIM_MDL
Retrieves the model which owns the dimension.
Syntax
GET_DIM_MDL refDim<:in> refMdl<:out>
Description

refDim
Existing reference to a dimension.

refMdl
Name of the reference which will receive the retrieved model.
Error handling
The program execution will be canceled if the dimension reference
does not exist or the model could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DIM_MDL dim refMdl
§
GET_MDL_DIMS
Retrieves the dimensions of a model.
Syntax
GET_MDL_DIMS refMdl<:in> arrayDimensions<:out>
Description

refMdl
Existing reference to a model.

arrayDimensions
Name of the array which will receive the retrieved dimensions.
Error handling
The program execution will be canceled if the model reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL mdl
GET_MDL_DIMS mdl arrayDims
FOR dim REF ARRAY arrayDims
GET_DIM_SYMBOL dim symbol
GET_DIM_VALUE dim value
PRINT "%: %" symbol value
END_FOR
§
GET_MDL_PARAM_DESIGNATION_STATUS
Inquiries a Pro/ENGINEER parameter whether it is designated.
Syntax
GET_MDL_PARAM_DESIGNATION_STATUS model "param_name" paramStatus<:out>
Arguments

model
Model which contains the parameter whose status should be read.

param_name
Name of the parameter which should be assigned.

paramStatus
Name of the boolean parameter which receives the information whether
the designation status is set.
Error handling
The program execution will be canceled if the model or the parameter
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_PARAM_NAMES THIS "*" allParamNames
FOR paramName REF ARRAY allParamNames
GET_MDL_PARAM_DESIGNATION_STATUS THIS paramName designationStatus
PRINT "% designated: %" paramName designationStatus
END_FOR
§
GET_FEAT_PARAM_DESIGNATION_STATUS
Inquiries a Pro/ENGINEER feature or component parameter whether it is
designated.
Syntax
GET_FEAT_PARAM_DESIGNATION_STATUS feature "param_name"
paramStatus<:out>
Arguments

feature
Feature which contains the parameter whose status should be read.

param_name
Name of the parameter which should be assigned.

paramStatus
Name of the boolean parameter which receives the information whether
the designation status is set.
Error handling
The program execution will be canceled if the feature or the
parameter does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_FEAT_PARAM_NAMES feat "*" allParamNames
FOR paramName REF ARRAY allParamNames
GET_FEAT_PARAM_DESIGNATION_STATUS feat paramName designationStatus
PRINT "% designated: %" paramName designationStatus
END_FOR
§
GET_ATTRIBUTE_DESIGNATION_STATUS
Inquiries if a dimension, geometrical tolerance or surface finish is
designated.
Syntax
GET_ATTRIBUTE_DESIGNATION_STATUS refAttribute paramStatus<:out>
Arguments

refAttribute
Reference to the attribute whose status should be read.

paramStatus
Name of the boolean parameter which receives the information whether
the designation status is set.
Error handling
The program execution will be canceled if the attribute does not
exist or could not be designated, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFFINISH | GTOL | DIMENSION | FEATURE dim
GET_ATTRIBUTE_DESIGNATION_STATUS dim status
PRINT "%" status
§
GET_MDL_PARAM_LOCK_STATUS
Reads the lock status of a Creo model parameter.
Syntax
GET_MDL_PARAM_LOCK_STATUS model<:in> "param_name" lockStatus<:out>
Arguments

model
Reference to the model which contains the parameter whose lock status
should be read.

param_name
Name of the parameter. Any string expression is allowed.

lockStatus
Name of the string variable which receives the lock status
information. The following lock states are available:
UNLOCKED — the parameter has no restrictions.
LIMITED — write access to the parameter is limited.
LOCKED — the parameter could not be changed.
Error handling
The program execution will be canceled if the model or the parameter
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_PARAM_LOCK_STATUS PART "my_parameter" lockStatus
PRINT "%" lockStatus
§
GET_FEAT_PARAM_LOCK_STATUS
Reads the lock status of a Creo feature parameter.
Syntax
GET_FEAT_PARAM_LOCK_STATUS refFeature<:in> "param_name"
lockStatus<:out>
Arguments

refFeature
Reference to the feature which contains the parameter whose lock
status should be read.

param_name
Name of the parameter. Any string expression is allowed.

lockStatus
Name of the string variable which receives the lock status
information. The following lock states are available:
UNLOCKED — the parameter has no restrictions.
LIMITED — write access to the parameter is limited.
LOCKED — the parameter could not be changed.
Error handling
The program execution will be canceled if the feature or the
parameter does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART FEATURE "*" firstFeature
GET_FEAT_PARAM_LOCK_STATUS firstFeature "my_parameter" lockStatus
PRINT "%" lockStatus
§
GET_REF_PARAM_LOCK_STATUS
Reads the lock status of a Creo reference parameter.
Syntax
GET_REF_PARAM_LOCK_STATUS reference<:in> "param_name"
lockStatus<:out>
Arguments

reference
Reference which contains the parameter whose lock status should be
read.

param_name
Name of the parameter. Any string expression is allowed.

lockStatus
Name of the string variable which receives the lock status
information. The following lock states are available:
UNLOCKED — the parameter has no restrictions.
LIMITED — write access to the parameter is limited.
LOCKED — the parameter could not be changed.
Error handling
The program execution will be canceled if the reference or the
parameter does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART EDGE "*" firstEdge
GET_REF_PARAM_LOCK_STATUS firstEdge "my_parameter" lockStatus
PRINT "%" lockStatus
§
GET_MDL_PARAM_DESCRIPTION
Reads the description of a Creo model parameter.
Syntax
GET_MDL_PARAM_DESCRIPTION model<:in> "param_name" description<:out>
Arguments

model
Reference to the model which contains the parameter whose description
should be read.

param_name
Name of the parameter. Any string expression is allowed.

description
Name of the string variable which receives the parameter description.
Error handling
The program execution will be canceled if the model or the parameter
does not exist or the description could not be read, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_PARAM_DESCRIPTION PART "my_parameter" description
PRINT "%" description
§
GET_FEAT_PARAM_DESCRIPTION
Reads the description of a Creo feature parameter.
Syntax
GET_FEAT_PARAM_DESCRIPTION refFeature<:in> "param_name"
description<:out>
Arguments

refFeature
Reference to the feature which contains the parameter whose
description should be read.

param_name
Name of the parameter. Any string expression is allowed.

description
Name of the string variable which receives the parameter description.
Error handling
The program execution will be canceled if the feature or the
parameter does not exist or the description could not be read, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART FEATURE "*" firstFeature
GET_FEAT_PARAM_DESCRIPTION firstFeature "my_parameter" description
PRINT "%" description
§
GET_REF_PARAM_DESCRIPTION
Reads the description of a Creo reference parameter.
Syntax
GET_REF_PARAM_DESCRIPTION reference<:in> "param_name"
description<:out>
Arguments

reference
Reference which contains the parameter whose description should be
read.

param_name
Name of the parameter. Any string expression is allowed.

description
Name of the string variable which receives the parameter description.
Error handling
The program execution will be canceled if the reference or the
parameter does not exist or the description could not be read, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART EDGE "*" firstEdge
GET_REF_PARAM_DESCRIPTION firstEdge "my_parameter" description
PRINT "%" description
§
GET_ENUMERATED_MDL_PARAM_VALUES
Retrieves all values for a restricted enumerated model parameter.
Syntax
GET_ENUMERATED_MDL_PARAM_VALUES model<:in> "param_name"
arrayParamValues<:out>
Arguments

model
Reference in which to search for the parameter.

param_name
Name of the Creo model parameter from which the restricted enumerated
parameters values should be retrieved. Any string expression is
allowed. The names can also be specified by using wildcards.

arrayParamValues
Name of the array which should receive the parameter values
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_ENUMERATED_MDL_PARAM_NAMES ASSEMBLY "BUW*" arrayParameterNames
FOR paramName REF ARRAY arrayParameterNames
PRINT "%" paramName
SEARCH_ENUMERATED_MDL_PARAM_VALUES ASSEMBLY paramName values
FOR value REF ARRAY values
PRINT "\t%" value
END_FOR
END_FOR
§
GET_ENUMERATED_FEAT_PARAM_VALUES
Retrieves all values for a restricted enumerated feature parameter.
Syntax
GET_ENUMERATED_FEAT_PARAM_VALUES feature<:in> "param_name"
arrayParamValues<:out>
Arguments

feature
The specified feature.

param_name
Name of the Creo feature parameter from which the restricted
enumerated parameters values should be retrieved. Any string
expression is allowed. The names can also be specified by using
wildcards.

arrayParamValues
Name of the array which should receive the parameter values
Error handling
The program execution will be canceled if the feature does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
SEARCH_ENUMERATED_FEAT_PARAM_NAMES feat "BUW*" arrayParameterNames
FOR paramName REF ARRAY arrayParameterNames
PRINT "%" paramName
SEARCH_ENUMERATED_FEAT_PARAM_VALUES feat paramName values
FOR value REF ARRAY values
PRINT "\t%" value
END_FOR
END_FOR
§
GET_ENUMERATED_REF_PARAM_VALUES
Retrieves all values for a restricted enumerated reference parameter.
Syntax
GET_ENUMERATED_REF_PARAM_VALUES reference<:in> "param_name"
arrayParamValues<:out>
Arguments

reference
Reference in which to search for the parameter.

param_name
Name of the Creo reference parameter from which the restricted
enumerated parameters values should be retrieved. Any string
expression is allowed. The names can also be specified by using
wildcards.

arrayParamValues
Name of the array which should receive the parameter values
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION_ELEMENT annotation
SEARCH_ENUMERATED_REF_PARAM_NAMES annotation"*" arrayParameterNames
FOR param_name REF ARRAY arrayParameterNames
SEARCH_REF_PARAM elem param_name param_value
PRINT "% %" param_name param_value
SEARCH_ENUMERATED_REF_PARAM_VALUES annotation paramName values
FOR value REF ARRAY values
PRINT "\t%" value
END_FOR
END_FOR
§
GET_MDL_FAILURE_FLAG
Inspects if the model contains any failed feature. In case the
Pro/ENGINEER Wildfire 4 or below, the result is always false.
Syntax
GET_MDL_FAILURE_FLAG [options] model<:in> flag<:out>
Description

options
The following options are supported:
RECURSIVE — In case of an assembly, the search is also done in sub
components.

model
The specified model.

flag
Name of the boolean variable which will receive the information if
failed features are available.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_FAILURE_FLAG RECURSIVE ASSEMBLY flag
IF flag == TRUE
PRINT "The model contains failed features."
ELSE
PRINT "The model contains no failed features."
END_IF
§
GET_MDL_REGEN_STATE
Retrieves the regeneration state of a solid model.
Syntax
GET_MDL_REGEN_STATE model<:in> regen_state<:out>
Description

model
The specified model.

regen_state
Name of the string variable which will receive the regeneration
state. The following states are possible:
REGENERATED — the model is successfully regenerated. Creo shows the
green state.
REGENERATION_REQUIRED — the model is not regenerated. Creo shows
the yellow state.
REGENERATION_FAILED — the model regeneration failed. Creo shows the
red state.
CONNECTION_FAILED — the model is successfully regenerated, but the
mechanism connect failed.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_MDL_REGEN_STATE ASSEMBLY state
PRINT "%" state
§
GET_UDF_DATA
Retrieves the data from a UDF (*.gph) file.
Syntax
GET_UDF_DATA "udf_file" udf_data<:out>
Description

udf_file
Specifies the UDF file.

udf_data
Name of the structure variable of type UDF_DATA.
Example
GET_UDF_DATA "lib:sample.gph" data

PRINT "references"
PRINT "---------------"
FOR reference REF MAP data.references
PRINT "% : %" reference.key reference.value
END_FOR

PRINT "var_dims"
PRINT "---------------"
FOR var_dim REF MAP data.var_dims
PRINT "% : %" var_dim.key var_dim.value
END_FOR

PRINT "var_params"
PRINT "---------------"
FOR var_param REF MAP data.var_params
PRINT "% : %" var_param.key var_param.value
END_FOR

PRINT "instances"
PRINT "---------------"
FOR instance REF ARRAY data.instances
PRINT "%" instance
END_FOR
§
GET_CONSEC_FEAT_PARAM_INDEX
Gets the next available index for a new consecutive parameter on
feature or component feature level.
Syntax
GET_CONSEC_FEAT_PARAM_INDEX refFeature<:in> "param_name" index<:out>
Description

refFeature
Existing reference to a feature.

param_name
Name of the parameter for which the next available consecutive index
is to be searched

index
Name of the integer variable which will receive the next available
index.
Error handling
The program execution will be canceled if the reference to the
feature does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_CONSEC_FEAT_PARAM_INDEX refFeat "new_param" index
SET_FEAT_PARAM refFeat "new_param" + itos(index) "value"
§
GET_CONSEC_MDL_PARAM_INDEX
Gets the next available index for a new consecutive parameter on part
or assembly level.
Syntax
GET_CONSEC_MDL_PARAM_INDEX model<:in> "param_name" index<:out>
Description

refFeature
Existing reference to a model.

param_name
Name of the parameter for which the next available consecutive index
is to be searched

index
Name of the integer variable which will receive the next available
index.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_CONSEC_MDL_PARAM_INDEX refMdl "new_param" index
SET_MDL_PARAM refMdl "new_param" + itos(index) "value"
§
REFERENCE_TO_STRING
Converts a reference variable to two strings. One for the model for
which is the owner of the reference and one for the reference
content.
Syntax
REFERENCE_TO_STRING reference<:in> strMdl<:out> strReference<:out>
Description

reference
The reference which is going to be converted to the strings.

strMdl
Name of the string variable which receives the model name and
extension.

strReference
Name of the string variable which receives the reference content.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT POINT pnt
REFERENCE_TO_STRING pnt mdl ref
STRING_TO_REFERENCE mdl ref pnt
§
STRING_TO_REFERENCE
Constructs a reference variable from two strings. The first string
contains the name and extension of the model which owns the
reference. The second string contains the reference content.
Syntax
STRING_TO_REFERENCE "str_model" "str_reference" reference<:out>
Description

str_model
Name and extension of the model which owns the reference.

str_reference
Content of the reference.

reference
Name of the variable which receives the reference.
Error handling
The program execution will be canceled if the reference could not be
constructed from the two strings, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT POINT pnt
REFERENCE_TO_STRING pnt mdl ref
STRING_TO_REFERENCE mdl ref pnt
RETRIEVE_REFERENCE
Retrieves a reference information from a component feature. This
command is useful for retrieving reference information from
previously created components in case of Create Existing Component or
Copy Existing Component.
Syntax
RETRIEVE_REFERENCE refFeature<:in> reference<:out>
Arguments

refFeature
Existing reference to a feature or component feature.

reference
Name of the reference which should receive the retrieved information.

Error handling
The program execution will be canceled if the feature or the
reference does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
More information about the use of this command is available in
reusing references and parameters.
Example
RETRIEVE_REFERENCE COMP_FEAT REF_SURFACE
About Commands for Writing Information
Commands for writing information to Creo Elements/Pro models,
features, and dimensions.
The following commands are available:
SET_MDL_PARAM — to create or modify a model parameter.
CREATE_MDL_PARAM — to create a new model parameter.
DELETE_MDL_PARAM — to delete an existing model parameter.
SET_CONSEC_MDL_PARAM — to create a new model parameter with a
consecutive number at the end of the name.
SET_FEAT_PARAM — to create or modify a feature parameter.
CREATE_FEAT_PARAM — to create a new feature parameter.
DELETE_FEAT_PARAM — to delete an existing feature parameter.
SET_CONSEC_FEAT_PARAM — to create a new feature parameter with a
consecutive number at the end of the name.
SET_REF_PARAM — to create or modify a parameter on a reference.
DELETE_REF_PARAM — to delete a parameter from a reference.
SET_DIM_TEXT — to modify the text of a dimension.
SET_DIM_PREFIX — to modify the prefix of a dimension.
SET_DIM_SUFFIX — to modify the suffix of a dimension.
SET_DIM_VALUE — to modify the value of a dimension.
SET_DIM_DISPLAY_TYPE — to modify the display type of a
dimension.
SET_DIM_TOL — to modify the upper and lower limit of a dimension
tolerance.
SET_DIM_TOL_TYPE — to modify the type of a dimension tolerance.
SET_DIM_TOL_TABLE — to set the tolerance table for a dimension.
SET_DIM_SYMBOL — to modify the symbol of a dimension.
SET_DIM_DECIMALS — to modify the number of decimals values of a
dimension.
SET_DIM_BOUND — to set one or many dimension boundaries.
SET_MDL_DIMS_BOUND — to set all dimension boundaries of a model.
SET_DIM_DISPLAY_ROUNDED — to set the information if the
dimension should be displayed as a rounded value.
SET_DIM_VALUE_DISPLAY_TYPE — to set the value display type for a
created dimension.
SET_DIM_OVERRIDE_VALUE — to set the override value for a created
dimension.
SET_DIM_FRACTIONAL — to determine if a solid dimension should be
shown as a fractional value.
SET_REF_NAME — to modify the name of a reference.
SET_FEATURE_NAME — to modify the name of a feature.
DESIGNATE_MDL_PARAM — to designate a model parameter.
DESIGNATE_FEAT_PARAM — to designate a feature or component
feature parameter.
DESIGNATE_ATTRIBUTE — to designate a dimension, geometric
tolerance surface or surface finish symbol.
SET_MDL_PARAM_LOCK_STATUS — to set the lock status of a model
parameter.
SET_FEAT_PARAM_LOCK_STATUS — to set the lock status of a feature
parameter.
SET_REF_PARAM_LOCK_STATUS — to set the lock status of a
reference parameter.
SET_MDL_PARAM_DESCRIPTION — to set the description of a model
parameter.
SET_FEAT_PARAM_DESCRIPTION — to set the description of a feature
parameter.
SET_REF_PARAM_DESCRIPTION — to set the description of a
reference parameter.
SAVE_REFERENCE — to save reference information to a component
feature which can be retrieved via RETRIEVE_REFERENCE.
SET_MDL_PARAM
Creates or update a model parameter or a dimension with a specified
value.
Syntax
SET_MDL_PARAM model "search_string" valueSTRNUM [option]
Arguments

model
The specified model.

search_string
Name of the parameter or dimension which should be created or
updated. Any string expression is allowed. In case no parameter or
dimension is found a new parameter will be created for the specified
model.

value
Value which should be set to the Creo Elements/Pro parameter or
dimension. Any string expression or math expression is allowed.

option
NO_REGEN — prevent the model from being regenerated automatically.
NO_DIMENSION — avoid to search for dimension. This can be used for
performance reasons to prevent the search for dimensions in large
models.
NO_DIM_SIGN — a positive value does not changed the sign of a
negative regenerated dimension.
Note
When several parameters are updated, the option NO_REGEN prevents non
required regenerations. When the model should be regenerated the
command REGEN_MDL could be used.
Example
USER_INPUT_PARAM DOUBLE paramvalue_height
SET_MDL_PARAM THIS height paramvalue_height
CREATE_MDL_PARAM
Creates a model parameter. In case of a double parameter, the unit
can be specified.
Syntax
CREATE_MDL_PARAM model "param_name" param_type valueSTRNUM ["unit"]
Arguments

model
The specified model.

param_name
Name of the parameter which should be created. Any string expression
is allowed.

param_type
Type for the Creo Elements/Pro parameter.

value
Value which should be set to the Creo Elements/Pro parameter. Any
string expression or math expression is allowed.

unit
Optional unit in case of a string parameter. Any string expression is
allowed. The valid strings are the same which are available in the
Creo Elements/Pro dialog to create parameters. These are mm, in, etc.
Error handling
The program execution will be canceled if the model does not exist or
if a parameter of the same name is already existing, unless errors
are handled by BEGIN_CATCH_ERROR.
Note
This command can not change the value of an existing model parameter.
Use SET_MDL_PARAM instead.
Example
CREATE_MDL_PARAM THIS "sample" DOUBLE 5*7 mm
DELETE_MDL_PARAM
Deletes an existing model parameter.
Syntax
DELETE_MDL_PARAM model "param_name" [CONTENT ...]
Arguments

model
The specified model.

param_name
Name for the Creo Elements/Pro parameter which should be deleted.

CONTENT
An optional WITH_CONTENT / WITH_CONTENT_NOT clause can follow, to
filter for specific variable content.
Error handling
The program execution will be canceled if the model or the parameter
does not exist or the parameter could not be deleted, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
DELETE_MDL_PARAM THIS "sample"
SET_CONSEC_MDL_PARAM
Creates a new model parameter with a consecutive number at the end of
the name.
Syntax
SET_CONSEC_MDL_PARAM model "search_string" valueSTRNUM
Arguments

model
The specified model.

search_string
Name of the parameter which should be created. Any string
expression is allowed.

value
Value which should be set to the parameter. Any string expression or
math expression is allowed.
Example
SET_CONSEC_MDL_PARAM THIS "name" "test"
SET_CONSEC_MDL_PARAM THIS "name" 1.0.
SET_FEAT_PARAM
Creates or updates a feature parameter or dimension with a specified
value.
Syntax
SET_FEAT_PARAM feature "param_name" valueSTRNUM [option]
Arguments

feature
The specified feature.

param_name
Name of the parameter which should be created or updated. Any string
expression is allowed.

value
Value which should be set to the parameter or dimension. Any string
expression or math expression is allowed.

option
NO_DIM_SIGN — a positive value does not changed the sign of a
negative regenerated dimension.
Error handling
The program execution will be canceled if the feature does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
Setting the dimension value does not regenerate the model
automatically. When the model should be regenerated the command
REGEN_MDL could be used. Accessing parameters from a component
feature is useful technology in the context of reusing references and
parameters.
Example
USER_INPUT_PARAM DOUBLE paramvalue_height
SET_FEAT_PARAM COMP_FEAT height paramvalue_height
CREATE_FEAT_PARAM
Creates a Creo Elements/Pro feature or component parameter. In case
of a double parameter, the unit can be specified.
Syntax
CREATE_FEAT_PARAM feature "param_name" param_type valueSTRNUM
["unit"]
Arguments

feature
Reference to the feature which receives the parameter.

param_name
Name for the Creo Elements/Pro parameter which should be created. Any
string expression is allowed.

param_type
Type for the Creo Elements/Pro parameter.

value
Value which should be set to the Creo Elements/Pro parameter. Any
string expression or math expression is allowed.

unit
Optional unit in case of a string parameter. Any string expression is
allowed. The valid strings are the same which are available in the
Creo Elements/Pro dialog to create parameters. These are mm, in, etc.
Error handling
The program execution will be canceled if the model does not exist or
if a parameter of the same name is already existing, unless errors
are handled by BEGIN_CATCH_ERROR.
Note
This command can not change the value of an existing model parameter.
Use SET_FEAT_PARAM instead.
Example
USER_SELECT FEATURE feat
CREATE_FEAT_PARAM feature "sample" DOUBLE 5*7 mm
DELETE_FEAT_PARAM
Deletes an existing Creo Elements/Pro feature or component parameter.
Syntax
DELETE_FEAT_PARAM feature "param_name" [CONTENT ... ]
Arguments

feature
Reference to the feature which contains the parameter.

param_name
Name for the Creo Elements/Pro parameter which should be deleted.

CONTENT
An optional WITH_CONTENT / WITH_CONTENT_NOT clause can follow, to
filter for specific variable content.
Error handling
The program execution will be canceled if the model or the parameter
does not exist or the parameter could not be deleted, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
DELETE_FEAT_PARAM feat "sample"
SET_CONSEC_FEAT_PARAM
Creates a new feature parameter with a consecutive number at the end
of the name.
Syntax
SET_CONSEC_FEAT_PARAM feature "param_name" valueSTRNUM
Arguments

feature
The specified feature.

param_name
Name of the parameter which should be created or Any string
expression is allowed.

value
Value which should be set to the parameter. Any string expression or
math expression is allowed.
Error handling
The program execution will be canceled if the feature does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
SET_CONSEC_FEAT_PARAM feat "name" "test"
SET_CONSEC_FEAT_PARAM feat "name" 1.0.
SET_REF_PARAM
Creates or updates a reference parameter. This can be used to create
or update parameters to annotation elements, surfaces, quilts, edges,
curves and composite curves.
Syntax
SET_REF_PARAM ref<:in> "param_name" valueSTRNUM
Arguments

ref
The reference to the elements which should receive the parameter.

param_name
Name of the parameter which should be created or update. Any string
expression is allowed.

value
Value which should be set to the parameter. Any string expression or
math expression is allowed.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_INPUT_PARAM STRING text
USER_SELECT FACE surface
SET_REF_PARAM surface "TEXT" text
DELETE_REF_PARAM
Deletes an existing reference parameter. This can be used to delete
parameters from annotation elements, surfaces, quilts, edges, curves
and composite curves.
Syntax
DELETE_FEAT_PARAM ref<:in> "param_name" [CONTENT ... ]
Arguments

ref
The reference to the elements which contains the parameter.

param_name
Name for the Creo parameter which should be deleted.

CONTENT
An optional WITH_CONTENT / WITH_CONTENT_NOT clause can follow, to
filter for specific variable content.
Error handling
The program execution will be canceled if the reference or the
parameter does not exist or the parameter could not be deleted,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT EDGE edge
DELETE_REF_PARAM edge "sample"
§
SET_DIM_TEXT
Sets dimension text for a dimension reference.
Syntax
SET_DIM_TEXT refDim<:in> "dimension_text"
Arguments

refDim
Reference to an existing dimension.

dimension_text
New dimension text. Any string expression is allowed.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Creo Elements/Pro allows to surround dimension texts by a block with
the notation @[ ... @].
Example
SHOW_DIMS ASSEMBLY
USER_SELECT DIMENSION dimDiameter
SET_DIM_TEXT dimDiameter "@D\n@[Diameter@]"
§
SET_DIM_PREFIX
Sets the prefix for a dimension.
Syntax
SET_DIM_PREFIX refDim<:in> "prefix"
Arguments

refDim
Reference to an existing dimension.

prefix
New dimension prefix. Any string expression is allowed.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SHOW_DIMS ASSEMBLY
USER_SELECT DIMENSION dim
SET_DIM_PREFIX dim "@"
§
SET_DIM_SUFFIX
Sets the suffix for a dimension.
Syntax
SET_DIM_SUFFIX refDim<:in> "suffix"
Arguments

refDim
Reference to an existing dimension.

suffix
New dimension suffix. Any string expression is allowed.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SHOW_DIMS ASSEMBLY
USER_SELECT DIMENSION dim
SET_DIM_SUFFIX dim "mm"
§
SET_DIM_VALUE
Sets dimension value for a dimension reference.
Syntax
SET_DIM_VALUE referenceDimension<:in> valueDOUBLE
Arguments

referenceDimension
Name of an existing reference to a dimension.

value
New dimension value. Any math expression is allowed.
Error handling
The program execution will be canceled if the dimension reference
does not exist or if the dimension could not be set, unless errors
are handled by BEGIN_CATCH_ERROR.
Note
Setting the dimension value does not regenerate the model
automatically. When the model should be regenerated the command
REGEN_MDL could be used.
Example
SHOW_DIMS ASSEMBLY
USER_SELECT DIMENSION dimHeight
SET_DIM_VALUE dimHeight 12.5
REGEN_MDL dimHeight
§
SET_DIM_DISPLAY_TYPE
Modifies the display type of a dimension.
Syntax
SET_DIM_DISPLAY_TYPE refDim<:in> 'display_type'
Description

refDim
Existing reference of a dimension.

display_type
The following types are existing:
BASIC — for basic dimensions.
INSPECTION — for inspection dimensions.
NORMAL — for dimensions which are neither basic nor inspection
dimensions.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
SET_DIM_DISPLAY_TYPE dim "INSPECTION"
§
SET_DIM_TOL
Sets the upper and lower limit from a tolerance of a dimension.
Syntax
SET_DIM_TOL refDim<:in> upperLimitDOUBLE lowerLimitDOUBLE
Description

refDim
Existing reference to a dimension.

upperLimit
Value for the upper tolerance limit. Any math expression is allowed.

lowerLimit
Value for the lower tolerance limit. Any math expression is allowed.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
SET_DIM_TOL dim 0.01 0.02
§
SET_DIM_TOL_TYPE
Modifies the tolerance type of a dimension.
Syntax
SET_DIM_TOL_TYPE refDim<:in> "tol_type"
Description

refDim
Existing reference of a dimension.

tol_type
Tolerance type as string expression. The following types are allowed:
NOMINAL— if only the nominal value without a tolerance is shown.
LIMITS — if upper and lower limit of the dimension are shown.
PLUS_MINUS — if plus and minus tolerances are shown.
PLUS_MINUS_SYM — if plus and minus tolerances are shown by a single
value.
PLUS_MINUS_SYM_SUPERSCRIPT — if plus and minus tolerances are shown
by a single value in a superscript line.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
SET_DIM_TOL_TYPE dim LIMITS
§
SET_DIM_TOL_TABLE
Sets the tolerance table for a dimension.
Syntax
SET_DIM_TOL_TABLE refDim<:in> "table_type" "table_name"
table_columnINT
Description

refDim
Existing reference of a dimension.

table_type
Table type as string expression. The following types are allowed:
NONE— to use no tolerance table.
GENERAL— to use the general tolerance table.
BROKEN_EDGE — to use the broken edge tolerance table.
SHAFT — to use a shaft tolerance table.
HOLE — to use a hole tolerance table.

table_name
Name of the tolerance table as string expression. This is only used
for the table types SHAFT and HOLE.

table_column
Column number of the used tolerance table as math expression. This is
only used for the table types SHAFT and HOLE.
Error handling
The program execution will be canceled if the dimension reference
does not exist or the tolerance table could not be set, unless errors
are handled by BEGIN_CATCH_ERROR.
Note
Tolerance tables could only be set for models with ISO tolerances. To
set shaft or hole tolerances the table has to be applied to the model
first.
Example
USER_SELECT DIMENSION dim
SET_DIM_TOL_TABLE dim HOLE "a" 7
§
SET_DIM_SYMBOL
Modifies dimension symbol.
Syntax
SET_DIM_SYMBOL refDim<:in> "symbol_text"
Arguments

refDim
Reference to an existing dimension.

symbol text
String expression containing the symbol text which is to be applied.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SHOW_DIMS ASSEMBLY
USER_SELECT DIMENSION dim
SET_DIM_SYMBOL dim "main_dia"
§
SET_DIM_DECIMALS
Sets the number of decimals places of a dimension.
Syntax
SET_DIM_DECIMALS refDim<:in> decimalsINT
Description

refDim
Existing reference to a dimension.

decimals
Value for the number of decimals. Any math expression is allowed.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
SET_DIM_DECIMALS dim 3
§
SET_DIM_BOUND
Sets one or many dimension boundaries.
Syntax
SET_DIM_BOUND refDim<:in>|arrayDims<:in> "boundary"
Description

refDim|arrayDims
Existing reference to a dimension or an array of dimension
references.

boundary
String value for the dimension boundary. Valid types are NOMINAL,
UPPER, LOWER or MIDDLE.
Error handling
The program execution will be canceled if the dimension reference
does not exist or the boundary could not be set, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
SET_DIM_BOUND dim "UPPER"
§
SET_MDL_DIMS_BOUND
Sets all dimension boundaries of a model.
Syntax
SET_MDL_DIMS_BOUND model<:in> "boundary"
Description

model
The specified model.

boundary
String value for the dimension boundary. Valid types are NOMINAL,
UPPER, LOWER or MIDDLE.
Error handling
The program execution will be canceled if the model does not exist or
the boundaries could not be set, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_MDL_DIMS_BOUND PART "UPPER"
§
SET_DIM_DISPLAY_ROUNDED
Set the information if the dimension should be displayed as a rounded
value. This function requires Pro/ENGINEER Wildfire 5 / Creo
Elements/Pro 5 or above.
Syntax
SET_DIM_DISPLAY_ROUNDED refDim<:in> dispRoundedBOOL
Description

refDim
Existing reference to a dimension.

dispRounded
Boolean parameter which determines if the dimension is displayed as a
rounded value.
Error handling
The program execution will be canceled if the dimension reference
does not exist or the status can not be modified, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
SET_DIM_DISPLAY_ROUNDED dim TRUE
§
SET_DIM_VALUE_DISPLAY_TYPE
Sets the value display type for a created dimension.
Syntax
SET_DIM_VALUE_DISPLAY_TYPE refDim<:in> "valueDisplayType"
Description

refDim
Existing reference to a dimension.

valueDisplayType
String which defines the value display type. The following types are
existing:
NOMINAL — to display the nominal dimension.
OVERRIDE — to display the override value.
TOLERANCE_ONLY — to display only the tolerance information.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case of a displayed dimension, the display type will not be
changed and no error will occur.
Example
USER_SELECT DIMENSION dim
SET_DIM_VALUE_DISPLAY_TYPE dim "OVERRIDE"
§
SET_DIM_OVERRIDE_VALUE
Sets the dimension override value for a created dimension.
Syntax
SET_DIM_OVERRIDE_VALUE refDim<:in> valueOverride
Description

refDim
Existing reference to a dimension.

valueOverride
Double value for the dimension override.
Error handling
The program execution will be canceled if the dimension reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case of a displayed dimension, the override value will not be set
and no error will occur.
Example
USER_SELECT DIMENSION dim
SET_DIM_OVERRIDE_VALUE dim 100.0
§
SET_DIM_FRACTIONAL
Determines if a solid dimension should be shown as a fractional
value.
Syntax
SET_DIM_FRACTIONAL refDim<:in> formatFractionalBOOL
Description

refDim
Existing reference to a dimension.

formatFractional
Boolean parameter which determines if the dimension is shown in
fractional format.
Error handling
The program execution will be canceled if the dimension reference
does not exist or the format can not be modified, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS PART DIMENSION "*" allDims
FOR dim REF ARRAY allDims
GET_DIM_FRACTIONAL dim fractional

IF fractional == TRUE
fractional = FALSE
ELSE
fractional = TRUE
END_IF

SET_DIM_FRACTIONAL dim fractional


END_FOR
SET_REF_NAME
Sets name to a specified reference in Creo Elements/Pro.
Syntax
SET_REF_NAME reference<:in> [options] "name"
Arguments

reference
Name of an existing reference.

options
The following options are available:
ASK_RENAME_EXISTING valueBOOL — to define if the user is asked in
case existing reference names have to be renamed. Default is TRUE.

name
Name which should be used be applied to the reference. It needs to
follow the Creo Elements/Pro rules for names. Any string expression
is allowed.
Error handling
The program execution will be canceled if the reference does not
exist or if it could not be renamed, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
In case the name contains an asterisk the next available consecutive
number will be used for this to create a new unique name. Otherwise
if another entity in Creo Elements/Pro has the same name, the user
will be asked if the existing name should be erased.
Example
SET_REF_NAME placement_point "NewPlacementPoint"
SET_REF_NAME placement_point "pnt*"
§
SET_FEATURE_NAME
Sets name to a specified feature.
Syntax
SET_FEATURE_NAME reference<:in> [options] "name"
Arguments

reference
Name of an existing reference.

options
The following options are available:
ASK_RENAME_EXISTING valueBOOL — to define if the user is asked in
case existing reference names have to be renamed. Default is TRUE.

name
Name which should be used be applied to the feature. It needs to
follow the Creo rules for names. Any string expression is allowed.
Error handling
The program execution will be canceled if the reference does not
exist or if it could not be renamed, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
In case the name contains an asterisk the next available consecutive
number will be used for this to create a new unique name. Otherwise
if another entity in Creo has the same name, the user will be asked
if the existing name should be erased.
Unlike SET_REF_NAME this command sets the feature name of a component
feature.
Example
SET_FEATURE_NAME feature "new_feature"
SET_FEATURE_NAME feature "new_feature_*"
DESIGNATE_MDL_PARAM
Designates model parameters.
Syntax
DESIGNATE_MDL_PARAM model "param_name" designateBOOL
Arguments

model
Model which contains the parameters according to to designate or un-
designate.

param_name
Name of the parameter which should be assigned.

designate
Boolean variable if the parameter should be designated or not.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
DESIGNATE_MDL_PARAM THIS "sample1" TRUE
DESIGNATE_MDL_PARAM THIS "sample2" FALSE
DESIGNATE_FEAT_PARAM
Designates feature or component feature parameters.
Syntax
DESIGNATE_FEAT_PARAM feature "param_name" designateBOOL
Arguments

feature
Reference to a feature which contains the parameters to designate or
un-designate.

param_name
Name of the parameter which should be assigned.

designate
Boolean variable if the parameter should be designated or not.
Error handling
The program execution will be canceled if the feature or the
parameter does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
DESIGNATE_FEAT_PARAM feat "sample1" TRUE
DESIGNATE_FEAT_PARAM feat "sample2" FALSE
§
DESIGNATE_ATTRIBUTE
Designates a dimension, geometric tolerance surface or surface finish
symbol.
Syntax
DESIGNATE_ATTRIBUTE refAttriute<:in> designateBOOL
Arguments

refAttribute
Reference to the attribute which should be designated or un-
designated.

designate
Boolean variable if the parameter should be designated or not.
Error handling
The program execution will be canceled if the attribute does not
exist or could not be designated, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFFINISH | GTOL | DIMENSION | FEATURE dim
DESIGNATE_ATTRIBUTE dim TRUE
§
SET_MDL_PARAM_LOCK_STATUS
Sets the lock status of a Creo model parameter.
Syntax
SET_MDL_PARAM_LOCK_STATUS model<:in> "param_name" "lock_status"
Arguments

model
Reference to the model which contains the parameter whose lock status
should be set.

param_name
Name of the parameter. Any string expression is allowed.

lock_status
String variable which contains the lock status. Any string expression
is allowed. The following lock states are available:
UNLOCKED — the parameter has no restrictions.
LIMITED — write access to the parameter is limited.
LOCKED — the parameter could not be changed.
Error handling
The program execution will be canceled if the model or the parameter
does not exist or the lock status could not be changed, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
SET_MDL_PARAM_LOCK_STATUS PART "my_parameter" "LOCKED"
§
SET_FEAT_PARAM_LOCK_STATUS
Sets the lock status of a Creo feature parameter.
Syntax
SET_FEAT_PARAM_LOCK_STATUS refFeature<:in> "param_name" "lock_status"
Arguments

refFeature
Reference to the feature which contains the parameter whose lock
status should be set.

param_name
Name of the parameter. Any string expression is allowed.

lock_status
String variable which contains the lock status. Any string expression
is allowed. The following lock states are available:
UNLOCKED — the parameter has no restrictions.
LIMITED — write access to the parameter is limited.
LOCKED — the parameter could not be changed.
Error handling
The program execution will be canceled if the feature or the
parameter does not exist or the lock status could not be changed,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART FEATURE "*" firstFeature
SET_FEAT_PARAM_LOCK_STATUS firstFeature "my_parameter" "LOCKED"
§
SET_REF_PARAM_LOCK_STATUS
Sets the lock status of a Creo reference parameter.
Syntax
SET_REF_PARAM_LOCK_STATUS reference<:in> "param_name" "lock_status"
Arguments

reference
Reference which contains the parameter whose lock status should be
set.

param_name
Name of the parameter. Any string expression is allowed.

lock_status
String variable which contains the lock status. Any string expression
is allowed. The following lock states are available:
UNLOCKED — the parameter has no restrictions.
LIMITED — write access to the parameter is limited.
LOCKED — the parameter could not be changed.
Error handling
The program execution will be canceled if the reference or the
parameter does not exist or the lock status could not be changed,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART EDGE "*" firstEdge
SET_REF_PARAM_LOCK_STATUS firstEdge "my_parameter" "LOCKED"
§
SET_MDL_PARAM_DESCRIPTION
Sets the description of a Creo model parameter.
Syntax
SET_MDL_PARAM_DESCRIPTION model<:in> "param_name" "description"
Arguments

model
Reference to the model which contains the parameter whose description
should be set.

param_name
Name of the parameter. Any string expression is allowed.

description
Parameter description. Any string expression is allowed.
Error handling
The program execution will be canceled if the model or the parameter
does not exist or the description could not be changed, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
SET_MDL_PARAM_DESCRIPTION PART "my_parameter" "This is my parameter"
§
SET_FEAT_PARAM_DESCRIPTION
Sets the description of a Creo feature parameter.
Syntax
SET_FEAT_PARAM_DESCRIPTION refFeature<:in> "param_name" "description"
Arguments

refFeature
Reference to the feature which contains the parameter whose
description should be set.

param_name
Name of the parameter. Any string expression is allowed.

description
Parameter description. Any string expression is allowed.
Error handling
The program execution will be canceled if the feature or the
parameter does not exist or the description could not be changed,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART FEATURE "*" firstFeature
SET_FEAT_PARAM_DESCRIPTION firstFeature "my_parameter" "This is my
parameter"
§
SET_REF_PARAM_DESCRIPTION
Sets the description of a Creo reference parameter.
Syntax
SET_REF_PARAM_DESCRIPTION reference<:in> "param_name" "description"
Arguments

reference
Reference which contains the parameter whose description should be
set.

param_name
Name of the parameter. Any string expression is allowed.

description
Parameter description. Any string expression is allowed.
Error handling
The program execution will be canceled if the reference or the
parameter does not exist or the description could not be changed,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART EDGE "*" firstEdge
SET_REF_PARAM_DESCRIPTION firstEdge "my_parameter" "This is my
parameter"
SAVE_REFERENCE
Stores a reference information to a component feature. This command
is useful for supplying reference information for components which
should be created by Create Existing Component or Copy Existing
Component.
Syntax
SAVE_REFERENCE refFeature<:in> reference<:in>
Arguments

refFeature
Existing reference to a feature or component feature.

reference
Name of the reference which should be stored to the component
feature.

Error handling
The program execution will be canceled if the feature or the
reference does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
More information about the use of this command is available in
reusing references and parameters.
Example
SAVE_REFERENCE COMP_FEAT REF_SURFACE
§
About Commands for the selection buffer
The selection buffer commands provide the functionality to read and
manipulate currently selected references in Pro/ENGINEER / Creo.
The following commands are available:
ADD_SELBUFFER — to add a reference or an array of reference to the
selection buffer.
GET_SELBUFFER — to retrieve all references from the selection buffer.
CLEAR_SELBUFFER — to remove all references from the selection buffer.
§
ADD_SELBUFFER
Adds a reference or an array of reference to the selection buffer.
Syntax
ADD_SELBUFFER reference<:in> | arrayRefs<:in>
Arguments

reference | arrayRefs
Name of a reference or an array of references. These reference will
be added to the selection buffer.
Error handling
The program execution will be canceled if the reference or the array
are not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELET MODEL mdl
ADD_SELBUFFER mdl
§
GET_SELBUFFER
Retrieves all references from the selection buffer.
Syntax
GET_SELBUFFER arrayRefs<:out>
Arguments

arrayRefs
Name of the array which receives the current references of the
selection buffer.
Example
GET_SELBUFFER arrayReferences
FOR curRef REF ARRAY arrayReferences
PRINT "%" curRef
END_FOR
§
CLEAR_SELBUFFER
Removes all references from the selection buffer.
Syntax
CLEAR_SELBUFFER
Example
CLEAR_SELBUFFER
About Commands for Data Handling
Commands for data handling via program variables.
The following commands are available:
DECLARE_VARIABLE — to declare a variable of type parameter.
DECLARE_REFERENCE — to declare a variable of type reference.
DECLARE_STRUCT — to declare a variable of a specific structure.
ASSIGN_VALUE — to assign a value to a variable of type parameter.
COPY_REF — to assign a reference to a variable to type reference.
INVALIDATE_REF — to invalidate a variable of type reference.
INVALIDATE_PARAM — to invalidate a variable of type parameter.
GET_PARAM_TYPE — to retrieve the type of variable of type
parameter.
GET_VARIABLE_TYPE — to retrieve the type of a variable.
SEARCH_VARIABLE — to search for a variable by name.
SEARCH_VARIABLES — to search for variables by name.
SEARCH_VARIABLE_NAMES — to search for the names of existing
variables.
DECLARE_VARIABLE
Declaration of a new parameter variable. A standard value could be
specified.
Syntax
DECLARE_VARIABLE parameter_type parameter<:out> default_value STRNUM
Arguments

parameter_type
The specified parameter type.

parameter
Name for the parameter which should be declared.

default_value
Optional default value for the parameter. Depending on the parameter
type this could either be specified through a string expression or
through a math expression.
Note
The default value is only used if the parameter is not already
existing. This is especially useful for standard values in UDF
programs. On modification the standard values do not overwrite the
value of the created UDF.
Example
DECLARE_VARIABLE DOUBLE TEST_PARAM 12
DECLARE_REFERENCE
Declaration of a new reference variable. A standard value could be
specified.
Syntax
DECLARE_REFERENCE reference<:out> [refDefault<:in>]
Description

reference
Name of the reference which should be declared.

refDefault
Optional existing reference for providing a default value.
Note
The default reference is only used if the new reference not already
existing.
Example
DECLARE_REFERENCE ref THIS
DECLARE_STRUCT
Declaration of a new structure variable.
Syntax
DECLARE_STRUCT TYPE varStruct<:out>
Description

TYPE
Type of the structure. Valid types are listed in the section Specify
Structures.

varStruct
Structure variable which will be declared.
Example
DECLARE_STRUCT POINT pnt
pnt.x = 100
pnt.y = 200
pnt.z = 300
ASSIGN_VALUE
Assigns a value or content of a parameter to another parameter.
Syntax
ASSIGN_VALUE param_source<:in> param_target<:out>
Arguments

param_source
Existing parameter which content is to be copied.

param_target
New or existing parameter which will receive the content of the
source parameter.
Note
This command is mainly available for backward compatibility.
Assignment operations in conjunction with DECLARE_VARIABLE are more
flexible as this command.
COPY_REF
Copies content from one existing reference to a new reference name.
Syntax
COPY_REF [options] reference1<:in> reference2<:out>
Arguments

options
Valid options are:
NO_UPDATE: In case a component is assembled, references are
automatically updated to keep SEARCH_MDL_REF results of a
component valid after it was assembled. In case of assembling,
removing and re-assembling of the same component in one tab file,
this results in invalid references. References copied by the
NO_UPDATE option will not be updated when their component is
assembled.

reference1
Name of an existing reference.

reference2
Name of the reference which should receive the same information.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
COPY_REF placement_point placement_point1
INVALIDATE_REF
Invalidates an existing reference.
Syntax
INVALIDATE_REF reference<:in>
Arguments

reference
Name of an existing reference.
Note
This function is mainly used in while loops containing CALL
statements.
INVALIDATE_PARAM
Invalidates an existing parameter.
Syntax
INVALIDATE_PARAM parameter<:in>
Arguments

parameter
Name of an existing parameter.
Example
INVALIDATE_PARAM Text
GET_PARAM_TYPE
Detects type of an existing parameter.
Syntax
GET_PARAM_TYPE parameter<:in> parameterType<:out>
Arguments

parameter
Name of an existing parameter.

parameterType
Name of the parameter which will receive the type information. The
result will be either one of the following types or it will be
UNKNOWN.
Error handling
The program execution will be canceled if the parameter<:in> does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example:
DECLARE_VARIABLE DOUBLE SampleParam
GET_PARAM_TYPE SampleParam SampleType
PRINT "Type: %" SampleType
§
GET_VARIABLE_TYPE
Detects type of an existing variable.
Syntax
GET_VARIABLE_TYPE variable<:in> parameterType<:out>
Arguments

variable
Name of an existing variable.

parameterType
Name of the parameter which will receive the type information. After
the command was executed successfully the output parameter contains
one of the values:
PARAMETER — for variable of type INTEGER, DOUBLE, BOOL or STRING.
REFERENCE — for references.
ARRAY — for arrays.
MAP — for maps.
STRUCT — for all kind of structures.
FILE — for file descriptors.
TOOLKIT_HANDLE — for toolkit application handles.
JLINK_HANDLE — for jlink application handles.
XML_ELEMENT — for xml nodes or documents.
STOPWATCH — for stopwatch variables.
Error Handling
The program execution will be canceled if the variable does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
This command is especially useful for array elements which could
cover parameters, references or sub arrays.
Example
GET_VARIABLE_TYPE testVar paramVarType
IF paramVarType == "PARAMETER"
PRINT "This is a parameter"
ELSE_IF paramVarType == "REFERENCE"
PRINT "This is a reference"
ELSE_IF paramVarType == "ARRAY"
PRINT "This is an array"
END_IF
§
SEARCH_VARIABLE
Searches an existing variable by name. Wildcards can be used for the
search.
Syntax
SEARCH_VARIABLE "search_string" variable<:out>
Arguments

search_string
Name of the variable to search for. Any string expression is allowed.
Wildcards can be used for the search.

variable
Name of the output variable which receives the information about the
searched variable.
Error Handling
The program execution will be canceled if the variable can not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_VARIABLE_NAMES "*" arrayVariableNames
FOR varName REF ARRAY arrayVariableNames
SEARCH_VARIABLE varName varValue
PRINT "% %" varName varValue
END_FOR
§
SEARCH_VARIABLES
Searches existing variables by name. Wildcards can be used for the
search.
Syntax
SEARCH_VARIABLES "search_string" array<:out>
Arguments

search_string
Name of the variables to search for. Any string expression is
allowed. Wildcards can be used for the search.

array
Name of the array which receives the variable.
Example
SEARCH_VARIABLES "*" arrayVariables
FOR var REF ARRAY arrayVariables
PRINT "%" var
END_FOR
§
SEARCH_VARIABLE_NAMES
Searches for the names of existing variables by a search string.
Syntax
SEARCH_VARIABLE_NAMES "search_string" arrayVariableNames<:out>
Arguments

search_string
Name of the variables to search for. Any string expression is
allowed. Wildcards can be used for the search.

arrayVariableNames
Name of the array which receives the variable names
Example
SEARCH_VARIABLE_NAMES "*" arrayVariableNames
FOR varName REF ARRAY arrayVariableNames
SEARCH_VARIABLE varName varValue
PRINT "% %" varName varValue
END_FOR
About Commands for Arrays
Commands to declare, read from and write to arrays. Arrays are
collections to store an arbitrary number of elements.
The following commands are available:
DECLARE_ARRAY — to declare a variable of type array.
GET_ARRAY_SIZE — to retrieve the size of an array.
GET_ARRAY_ELEM — to retrieve an element of an array.
ADD_ARRAY_ELEM — to add a new element to an array.
INSERT_ARRAY_ELEM — to insert a new element into an array at a
specific position.
SET_ARRAY_ELEM — to update an element of an array
FIND_ARRAY_ELEM — to search for an element in an array.
DELETE_ARRAY_ELEM — to delete an element from an array
CLEAR_ARRAY — to remove all elements from an array.
SORT_ARRAY — to sort all elements of an array.
TRANSPOSE_ARRAY — to retrieve an array which switches row and
column location of an array with sub-arrays.
GET_COL_ARRAY — to retrieve a specified column of an array with
sub-arrays to get an array with plain elements.
GET_ROW_ARRAY — to retrieve a specified row of an array with sub-
arrays to get an array with plain elements.
DECLARE_ARRAY
Declares an array variable for storing variables.
Syntax
DECLARE_ARRAY array<:out>
Arguments

array
Name of the new array which will be created.
Example
DECLARE_ARRAY testArray
GET_ARRAY_SIZE
Determines the number of elements in an array.
Syntax:
GET_ARRAY_SIZE array<:in> [sub_array_index] parameter<:out>
Arguments

array
Name of an existing array.

sub_array_index
Optional index for direct access of an sub array.

parameter
Name of the parameter which should containing the number of elements
stored in the array.
Example
GET_ARRAY_SIZE testArray sizeTestArray
GET_ARRAY_ELEM
Retrieves a specific element of an array specified by the index
number and stores it in a variable.
Syntax
GET_ARRAY_ELEM array<:in> [sub_array_index] numberINT variable<:out>
Arguments

array
Name of an existing array.

sub_array_index
Optional index for direct access of an sub array.

number
Number of the element which should be received. Element numbers start
with 0 for the first element. Any math expression is valid to
calculate this number.

variable
Name of the variable which should contain the element after the
command is processed.
Error handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR. If the index exceeds
the array size the program execution will be canceled in any case.
The array size could be determined via GET_ARRAY_SIZE.
Example
GET_ARRAY_ELEM testArray 0 value
GET_ARRAY_ELEM testArray[0] 0 value1
ADD_ARRAY_ELEM
Appends a new element to the end of an array. The element is a
variable of type parameter, reference or array. That means an array
can be an elements of another array.
Syntax
ADD_ARRAY_ELEM array<:in> [sub_array_index] variable<:in>
Arguments

array
Name of an existing array.

sub_array_index
Optional index for direct access of an sub array.

variable
Name of an existing variable.
Error handling
The program execution will be canceled if the array or the variable
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Adding a sub array to an array creates a copy of the sub array in
memory. Adding elements to the sub array is only possible by using
indices on the main array.
Example
DECLARE_ARRAY testArray
DECLARE_ARRAY subArray
ADD_ARRAY_ELEM testArray subArray
ADD_ARRAY_ELEM testArray "value 1"
ADD_ARRAY_ELEM testArray 18
ADD_ARRAY_ELEM testArray[0] "value 2"
INSERT_ARRAY_ELEM
Inserts a new element of an array into a specific position. All
further elements are moved to the next position. The element is a
variable of type parameter, reference or array. That means an array
can be an elements of another array. In case the index exceeds the
number of existing elements, a new element is appended at the end of
the array.
Syntax
INSERT_ARRAY_ELEM array<:in> [sub_array_index] numberINT
variable<:in>
Arguments

array
Name of an existing array.

sub_array_index
Optional index for direct access of an sub array.

number
Array position in which the new element should be inserted. Element
numbers start with 0 for the first element. Any math expression is
valid to calculate this number.

variable
Name of an existing variable.
Error handling
The program execution will be canceled if the array or the variable
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Adding a sub array to an array creates a copy of the sub array in
memory. Adding elements to the sub array is only possible by using
indices on the main array.
Example
DECLARE_ARRAY testArray
ADD_ARRAY_ELEM testArray "value1"
ADD_ARRAY_ELEM testArray "value3"
INSERT_ARRAY_ELEM testArray 1 "value2"
SET_ARRAY_ELEM
Updates an existing element of an array. The element is a variable of
type parameter, reference or array. That means an array can be an
elements of another array. In case the index exceeds the number of
existing elements, a new element is appended at the end of the array.
Syntax
SET_ARRAY_ELEM array<:in> [sub_array_index] numberINT variable<:in>
Arguments

array
Name of an existing array.

sub_array_index
Optional index for direct access of an sub array.

number
Number of the element which should be updated. Element numbers start
with 0 for the first element. Any math expression is valid to
calculate this number.

variable
Name of an existing variable.
Error handling
The program execution will be canceled if the array or the variable
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Adding a sub array to an array creates a copy of the sub array in
memory. Adding elements to the sub array is only possible by using
indices on the main array.
Example
DECLARE_ARRAY testArray
ADD_ARRAY_ELEM testArray "value1"
ADD_ARRAY_ELEM testArray "value1"
SET_ARRAY_ELEM testArray 1 "value2"
FIND_ARRAY_ELEM
Searches for an element in an array and returns the array index or -1
in case it was not found.
Syntax
FIND_ARRAY_ELEM array<:in> element<:in> [sub_array_index] index<:out>
Arguments

array
Name of an existing array.

element
Name of an existing variable or string or number value to search.

sub_array_index
Optional index for direct access of an sub array.
number

index
Name of the parameter which will receive the index.
Error handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_ARRAY testArray
ADD_ARRAY_ELEM testArray "value 1"
ADD_ARRAY_ELEM testArray "value 2"
ADD_ARRAY_ELEM testArray "value 3"
FIND_ARRAY_ELEM testArray "value 2" index
PRINT "Array index: %" index
DELETE_ARRAY_ELEM
Deletes an element from the array specified by the index number.
Syntax:
DELETE_ARRAY_ELEM array<:in> [sub_array_index] numberINT
Arguments

array
Name of an existing array.

sub_array_index
Optional index for direct access of an sub array.

number
Index of the array element which should be removed. The index of the
first element is 0.
Error Handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case the complete array should be erased the command CLEAR_ARRAY
could be used.
Example
DELETE_ARRAY_ELEM testArray 0
CLEAR_ARRAY
Erases all elements from an array.
Syntax
CLEAR_ARRAY array<:in>
Arguments

array
Existing array.
Error Handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case only some elements of the array should be erased the command
DELETE_ARRAY_ELEM could be used.
Example
CLEAR_ARRAY testArray
SORT_ARRAY
Sorts all elements of an array. Sub arrays are sorted.
Syntax
SORT_ARRAY 'order_option' array<:in>
Arguments

order_option
Use either ASCENDING or DESCENDING for the order.

array
Existing array.
Error Handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
Integer, double and string values are sorted by their normal order.
Elements which are an sub array are sorted due to their first
element. Other kind of elements are just sorted by their type.
Example
SORT_ARRAY ASCENDING testArray
TRANSPOSE_ARRAY
Retrieves an array which switches row and column location of an array
with sub-arrays. This is similar to computing a transposed matrix.
Syntax
TRANSPOSE_ARRAY array<:in> transposed_array<:out>
Arguments

array
Existing variable of type array which has sub arrays as array
elements.

transposed_array
Name of an array variable which receives the transposed array.
Error handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
ODBC_QUERY "SELECT * FROM \"Personen\"" arrayDatasets
TRANSPOSE_ARRAY arrayDatasets arrayTransposedDatasets
GET_COL_ARRAY
Retrieves a specified column of an array with sub-arrays to get an
array with plain elements. This is similar to receiving a column
vector from a matrix.
Syntax
GET_COL_ARRAY array<:in> columnINT array_columns<:out>
Arguments

array
Existing variable of type array which has sub arrays as array
elements.

column
Column number as an integer variable. Numbers start with 0.

array_columns
Name of an array variable which receives the values of the specified
column.
Error handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR. If the column index
exceeds the array size the program execution will be canceled in any
case. The array size could be determined via GET_ARRAY_SIZE.
Example
ODBC_QUERY "SELECT * FROM \"Personen\"" arrayDatasets
GET_COL_ARRAY arrayDatasets 0 arrayIds
GET_COL_ARRAY arrayDatasets 1 arrayFirstNames
GET_COL_ARRAY arrayDatasets 2 arrayFamilyNames
GET_ROW_ARRAY
Retrieves a specified row of an array with sub-arrays to get an array
with plain elements. This is similar to receiving a row vector from a
matrix.
Syntax
GET_ROW_ARRAY array<:in> rowINT array_rows<:out>
Arguments

array
Existing variable of type array which has sub arrays as array
elements.

row
Row number as an integer variable. Numbers start with 0.

array_row
Name of an array variable which receives the values of the specified
row.
Error handling
The program execution will be canceled if the array does not exist,
unless errors are handled by BEGIN_CATCH_ERROR. If the row index
exceeds the array size the program execution will be canceled in any
case. The array size could be determined via GET_ARRAY_SIZE.
Example
ODBC_QUERY "SELECT * FROM \"Personen\"" arrayDatasets
GET_ROW_ARRAY arrayDatasets 0 arrayFirstdataset
§
About Commands for Maps
Commands to declare, read from and write to maps. Maps are containers
to store all kind of variables by name.
The following commands are available:
DECLARE_MAP — to declare a variable of type map.
GET_MAP_SIZE — to retrieve the size of a map.
ADD_MAP_ELEM — to add a new element to a map.
GET_MAP_ELEM — to retrieve an element of a map.
DELETE_MAP_ELEM — to delete an element from a map.
CLEAR_MAP — to remove all elements from a map.
§
DECLARE_MAP
Declares a map variable for storing variables by a key name.
Syntax
DECLARE_MAP map_key_type map<:out>
Arguments

map_key_type
The specified map type.

map
Name of the new map which will be created.
Example
DECLARE_MAP STRING testMap
§
GET_MAP_SIZE
Determines number of elements in a map.
Syntax
GET_MAP_SIZE map<:in> parameter<:out>
Arguments

map
Name of an existing map.

parameter
Name of the parameter which should containing the number of elements
stored in the map.
Example
GET_MAP_SIZE testMap sizeTestMap
§
ADD_MAP_ELEM
Adds a new element to a map.
Syntax
ADD_MAP_ELEM map<:in> "key" variable<:in>
Arguments

map
Name of an existing map.

key
Key for which the variable is stored. Any string expression is
allowed.

variable
Name of an existing variable.
Error handling
The program execution will be canceled if the map does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_MAP STRING testMap
ADD_MAP_ELEM testMap "key1" "value"
ADD_MAP_ELEM testMap "key2" 18
GET_MAP_ELEM testMap "key1" data1
§
GET_MAP_ELEM
Retrieves an element of a map specified by its key name and stores it
in a variable.
Syntax
GET_MAP_ELEM map<:in> "key" variable<:out>
Arguments

map
Name of an existing map.

key
Key for which the variable is stored. Any string expression is
allowed.

variable
Name of the variable which should contain the element after the
command is processed.
Error handling
The program execution will be canceled if the map or the searched
element does not exist, unless errors are handled by
BEGIN_CATCH_ERROR
Example
DECLARE_MAP STRING testMap
ADD_MAP_ELEM testMap "key1" "value"
ADD_MAP_ELEM testMap "key2" 18
GET_MAP_ELEM testMap "key1" data1
§
DELETE_MAP_ELEM
Deletes an element from the map specified by its name.
Syntax:
DELETE_MAP_ELEM map<:in> "key"
Arguments

map
Name of an existing map.

key
Key for which the variable was stored. Any string expression is
allowed.
Error Handling
The program execution will be canceled if the map or the element does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case the complete map should be erased the command CLEAR_MAP could
be used.
Example
DELETE_MAP_ELEM testMap "key1"
§
CLEAR_MAP
Erases all elements from a map
Syntax
CLEAR_MAP map<:in>
Arguments

map
Existing map.
Error Handling
The program execution will be canceled if the map does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case only some elements of the map should be erased the command
DELETE_MAP_ELEM could be used.
Example
CLEAR_MAP testMap
About Commands for Information Output
Commands for showing information for the user.
The following commands are available:
PRINT — to show information in the message area.
CLEAR_MESSAGE_AREA — to clear the message area.
MESSAGE_BOX — to show information in a message box.
MESSAGE_BOX_EX — to show a message box with buttons.
PROCESSING_BOX_START — to show a processing message box during the
tab file is processed.
PROCESSING_BOX_SET_STATE — to display a process bar in the
processing message box and set its percentage.
PROCESSING_BOX_END — terminates a processing message box.
PRINT
Output of text messages in the Creo Elements/Pro message area.
Syntax
PRINT [options] "format" [argument] [ argument ] ...
Arguments

options
The following options are available:
MESSAGE_SYMBOL "symbol" — determines the message symbol. Valid
symbols are NONE, PROMPT, INFO, WARNING, ERROR and CRITICAL.
Default is INFO.

format
The format is a text string. Every percentage sign '%' will be
replaced with content of the following arguments. In case the format
string contains spaces it should be placed in quotation marks
("..."). In case a percentage sign should be printed in the message
area, two consecutive percentage signs need to be specified: '%%'.

arguments
Number of arguments according to percentage sign in the format
string. The Arguments could be string, number or parameter expression
according to the rules for math equations and string expressions.
The following arguments are predefined:
__LINE__ — for the current line of the tab file.
Note
References could also be specified as arguments. In this case the
content of reference is shown.
Example
DECLARE_VARIABLE DOUBLE PARAM_TEST 1.23
PRINT "Parameter test: %" PARAM_TEST
§
CLEAR_MESSAGE_AREA
Clears the message area. This is supported since Creo 3.0 M190, Creo
4.0 M080, Creo 5.0.3.0 and above.
Syntax
CLEAR_MESSAGE_AREA
Example
PRINT "last line"
CLEAR_MESSAGE_AREA
§
MESSAGE_BOX
Shows a message in a box. The program will halt until the user is
pressing the OK button.
Syntax
MESSAGE_BOX [options] "text"
Arguments

options
The following options are available:
SCREEN_LOCATION location option — use one of the location option to
define where the dialog should appear. If not defined the dialog
with appear in the center of the screen.
IMAGE "image" — to show an image in the message box.

text
Text which should be displayed in the message box. Any string
expression is allowed.
Example
MESSAGE_BOX "Please press the button"
§
MESSAGE_BOX_EX
Extended version of the message box. Shows a message in a box with
buttons. The program will halt until the user is pressing a button or
the cancel button in the title bar.
Syntax
MESSAGE_BOX_EX [options] type "caption" "message" arrayButtons<:in>
param_resultINT<:out>
Arguments

options
The following options are available:
SCREEN_LOCATION location option — use one of the location option to
define where the dialog should appear. If not defined the dialog
with appear in the center of the screen.
IMAGE "image" — to show an image in the message box.

type
On of the following types:
GENERAL — for general messages without an icon.
QUESTION — for questions, shows a question mark.
NOTIFICATION — for notifications, shows a notification icon.
WARNING — for warnings, shows an exclamation mark.
ERROR — for errors, shows the error icon.

caption
Text which will be displayed in the headline of the dialog.

message
Text which will be displayed in the message box.

arrayButtons
Array of string variables containing the button names.

param_result
Name of the output parameter of type integer. It will receive the
number of the pressed button starting with 1. In case of the cancel
button the result will be 0.
Example
DECLARE_ARRAY arrayButtons
ADD_ARRAY_ELEM arrayButtons "Create UDF"
ADD_ARRAY_ELEM arrayButtons "Skip"
ADD_ARRAY_ELEM arrayButtons "Exit"

MESSAGE_BOX_EX QUESTION "user input" "What should we do" arrayButtons


paramChoice
IF paramChoice == 1
CREATE_UDF sample PART
...
END_CREATE_UDF
ELSE_IF paramChoice <> 2
EXIT
END_IF
§
PROCESSING_BOX_START
Shows a processing dialog box in the bottom right corner while the
tab file is processed.
Syntax
PROCESSING_BOX_START [options] "message"
Arguments

options
The following options are available:
SCREEN_LOCATION location option — use one of the location option to
define where the dialog should appear. If not defined the dialog
with appear in the bottom right corner of the screen.
IMAGE "image" — to show an image in the processing box.

message
Text which will be displayed in the message box.
Note
In case the configuration option SHOW_PROCESSING_BOX is set to YES a
processing dialog box will be shown up automatically for any tab
file.
Example
PROCESSING_BOX_START "tab file is currently processed"

PROCESSING_BOX_SET_STATE 0
SLEEP 10

PROCESSING_BOX_SET_STATE 50
SLEEP 10

PROCESSING_BOX_SET_STATE 100
SLEEP 10

PROCESSING_BOX_END
§
PROCESSING_BOX_SET_STATE
Displays a process bar in the processing dialog box and sets the
current percentage.
Syntax
PROCESSING_BOX_SET_STATE percentage INT
Arguments

percentage
Percentage which is already processed. If the number is smaller than
zero, the process bar will be hidden.
Example
PROCESSING_BOX_START "tab file is currently processed"

PROCESSING_BOX_SET_STATE 0
SLEEP 10

PROCESSING_BOX_SET_STATE 50
SLEEP 10

PROCESSING_BOX_SET_STATE 100
SLEEP 10

PROCESSING_BOX_END
§
PROCESSING_BOX_END
Terminates an active processing dialog box.
Syntax
PROCESSING_BOX_END
Example
PROCESSING_BOX_START "tab file is currently processed"

PROCESSING_BOX_SET_STATE 0
SLEEP 10

PROCESSING_BOX_SET_STATE 50
SLEEP 10

PROCESSING_BOX_SET_STATE 100
SLEEP 10

PROCESSING_BOX_END
About Commands for Modifying Geometry
Commands for modifying existing geometry.
The following commands are available:
LINK_SKETCH — to redefine the sketch of a feature according a
surface or a curve chain without dependency.
LINK_SKETCH_MDL — to redefine the sketch of a feature according to
a section model.
SKETCH_USE_EDGE — to redefine the sketch of a feature according a
surface or a curve chain with dependency.
REMOVE_SKETCH_REFS — to remove all sketch references and use a
coordinate system reference instead.
UNLINK_SKETCH — to convert the external sketch of a feature to an
internal one.
TRIM_TO_PART — to trim a library part against the solid surfaces of
a model.
CREATE_JOINT — to create a joint condition for an offset coordinate
system.
LINK_SKETCH
Redefines the sketch of a feature according to the shape of a surface
or curve by adjusting the sketch. No dependency to the source surface
or curve is created.
Syntax:
LINK_SKETCH model feature_idINT reference<:in> | arrayCurves<:in>
[UPDATE_ON_REGEN]
Arguments

model
The model that contains the features to redefine.

feature_id
Feature ID of the feature to redefine. Any math expression is
allowed.

reference
Existing reference of a surface or curve whose first sketch should be
used as the source.

arrayCurves
Existing array of curve references which should be used as sketch.

UPDATE_ON_REGEN
Optional statement which updates the link sketch feature in each
regeneration cycle.
Error handling
The program execution will be canceled if model or reference are not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The first element in the sketch must be a sketcher coordinate system
which is constraint against a projected model coordinate system. All
other elements must be constrained only against this coordinate
system. If this is not the case the command will fail.
The difference to the command SKETCH_USE_EDGE is that not Creo
Elements/Pro dependency to the source geometry is created.
If UPDATE_ON_REGEN is not specified, the user has to use
SmartAssembly > Link Sketch Feature > ... functionality to update the
link sketch features.
Example
USER_SELECT SURFACE refSurface
LINK_SKETCH THIS 5127 refSurface
LINK_SKETCH_MDL
Redefines the sketch of a feature according to the shape of a section
model.
Syntax:
LINK_SKETCH_MDL model feature_idINT model_section<:in>
Arguments

model
The model that contains the features to redefine.

feature_id
Feature ID of the feature to redefine. Any math expression is
allowed.

model_section
Existing reference to the section model.
Error handling
The program execution will be canceled if model or reference are not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The first element in the sketch of the existing model must be a
sketcher coordinate system which is constraint against a projected
model coordinate system. The first element of the section model must
also be a coordinate system in order to place the origin.
Example
RETRIEVE_MDL "sample.prt" mdlSample
RETRIEVE_MDL "sample_section.sec" mdlSection
LINK_SKETCH_MDL mdlSample 10 mdlSection
SKETCH_USE_EDGE
Redefines the sketch of a feature according to the shape of a surface
or curve by using its edges. The feature will become dependent to the
source surface or curve.
Syntax:
SKETCH_USE_EDGE model feature_idINT reference<:in> | arrayCurves<:in>
[options]
Arguments

model
The model that contains the features to redefine.

feature_idINT
Feature ID of the feature to redefine. Any math expression is
allowed.

reference
Existing reference of a surface or curve whose first sketch should be
used as the source.

arrayCurves
Existing array of curve references which should be used as sketch.

options:
The following options are supported:
TRIM_SKETCH trimBOOL — defines if curves should be trimmed. Default
is FALSE.

SORT_SKETCH sortBOOL — defines if curves should be sorted. Default


is FALSE.

CREATE_SKETCH_POINT createBOOL — defines if points should be


created for each curve in the sketch. Default is FALSE.
Error handling
The program execution will be canceled if model or reference are not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The difference to the command LINK_SKETCH is, that a Creo
Elements/Pro dependency is created to the source geometry.
Example:
USER_SELECT SURFACE refSurface
SKETCH_USE_EDGE THIS 5127 refSurface
REMOVE_SKETCH_REFS
Removes all sketch references and uses a coordinate system reference
instead.
Syntax:
REMOVE_SKETCH_REFS model feature_idINT refCsysOrigin<:in>
Arguments

model
The model that contains the features to redefine.

feature_idINT
Feature ID of the feature to redefine. Any math expression is
allowed.

refCsysOrigin
Existing coordinate system reference which should be used as solely
sketch reference.
Error handling
The program execution will be canceled if model or coordinate
reference are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example:
USER_SELECT FEATURE feat
USER_SELECT CSYS csysOrigin
GET_REF_ID feat id
GET_REF_OWNER feat owner
REMOVE_SKETCH_REFS owner id csysOrigin
§
UNLINK_SKETCH
Converts the external sketch of a feature to an internal one, similar
like the Unlink button in the Edit Definition dialog.
Syntax:
UNLINK_SKETCH feature<:in>
Arguments

feature
Reference to an existing feature with an external sketch.
Error handling
The program execution will be canceled if feature is not existing or
the command fails, unless errors are handled by BEGIN_CATCH_ERROR.
Note
No error will be generated in case the feature has already an
internal sketch.
Example
USER_SELECT FEATURE feature
UNLINK_SKETCH feature
§
TRIM_TO_PART
Trims a library part against the solid surfaces of a specified model.
Syntax
TRIM_TO_PART reference<:in> model
Arguments

reference
Existing reference of a surface which is used for trimming.

model
The model against which to trim.
Example
TRIM_TO_PART surface_bottom placement_point
§
CREATE_JOINT
Creates a joint condition for an offset coordinate system which is
driven by 3 length and 3 angle dimensions and refers to a parent
coordinate system. The dimensions of this coordinate system are
always updated to match another coordinate system.
Syntax:
CREATE_JOINT [options] refCsysSource<:in> refCsysTarget<:in>
Arguments

options
The following options are supported:
NO_UPDATE — The source coordinate system is not updated
automatically while regenerated.
NO_REGEN — The source coordinate system is updated, but the model
will not be automatically regenerated.

refCsysSource
Existing reference to an offset coordinate system those dimensions
are always updated to match the target coordinate system.

refCsysTarget
Existing reference to the target coordinate system.
Error handling
The program execution will be canceled if the references are not
defined or if the joint cannot be created, unless errors are handled
by BEGIN_CATCH_ERROR.
Note
The joint is updated on every regeneration in the Creo model. Source
and target coordinate systems are specified in the parent assembly by
the parameters BUW_JOINT_SOURCE and BUW_JOINT_TARGET. The parameter
BUW_JOINT_REGEN
Example
USER_SELECT CSYS refSource
USER_SELECT CSYS refTarget
CREATE_JOINT refSource refTarget
About Commands for Graphics and Display
Commands for modifying graphics and display mode of a model.
The following commands are available:
HIDE — to hide a feature.
UNHIDE — to unhide a feature.
SET_ON_LAYER — to place geometry elements, features or models on
layer.
REMOVE_FROM_LAYER — to remove an item from a layer.
GET_LAYER_STATUS — to retrieve the layer visibility information.
GET_LAYER_STATUS_EX — to retrieve the layer visibility information.
Extended version for more visibility states.
SET_LAYER_STATUS — to modify layer visibility.
SET_LAYER_STATUS_EX — to modify layer visibility. Extended version
for more visibility states.
SAVE_LAYER_STATUS — to save the layer status.
GET_LAYER_ITEMS — to collect all items of a layer.
CREATE_LAYER — to create a new layer in a model.
COPY_LAYERS_FROM_MDL — to copy layers from another model.
REMOVE_LAYER — to remove a layer from a model.
HIGHLIGHT_REF — to highlight references.
GET_COLOR — to get the color of a reference.
READ_COLOR_PROPS — to retrieve the color properties from a material
appearance file.
GET_COLOR_PROPS — to get the color properties of a reference.
SET_COLOR — to set the color to a reference.
SET_COLOR_PROPS — to set the color properties to a reference.
REMOVE_COLOR_PROPS — to remove the color properties from a
reference.
READ_TEXTURE_PROPS — to retrieve the texture properties from a
material appearance file.
GET_TEXTURE_PROPS — to retrieve the texture properties of a
reference.
SET_TEXTURE_PROPS — to set the texture properties to a reference.
GET_TEXTURE_PLACEMENT_PROPS — to retrieve the texture placement
properties of a reference.
SET_TEXTURE_PLACEMENT_PROPS — to set the texture placement
properties to a reference.
GET_COLOR_PROPS_ASSIGNED — to determine if a color is assigned.
CLEAR_MDL_APPEARANCES — to remove colors and textures from a model.
GET_LINE_FONT — to read the line font of a curve or composite
curve.
SET_LINE_FONT — to set the line font of a curve or composite curve.
SHOW_DIM — to display one dimension or an array of dimensions.
SHOW_DIMS — to display dimensions of a feature or model.
REPAINT — to repaint the screen.
DISPLAY_DATUM — to toggle the display of datum planes, coordinate
systems, axes, points and their tags on or off.
DISPLAY_ANNOTATIONS — to toggle the display of annotations on or
off.
DISPLAY_COMB_VIEWS — to toggle the display of combined views on or
off.
DISP_LIST_ADD_LINE — to add a new line to the display list for a
specific model.
DISP_LIST_UPDATE — to update the display list of a specific model.
DISP_LIST_CLEAR — to clear the display list of a specific model.
HIDE
Hides a feature. This command requires Creo Elements/Pro Wildfire 4
or above.
Syntax
HIDE reference<:in>
Arguments

reference
Reference to geometry element, feature, part or sub-assembly whose
feature should be hidden.
Error handling
The program execution will be canceled if the reference is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feature
HIDE feature
UNHIDE
Unhides a feature. This command requires Creo Elements/Pro Wildfire 4
or above.
Syntax
UNHIDE reference<:in>
Arguments

reference
Reference to geometry element, feature, part or sub-assembly whose
feature should be unhidden.
Error handling
The program execution will be canceled if the reference is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feature
UNHIDE feature
SET_ON_LAYER
Places geometry elements, features, parts or sub-assemblies on a
layer. The layer will be created if it does not exist yet.
Syntax
SET_ON_LAYER reference<:in> "layername"
Arguments

reference
Reference to geometry element, feature, part or sub-assembly that
should be placed on a layer.

layername
String, or string expression according to the rules for string
expressions describe the layer name.
Error handling
The program execution will be canceled if the reference is not
existing or could not be placed on the layer, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
Axis, coordinate systems, edges and surfaces could not be placed as
geometry elements on the layer. In this case the complete feature is
used.
In case of creating UDFs the contained features could additionally be
placed on a layer with a different technique. Each feature which
contains a string parameter BUW_LAYER_INFO will be placed on the
layer named according to the parameter content.
Example
USER_SELECT FEATURE hole
SET_ON_LAYER hole all_holes
REMOVE_FROM_LAYER
Removes geometry elements, features, parts or sub-assemblies features
from a layer.
Syntax
REMOVE_FROM_LAYER reference<:in> "layername"
Arguments

reference
Reference to geometry element, feature, part or sub-assembly that
should be removed from a layer.

layername
String, or string expression according to the rules for string
expressions describe the layer name.
Error handling
The program execution will be canceled if the reference is not
existing or could not be removed, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE hole
REMOVE_FROM_LAYER hole "00_all_holes"
GET_LAYER_STATUS
Retrieves the layer visibility information.
Syntax
GET_LAYER_STATUS model "layername" visibility<:out>
Arguments

model
The specified model.

layername
String, or string expression according to the rules for string
expressions describe the layer name. Use Wildcards to set the status
of multiple layers.

visibility
Name of the output variable which receives the layer status as a
string variable. The following results are possible.
DISPLAY — Display layer
BLANK — Blank layer
Error handling
The program execution will be canceled if the model is not existing
or the layer could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_LAYER_STATUS THIS "00_all_surfaces" status
PRINT "Status of 00_all_surfaces: %" status
§
GET_LAYER_STATUS_EX
Retrieves the layer visibility information. Extended version of
GET_LAYER_STATUS to show more visibility states.
Syntax
GET_LAYER_STATUS_EX model "layername" visibility<:out>
Arguments

model
The specified model.

layername
String, or string expression according to the rules for string
expressions describe the layer name. Use Wildcards to set the status
of multiple layers.

visibility
Name of the output variable which receives the layer status as a
string variable.
DISPLAY—layer is displayed.
BLANK—layer is blanked.
ISOLATE—layer is isolated.
HIDDEN_LINE—layer shows components in hidden line display.
Error handling
The program execution will be canceled if the model is not existing
or the layer could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_LAYER_STATUS_EX THIS "00_all_surfaces" status
PRINT "Status of 00_all_surfaces: %" status
SET_LAYER_STATUS
Sets layer status for a specific layer.
Syntax
SET_LAYER_STATUS [options] model "layername" visibility
Arguments

options
Valid options are:
RECURSIVE: Optional argument specifies that all the same layer is
also set in sub components of the model.

model
The specified model.

layername
String, or string expression according to the rules for string
expressions describe the layer name. Use Wildcards to set the status
of multiple layers.

visibility
DISPLAY — Display layer
BLANK — Blank layer
Example
SET_LAYER_STATUS THIS 00_all_surfaces BLANK
§
SET_LAYER_STATUS_EX
Sets layer status for a specific layer. Extended version of
SET_LAYER_STATUS to set more visibility states.
Syntax
SET_LAYER_STATUS_EX [options] model "layername" "visibility"
Arguments

options
Valid options are:
RECURSIVE: Optional argument specifies that all the same layer is
also set in sub components of the model.

model
The specified model.

layername
String, or string expression according to the rules for string
expressions describe the layer name. Use Wildcards to set the status
of multiple layers.

visibility
Visibility state. Any string expression is allowed. The following two
states are supported:
DISPLAY—layer is displayed.
BLANK—layer is blanked.
ISOLATE—layer is isolated.
HIDDEN_LINE—layer shows components in hidden line display.
Example
SET_LAYER_STATUS_EX THIS 00_all_surfaces ISOLATE
SAVE_LAYER_STATUS
Save layer status in Creo Elements/Pro models.
Syntax
SAVE_LAYER_STATUS model
Arguments

model
Model for which the layer status should be saved.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_LAYER_STATUS THIS 00_all_surfaces BLANK
SAVE_LAYER_STATUS THIS
§
GET_LAYER_ITEMS
Collects all items from a layer and stores them in an array.
Syntax
GET_LAYER_ITEMS model "layername" arrayLayerItems<:out>
Arguments

model
Model which owns the layer.

layername
String, or string expression according to the rules for string
expressions describe the layer name.

arrayLayerItems
Name of the array which will receive the layer item references.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
By using wildcards (*) multiple layers can be searched at the same
time
Example
GET_LAYER_ITEMS ASSEMBLY "00_BUW_*"items
FOR item REF ARRAY items
PRINT "Item: %" item
END_FOR
CREATE_LAYER
Creates a new layer in a model.
Syntax
CREATE_LAYER model "layername"
Arguments

model
Existing reference for a model.

layername
String, or string expression according to the rules for string
expressions describe the layer name.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
CREATE_LAYER ASSEMBLY "00_all_holes"
§
COPY_LAYERS_FROM_MDL
Copies layers form another model. This command also works for rule
based layers.
Syntax
COPY_LAYER_FROM_MDL model<:in> "layername" | arrayLayerNames
templateMdl<:in>
Arguments

model
Existing reference for a model which will receive the new layers.

layername | arrayLayerNames
Name or array of the layer names which should be copied.
Error handling
The program execution will be canceled if the model or the template
model are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Prior to Creo 2.0 M100 this command does not copy the rules.
Example
RETRIEVE_MDL "layer_template.prt" layerTemplate
COPY_LAYERS_FROM_MDL THIS "*" layerTemplate
REMOVE_LAYER
Removes a layer from a model.
Syntax
REMOVE_LAYER model "layername"
Arguments

model
Existing reference for a model.

layername
String, or string expression according to the rules for string
expressions describe the layer name.
Error handling
The program execution will be canceled if the model is not existing,
unless errors are handled by BEGIN_CATCH_ERROR. In case the layer
does not exist, no error will occur.
Example
REMOVE_LAYER ASSEMBLY "00_all_holes"
HIGHLIGHT_REF
Highlights a reference in Creo Elements/Pro.
Syntax
HIGHLIGHT_REF reference<:in>
Arguments

reference
Name of an existing reference.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
After a script file is processed the screen will be repainted. In
case a reference should be highlighted a WAIT statement should be
used.
Example
HIGHLIGHT_REF refPoint
WAIT
GET_COLOR
Gets rgb color of assembly, part, feature, curve or surface as of
red, green and blue between 0 and 255.
Syntax
GET_COLOR reference<:in> [options] redDOUBLE<:out> greenDOUBLE <:out>
blueDOUBLE <:out>
Arguments

reference
Existing reference for a feature, model or geometry item.

options
The following options are available:
USE_COMPONENT_COLOR valueBOOL — to determine if the model or the
component color should be used. Default is FALSE.
USE_COLOR_OWNER owner<:in> — to specify the model for which a
surface, quilt or body should be colorized. This allows to read the
color of an item which belows to sub component.

red
Name of the double variable for the red color. The value is between 0
and 255.

green
Name of the double variable for the green color. The value is between
0 and 255.

blue
Name of the double variable for the blue color. The value is between
0 and 255.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE bore
GET_COLOR bore red green blue
PRINT "The color is: % % %" red green blue
§
READ_COLOR_PROPS
Retrieves the color properties from a Creo material appearance file
in .dmt format.
Syntax
READ_COLOR_PROPS [options] "file" "key" color<:out>
Arguments

options
The following options are available:
SEARCH_METHOD "method" — The method must be either
"SEARCH_BY_LABEL" or "SEARCH_BY_NAME". Default is
"SEARCH_BY_LABEL". Depending on the method the search will
either be executed for the label or the name of the color.

file
Specifies the material appearance file according to the path
specification. Any string expression is allowed.

key
Specifies the key which is compared with the color name or label. Any
string expression is allowed.

color
Variable of type COLOR_PROPS which receives the properties of the
color definition in the appearance file.
Error handling
The program execution will be canceled if the file does not exist or
the color could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
READ_COLOR_PROPS SEARCH_METHOD "SEARCH_BY_LABEL"
@"$CREO_COMMON_FILES\graphic-library\appearances\appearance.dmt"
"ptc-painted-green" color_props
PRINT "intensity: %" color_props.color_intensity
PRINT "ambient: %" color_props.color_ambient
§
GET_COLOR_PROPS
Gets the color properties of assemblies, parts, features, curves or
surfaces.
Syntax
GET_COLOR_PROPS reference<:in> [options] color
Arguments

reference
Existing reference for a feature, model or geometry item.

options
The following options are available:
USE_COMPONENT_COLOR valueBOOL — to determine if the model or the
component color should be used. Default is FALSE.
USE_COLOR_OWNER owner<:in> — to specify the model for which a
surface, quilt or body should be colorized. This allows to read the
color of an item which belows to sub component.

color
Structure variable of type COLOR_PROPS which receives the color
properties of the reference.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_COLOR_PROPS PART color_props
PRINT "intensity: %" color_props.color_intensity
PRINT "ambient: %" color_props.color_ambient
§
GET_COLOR_PROPS_ASSIGNED
Determines if a color is assigned.
Syntax
GET_COLOR_PROPS_ASSIGNED reference<:in> [options] assigned<:out>
Arguments

reference
Existing reference for a feature, model or geometry item.

options
The following options are available:
USE_COMPONENT_COLOR valueBOOL — to determine if the model or the
component color should be used. Default is FALSE.
USE_COLOR_OWNER owner<:in> — to specify the model for which a
surface, quilt or body should be colorized. This allows to read the
color assignment state of an item which belows to sub component.

color
Variable of type COLOR_PROPS which receives the color properties of
the reference.

assigned
Name of the boolean variable which receives the result if a color is
assigned.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_COLOR_PROPS_ASSIGNED PART assigned
PRINT "Color props assigned: %" assigned
SET_COLOR
Sets rgb color of assembly, part, feature, curve or surface via
specifying intensity of red, green and blue between 0 and 255.
Syntax
SET_COLOR reference<:in> [options] color
Arguments

reference
Existing reference for a feature, model or geometry item.

options
The following options are available:
USE_COMPONENT_COLOR valueBOOL — to determine if the model or the
component color should be used. Default is FALSE.
USE_COLOR_OWNER owner<:in> — to specify the model for which a
surface, quilt or body should be colorized. This allows to set the
color of an item which belows to sub component.

color
The color could either be specified by a string or by three double
values for red green and blue. The values are between 0 and 255. For
a string the string expression could be used and for the integer
values the math equations are working.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE bore
SET_COLOR bore 255 0 0
SET_COLOR bore "255 0 0"
§
SET_COLOR_PROPS
Sets the color properties of assemblies, parts, features, curves or
surfaces.
Syntax
SET_COLOR_PROPS reference<:in> [options] color
Arguments

reference
Existing reference for a feature, model or geometry item.

options
The following options are available:
USE_COMPONENT_COLOR valueBOOL — to determine if the model or the
component color should be used. Default is FALSE.
USE_COLOR_OWNER owner<:in> — to specify the model for which a
surface, quilt or body should be colorized. This allows to set the
color of an item which belows to sub component.

color
Structure variable of type COLOR_PROPS which contains the color
properties of the reference.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_STRUCT COLOR_PROPS color_props
color_props.highlight_intensity = 50
color_props.color_ambient = 90
SET_COLOR_PROPS PART color_props
§
REMOVE_COLOR_PROPS
Removes the color properties from assemblies, parts, features, curves
or surfaces.
Syntax
REMOVE_COLOR_PROPS reference<:in> [options]
Arguments

reference
Existing reference for a feature, model or geometry item.

options
The following options are available:
USE_COMPONENT_COLOR valueBOOL — to determine if the model or the
component color should be used. Default is FALSE.
USE_COLOR_OWNER owner<:in> — to specify the model for which a
surface, quilt or body should be colorized. This allows to remove
the color of an item which belows to sub component.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
REMOVE_COLOR_PROPS PART
§
READ_TEXTURE_PROPS
Retrieves the texture properties from a Creo material appearance file
in .dmt format.
Syntax
READ_TEXTURE_PROPS [options] "file" "key" texture_props<:out>
Arguments

options
The following options are available:
SEARCH_METHOD "method" — The method must be either
"SEARCH_BY_LABEL" or "SEARCH_BY_NAME". Default is
"SEARCH_BY_LABEL". Depending on the method the search will
either be executed for the label or the name of the texture.

file
Specifies the material appearance file according to the path
specification. Any string expression is allowed.

key
Specifies the key which is compared with the texture name or label.
Any string expression is allowed.

texture_props
Variable of type TEXTURE_PROPS which receives the texture properties
of the reference.
Error handling
The program execution will be canceled if the file does not exist or
the texture could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
READ_TEXTURE_PROPS SEARCH_METHOD "SEARCH_BY_NAME" "lib:sample.dmt"
"ref_color*" texture_props
PRINT "bump: %" texture_props.bump
PRINT "color_texture: %" texture_props.color_texture
PRINT "decal: %" texture_props.decal
§
GET_TEXTURE_PROPS
Gets the texture properties of assemblies, parts, components and
surfaces.
Syntax
GET_TEXTURE_PROPS reference<:in> [options] texture_props<:out>
Arguments

reference
Existing reference to an assembly part, component or surface.

options
The following options are available:
USE_COMPONENT_TEXTURE valueBOOL — to determine if the model or the
component texture should be used. Default is FALSE.
USE_TEXTURE_OWNER owner<:in> — to specify the model for which a
surface, quilt or body should be textured. This allows to read the
texture of an item which belows to sub component.

texture_props
Variable of type TEXTURE_PROPS which receives the texture properties
of the reference.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_TEXTURE_PROPS PART texture_props
PRINT "bump: %" texture_props.bump
PRINT "color_texture: %" texture_props.color_texture
PRINT "decal: %" texture_props.decal
§
SET_TEXTURE_PROPS
Sets the texture properties of assemblies, parts, components or
surfaces.
Syntax
SET_TEXTURE_PROPS reference<:in> [options] texture_props
Arguments

reference
Existing reference to an assembly part, component or surface.

options
The following options are available:
USE_COMPONENT_TEXTURE valueBOOL — to determine if the model or the
component texture should be used. Default is FALSE.
USE_TEXTURE_OWNER owner<:in> — to specify the model for which a
surface, quilt or body should be textured. This allows to set the
texture of an item which belows to sub component.

texture_props
Variable of type TEXTURE_PROPS which contains the texture properties
of the reference.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE srf
DECLARE_STRUCTURE TEXTURE_PROPS texture_props
texure_props.color_texture = "Blue-wool-color.jpg"
SET_TEXTURE_PROPS srf texture_props
§
GET_TEXTURE_PLACEMENT_PROPS
Gets the texture placement properties of assemblies, parts,
components and surfaces.
Syntax
GET_TEXTURE_PLACEMENT_PROPS reference<:in> [options] "texture_type"
texture_placement_props
Arguments

reference
Existing reference to an assembly part, component or surface.

options
The following options are available:
USE_COMPONENT_TEXTURE valueBOOL — to determine if the model or the
component texture should be used. Default is FALSE.
USE_TEXTURE_OWNER owner<:in> — to specify the model for which a
surface, quilt or body should be textured. This allows to read the
texture of an item which belows to sub component.

texture_type
Texture type which whose placement properties should be received. Any
string expression is allowed. This is one of the following texture
types:
BUMP_TEXTURE — for the bump texture.
COLOR_TEXTURE — for the color texture.
DECAL_TEXTURE — for the decal texture.

texture_placement_props
Variable of type TEXTURE_PLACEMENT_PROPS which receives the texture
properties of the reference.
Error handling
The program execution will be canceled if the reference or the
texture does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_TEXTURE_PLACEMENT_PROPS PART COLOR_TEXTURE
texture_placement_props
PRINT "rotation: %" texture_placement_props.rotation
§
SET_TEXTURE_PLACEMENT_PROPS
Sets the texture placement properties of assemblies, parts,
components or surfaces.
Syntax
SET_TEXTURE_PLACEMENT_PROPS reference<:in> [options] "texture_type"
texture_placement_props
Arguments

reference
Existing reference to an assembly part, component or surface.

options
The following options are available:
USE_COMPONENT_TEXTURE valueBOOL — to determine if the model or the
component texture should be used. Default is FALSE.
USE_TEXTURE_OWNER owner<:in> — to specify the model for which a
surface, quilt or body should be textured. This allows to set the
texture of an item which belows to sub component.

texture_type
Texture type which whose placement properties should be received. Any
string expression is allowed. This is one of the following texture
types:
BUMP_TEXTURE — for the bump texture.
COLOR_TEXTURE — for the color texture.
DECAL_TEXTURE — for the decal texture.

texture_placement_props
Variable of type TEXTURE_PLACEMENT_PROPS which contains the texture
properties of the reference.
Error handling
The program execution will be canceled if the reference or the
texture does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE srf
GET_TEXTURE_PLACEMENT_PROPS srf COLOR_TEXTURE texture_placement_props
texture_placement_props.rotate *= 2
SET_TEXTURE_PLACEMENT_PROPS srf COLOR_TEXTURE texture_placement_props
CLEAR_MDL_APPEARANCES
Removes the appearances from a model similar like View > Appearances
> Clear Assembly Appearances or Clear All Appearances.
Syntax
CLEAR_MDL_APPEARANCES model recursiveBOOL
Arguments

model
Existing reference for a model.

recursive
Boolean variable. In case of TRUE also the colors which are defined
on sub components are removed.
Error handling
The program execution will be canceled if the model is not existing
or the function fails, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
CLEAR_MDL_APPEARANCES ASSEMBLY TRUE
GET_LINE_FONT
Reads the line font of a curve or composite curve.
Syntax
GET_LINE_FONT refCurve<:in> font
Description

refCurve
Existing reference to a curve or composite curve or a feature
containing curves.

font
Name of the string variable which receives the line fonts
information.
Error handling
The program execution will be canceled if the reference to a curve
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPOSITE_CURVE curve
GET_LINE_FONT curve font
PRINT "line font: %" font
SET_LINE_FONT
Sets the line font of a curve or composite curve.
Syntax
SET_LINE_FONT refCurve<:in> "font"
Description

refCurve
Existing reference to a curve or composite curve or a feature
containing curves.

font
One of the line fonts. Any string expression is allowed.
Error handling
The program execution will be canceled if the reference to a curve
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPOSITE_CURVE curve
SET_LINE_FONT curve "CTRLFONT"
§
SHOW_DIM
Shows one dimension or an array of dimensions.
Syntax
SHOW_DIM refDim<:in> | arrayDim<:in>
Arguments

refDim | arrayDim
Reference to a dimension or array of references to a dimension.
Error handling
The program execution will be canceled if the variable does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
This command is frequently used before a USER_SELECT statement with
selection type DIMENSION.
Example
SEARCH_MDL_REFS ASSEMBLY DIMENSION "*" allDimensions
SHOW_DIM allDimensions
USER_SELECT DIMENSION dim
§
SHOW_DIMS
Shows dimensions of a specific feature or model.
Syntax
SHOW_DIMS refDimOwner<:in>
Arguments

refDimOwner
Reference to the dimension owner. This could be a feature or a model.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
This command is frequently used before a USER_SELECT statement with
selection type DIMENSION.
REPAINT
Repaints the screen.
Syntax
REPAINT
Example
REPAINT
DISPLAY_DATUM
Toggles the display of datum planes, coordinate systems, axes, points
and their tags on or off.
Syntax
DISPLAY_DATUM type state<:in>
Arguments

type
Type is either PLANES, PLANE_TAGS, CSYS, CSYS_TAGS, AXES , AXIS_TAGS,
POINTS, POINT_TAGS or SPIN_CENTER.

state
Name of the boolean parameter which receives the information whether
the datum element is to be displayed or not.
Example
DISPLAY_DATUM PLANES TRUE
DISPLAY_DATUM AXES FALSE
DISPLAY_ANNOTATIONS
Toggles the display of annotations on or off.
Syntax
DISPLAY_ANNOTATIONS state<:in>
Arguments

state
Name of the boolean parameter which receives the information whether
the annotations are to be displayed or not.
Example
DISPLAY_ANNOTATIONS TRUE
DISPLAY_COMB_VIEWS
Toggles the display of combined views on or off.
Syntax
DISPLAY_COMB_VIEWS state<:in>
Arguments

state
Name of the boolean parameter which receives the information whether
the combined views are to be displayed or not.
Example
DISPLAY_COMB_VIEWS TRUE
§
DISP_LIST_ADD_LINE
Adds a new line to the display list for a specific model. Display
lists are not stored to the model. When the model is opened in
another window the display list will not show up.
Syntax
DISP_LIST_ADD_LINE refMdl<:in> point1<:in> point2<:in> [color]
Arguments

refMdl
Reference to an existing model.

point1
Structure variable of type POINT which contains information about the
line start point.

point2
Structure variable of type POINT which contains information about the
line end point.

color
Optional variable of type COLOR which contains color information in
red, green and blue value. Each value should be in the range 0 to
255.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
The line will not be displayed before the DISP_LIST_UPDATE command is
used.
Example
DECLARE_STRUCT POINT pntStart
DECLARE_STRUCT POINT pntEnd
DECLARE_STRUCT COLOR col
pntStart.x = 0
pntStart.y = 0
pntStart.z = 0
pntEnd.x = 100
pntEnd.y = 0
pntEnd.z = 0
col.red = 255
col.green = 255
col.blue = 0
DISP_LIST_ADD_LINE THIS pntStart pntEnd col
DISP_LIST_UPDATE THIS
§
DISP_LIST_UPDATE
Updates the display list of a model.
Syntax
DISP_LIST_UPDATE refMdl<:in>
Arguments

refMdl
Reference to an existing model.
Example
DECLARE_STRUCT POINT pntStart
DECLARE_STRUCT POINT pntEnd
pntStart.x = 0
pntStart.y = 0
pntStart.z = 0
pntEnd.x = 100
pntEnd.y = 0
pntEnd.z = 0
DISP_LIST_ADD_LINE THIS pntStart pntEnd
DISP_LIST_UPDATE THIS
§
DISP_LIST_CLEAR
Clears the display list.
Syntax
DISP_LIST_CLEAR refMdl<:in>
Arguments

refMdl
Reference to an existing model.
Example
DISP_LIST_CLEAR THIS
§
About Commands for Handling Files
Commands for accessing and selecting files. The following commands
are available:
CHOOSE_FILE — to let the user select a file by dialog.
CHOOSE_FILES — to let the user select multiple files by dialog.
CHOOSE_PATH — to let the user select a path by dialog.
FILE_OPEN_DIALOG — to select a file in the Creo Parametric file
open dialog.
FILE_SAVE_DIALOG — to choose a file name in the Creo Parametric
file save dialog.
PARSE_FILE_NAME — to parse a file name and extract path, name
and extension.
BUILD_FILE_NAME — to build the file name of the given path name
and extension.
SHOW_URL — to show an URL in the internal browser.
SEARCH_FILE_PARAM — to search for content in a file with key
values.
READ_DIRECTORY — to read file names in an array.
READ_SUBDIRECTORIES — to read sub directory names in an array.
UPDATE_DIRECTORY_IDX — to update the idx family table file of a
directory.
CREATE_DIRECTORY — to create a new directory on the file system.
REMOVE_DIRECTORY — to remove a directory from the file system.
DELETE_FILE — to delete a file from the file system.
COPY_FILE — to copy a file from one location to another in the
file system.
MOVE_FILE — to move file to a new name or a new location in the
file system.
GET_FILE_SIZE — to determine the size of a file.
GET_FILE_TIMESTAMP — to determine the date of the last file
change.
PURGE — to purge files in a directory.
TOUCH — to update the date and time of an existing file or
folder or to create a new empty file.
FILE_OPEN — to open a file.
FILE_CLOSE — to close a file.
FILE_READ — to read the complete file content to a string
variable.
FILE_WRITE — to save a string to a file.
FILE_READ_LINE — to read a line from an open file.
FILE_WRITE_LINE — to write a line to an open file.
FILE_SET_POS — to set the file descriptor to a specific line.
FILE_REPLACE_LINE — to replace a line of an existing file.
BINARY_FILE_READ — to read the content of a binary file to a
base64 encoded string.
BINARY_FILE_WRITE — to write a base64 encoded string to a binary
file.
WAIT_FOR_FILE — to wait until a file is created.
§
CHOOSE_FILE
Executes file open dialog and lets the user select a file.
Syntax
CHOOSE_FILE "path" ["extension"] parameter<:out>
Arguments

path
Path specifies the directory in which the user could select a file.
According to the path specification it could be either in library or
in working directory. Any string expression is allowed.

extension
Optional extension indicates the file type. In case it is not
specified 'txt' is used as extension.

parameter
Name for the parameter which should receive the name of the selected
file.
Error handling
The program execution will be canceled if the specified path is not
existing or the dialog is canceled, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
! let the user select a Word document in the current library
directory
CHOOSE_FILE lib: "doc" docFile
§
CHOOSE_FILES
Executes file open dialog and lets the user select multiple files.
The files are stored in the array in the order the user selected
them.
Syntax
CHOOSE_FILES "path" ["extension"] array<:out>
Arguments

path
Path specifies the directory in which the user could select the
files. According to the path specification it could be either in
library or in working directory. Any string expression is allowed.

extension
Optional extension indicates the file type. In case it is not
specified 'txt' is used as extension.

array
Name for the array which should receive the names of the selected
files.
Error handling
The program execution will be canceled if the specified path is not
existing or the dialog is canceled, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
CHOOSE_FILES lib: "text" textFiles
FOR file REF ARRAY textFiles
PRINT "Selected file: %" file
END_FOR
§
CHOOSE_PATH
Executes path open dialog and lets the user select a path.
Syntax
CHOOSE_PATH "root_path" paramPath<:out>
Arguments

root_path
Path specifies the directory which should be pre-selected in the
dialog. According to the path specification it could be either in
library or in working directory. Any string expression is allowed.

paramPath
Name for the parameter which should receive the name of the selected
file.
Error handling
The program execution will be canceled if the dialog is canceled,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
CHOOSE_PATH "." path
§
FILE_OPEN_DIALOG
Executes the Creo Parametric file open dialog and lets the user
select a file. This allows also access to connected PDMLink or
Intralink sessions as well as to files in session.
Syntax
FILE_OPEN_DIALOG "path" "filter" paramFile<:out>
Arguments

path
Path specifies the directory in which the user could select a file.
According to the path specification it could be either in library or
in working directory. Any string expression is allowed.

filter
Filter which file types could be selected. Multiple file types could
be connected by commas e.g. '*.prt,*.asm'. Don't use spaces in the
filter string. Use '*.*' to make all kind of files accessible.

paramFile
Name for the string parameter which should receive the name of the
selected file including path and extension.
Error handling
The program execution will be canceled if the dialog is canceled,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
FILE_OPEN_DIALOG "." "*.asm" fullFileName
PARSE_FILE_NAME fullFileName path file extension
PRINT "%" path
PRINT "%" file
PRINT "%" extension
§
FILE_SAVE_DIALOG
Opens the Creo Parametric file save dialog and lets the user specify
a file name and location. This allows also access to connected
PDMLink or Intralink sessions.
Syntax
FILE_SAVE_DIALOG "path" "filter" "default_name" paramFile<:out>
Arguments

path
Path specifies the directory in which the user could select a file.
According to the path specification it could be either in library or
in working directory. Any string expression is allowed.

filter
Filter which file types could be selected. Multiple file types could
be connected by commas e.g. '*.xlsx,*.xls'. Don't use spaces in the
filter string. Use '*.*' to make all kind of files accessible.

default_name
Default name which appears in the dialog. Use an empty string to skip
the default name.

paramFile
Name for the string parameter which should receive the name of the
selected file including path and extension.
Error handling
The program execution will be canceled if the dialog is canceled,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
FILE_SAVE_DIALOG "." "*.xlsx,*.xls" "output.xlsx" fullFileName
PARSE_FILE_NAME fullFileName path file extension
PRINT "%" path
PRINT "%" file
PRINT "%" extension
§
PARSE_FILE_NAME
Parses a give file name and extracts path, name and extension.
Syntax
PARSE_FILE_NAME "full_filename" paramPath<:out> paramFile<:out>
paramExtension<:out>
Arguments

full_filename
Complete name of the file. Any string expression is allowed.

paramPath
Name of the string parameter which should receive the path
information.

paramFile
Name of the string parameter which should receive the file name
information.

paramExtension
Name of the string parameter which should receive the extension
information.
Example
FILE_OPEN_DIALOG "." "*.asm" fullFileName
PARSE_FILE_NAME fullFileName path file extension
PRINT "%" path
PRINT "%" file
PRINT "%" extension
§
BUILD_FILE_NAME
Builds the file name from path, name and extension information. This
command determines automatically if slashes or backslashes need to be
added.
Syntax
BUILD_FILE_NAME "path" "file" "extension" paramFullFileName<:out>
Arguments

path
Path information. Any string expression is allowed.

file
File name information. Any string expression is allowed.

extension
Extension information. Any string expression is allowed.

paramFullFileName
Name for the string parameter which should receive the name of the
selected file including path and extension.
Example
BUILD_FILE_NAME "d:\\temp" "something "asm" fullPartName
PRINT "%" fullPartName
§
SHOW_URL
Displays an URL in the embedded Creo Elements/Pro web browser.
Syntax
SHOW_URL [options] "web_page"
Arguments

options
The following options are supported:
EXTERNAL — to show the html page in the standard browser. If this
option is not set, the Creo / Pro/ENGINEER internal browser is
used.

web_page
Any web page which could be shown in the embedded browser. Any string
expression is allowed and all elements of the path specification
rules can be used.
Note
This command could be used to provide the user additional information
in case of problems. Via BEGIN_CATCH_ERROR the behaviour in case of
failing UDFs could be specified.
Example
BEGIN_CATCH_ERROR
CREATE_UDF SAMPLE THIS sampleUdf
...
END_CREATE_UDF
END_CATCH_ERROR

IF NOT REF_VALID sampleUdf


SHOW_URL "http://www.buw-soft.de"
END_IF

BEGIN_CATCH_ERROR FIX_FAIL_UDF
CREATE_UDF SAMPLE THIS sampleUdf
...
END_CREATE_UDF
END_CATCH_ERROR
§
SEARCH_FILE_PARAM
Searches for a content in a specified file. The file lines are build
up in the manner key=value.
Syntax
SEARCH_FILE_PARAM "file" &key 'type' parameter<:out>
Arguments

file
File including the complete path must be specified. Any string
expression is allowed.

key
String which should be search in the file. The key is on the left
side of the equal sign.

type
Type of the parameter which should receive the information.

parameter
Name for the parameter which should receive the content.
Error handling
The program execution will be canceled if the file is not existing or
the key could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
CHOOSE_FILE lib: "txt" paramFile
SEARCH_FILE_PARAM paramFile "Customer" STRING paramCustomer
§
READ_DIRECTORY
Reads file list from directory in an array of strings.
Syntax
READ_DIRECTORY "path" "filter" [options] arrayFileNames<:out>
Arguments

path
Path whose file list should be read. See path specifications for
details.

filter
Filter which file types should be extracted. Multiple file types
could be connected by commas e.g. '*.prt,*.asm'. Use '*.*' to read
all files.

options
The following options are supported:
INCLUDE_IDX — in include the IDX family table file to the file
listing.

ALL_VERSIONS valueBOOL — to determine if all versions of the files


should be listed. Default is FALSE.

arrayFileNames
Name of the array which will receive the file names.
Example
READ_DIRECTORY . "*.prt" allParts
FOR part REF ARRAY allParts
PRINT "%" part
END_FOR
§
READ_SUBDIRECTORIES
Reads names of sub directories and stores them to an array.
Syntax
READ_SUBDIRECTORIES "path" arraySubDirs<:out>
Arguments

path
Path whose sub directory list should be read. See path specifications
for details.

arraySubDires
Name of the array which will receive the sub directory names names.
Example
READ_SUBDIRECTORIES . allSubDirs
FOR dir REF ARRAY allSubDirs
PRINT "%" dir
END_FOR
§
UPDATE_DIRECTORY_IDX
Updates the idx family table file for a directory.
Syntax
UPDATE_DIRECTORY_IDX "path"
Arguments

path
Path whose idx file should be updated. See path specifications for
details.
Example
UPDATE_DIRECTORY_IDX "d:\\temp\\path"
§
CREATE_DIRECTORY
Creates a directory in the file system.
Syntax
CREATE_DIRECTORY "path"
Arguments

path
Path to the directory which should be created. See path
specifications for details.
Example
CREATE_DIRECTORY "c:\\program files\\SmartAssembly"
§
REMOVE_DIRECTORY
Removes a directory from the file system.
Syntax
REMOVE_DIRECTORY "path" [options]
Arguments

path
Path to the directory which should be created. See path
specifications for details.

options
The following options are supported:
RECURSIVE — to remove a directory including files and sub
directories.
Error handling
The program execution will be canceled if the specified path can't be
removed, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Remove directory on an non existing directory does not cause an
error.
Example
REMOVE_DIRECTORY "D:\\temp\\remove_me" RECURSIVE
§
DELETE_FILE
Deletes a file from the file system.
Syntax
DELETE_FILE "file_name"
Arguments

file_name
File name which should be removed. See path specifications for
details.
Example
DELETE_FILE "*.log"
§
COPY_FILE
Copies a file from one location to another in the file system.
Syntax
COPY_FILE "file_name_from" "file_name_to"
Arguments

file_name_from
Name of the file which should be copied. See path specifications for
details.

file_name_to
Name of the destination. See path specifications for details.
Error handling
The program execution will be canceled if the file copy fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
COPY_FILE "d:\\temp\\test.txt" "."
COPY_FILE "d:\\temp\\test.txt" "output.txt"
§
MOVE_FILE
Moves a file to a new name or to a new position in the file system.
Syntax
MOVE_FILE "file_name_from" "file_name_to"
Arguments

file_name_from
Name of the file which should be moved. See path specifications for
details.

file_name_to
Name of the destination. See path specifications for details.
Error handling
The program execution will be canceled if the file move fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
MOVE_FILE "sample1.txt" "SmartAssembly.txt"
MOVE_FILE "sample2.txt" "Folder\\test.txt"
§
GET_FILE_SIZE
Determines the size of a file.
Syntax
GET_FILE_SIZE "file_name" paramSize<:out>
Arguments

file_name
Path and name of the file. See path specifications for details.

paramSize
Name of the parameter which will receive the file size
Error handling
The program execution will be canceled if the file is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_FILE_SIZE "lib:sample.txt" size
PRINT "Size of the file: %" size
§
GET_FILE_TIMESTAMP
Retrieves the time of last file change in local time or in UTC time.
Syntax
GET_FILE_TIMESTAMP options "file_name" time<:out>
Arguments

options
The following options are available:
USE_UTC valueBOOL — determines if the UTC time or the local time
should be used. Default is FALSE.

file_name
Path and name of the file. See path specifications for details.

time
Name of the variable which receives the time of the last file
modification in the format yyyy-mm-dd_hh:mm::ss:msms.
Error handling
The program execution will be canceled if the file is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_FILE_TIMESTAMP USE_UTC TRUE "lib:get_file_timestamp.tab" time
PRINT "%" time
§
PURGE
Purges the files in a directory.
Syntax
PURGE [options] "path"
Arguments

options
The following options are supported:
PURGEMODE "mode" — determines the mode how the purge is proceeded.
The following modes are available:
DEFAULT — keeps the files without index and the ones with the
highest index. This is the default mode.
HIGHEST— keeps only the files with the highest index.
INDEX_ONE — keeps the files with the highest index and sets their
index to '.1:
NO_INDEX — keeps the files with the highest index and removes
the index.

path
Path to the directory which should be purged. See path specifications
for details.
Example
PURGE "."
§
TOUCH
Updates the date and time of an existing file or folder or creates a
new empty file. The command works similar to the UNIX. The main use
of this command is to update the date and time stamp of a folder.
Since Creo Parametric buffers the information about models in a
directory, copying models by the operation system and trying to
retrieve them could cause failures. This could be prevented by
updating the date and time stamp.
Syntax
TOUCH "file_or_path"
Arguments

file_or_path
File or path which should be updated. See path specifications for
details.
Example
TOUCH "d:\\path"
§
FILE_OPEN
Opens a file for reading or writing.
Syntax
FILE_OPEN "file_name" "mode" [options] file<:out>
Arguments

file_name
Name of the file according to file path specification. Any string
expressions are allowed.

mode
Mode for which the file should be opened. Any string expression is
allowed. Valid modes are:
"r" — to open a file for reading. The command fails if the file
does not exist.
"r+" — to open a file for reading and writing. The command fails if
the file does not exist.
"w" — to open a file for writing. The command always creates a new
file.
"w+" — to open a file for writing and reading. The command always
creates a new file.
"a" — to open a file for appending. The command is either opening
an existing file or creating a new one.
"a+" — to open a file for appending and reading. The command is
either opening an existing file or creating a new one.

options
The following options are available:
BYTE_ENCODING "encoding" — determines the byte encoding. The
following encoding types are available:
ANSI — the file is encoded in ANSI characters. This is the
default mode.
UTF8_NO_BOM — the file is encoded in UTF-8, but there is no byte
order mark written to the file.
UTF8 — the file is encoded in UTF-8 and a byte order mark is
available. This is standard for multiple byte characters.
UTF16_BE — the file is encoded in UTF-16 / UCS-2 Big Endian mode.
This is standard for 2 byte character encoding in Microsoft
Windows.
UTF16_LE — the file is encoded in UTF-16 / UCS-2 Little Endian
mode.
EOL_BREAK "eol_break" — determines the convention for the end-of-
line break. The following end-of-line types are available:
WINDOWS — the windows convention for the end-of-line break. This
is the default mode.
UNIX — the UNIX convention for the end-of-line break.
MAC — the Macintosh convention for the end-of-line break.
The options are only used in case the file is created new. If the
file is already existing, the encoding and the end-of-line break are
extracted from the file.

file
Name of the variable which will receive the file descriptor.
Error handling
The program execution will be canceled if the file could not be
opened or created, unless errors are handled by BEGIN_CATCH_ERROR.
Example
FILE_OPEN "lib:sample.txt" "r" fileIn
WHILE NOT FILE_END fileIn
FILE_READ_LINE fileIn line
PRINT "%" line
END_WHILE
FILE_CLOSE fileIn
§
FILE_CLOSE
Closes a file which was opened.
Syntax
FILE_CLOSE file<:in>
Arguments

file
Name of the file descriptor which should be closed.
Error handling
The program execution will be canceled if the file descriptor could
not be found, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Open files are allocating system resources. Therefor it is
recommended to close a file after usage. All open file descriptors
will automatically be closed then Creo Elements/Pro is closed.
Example
FILE_OPEN "lib:sample.txt" "r" fileIn
WHILE NOT FILE_END fileIn
FILE_READ_LINE fileIn line
PRINT "%" line
END_WHILE
FILE_CLOSE fileIn
§
FILE_READ
Reads the complete content of an open file.
Syntax
FILE_READ file<:in> content<:out>
Arguments

file
Name of the file descriptor which was opened for reading.

content
Name of the string variable which will receive the file content.
Error handling
The program execution will be canceled if the file descriptor could
not be found or the file not be read, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Use the logical expression FILE_VALID to figure out if a file handle
is valid.
Example
DECALRE_VARIABLE STRING pattern
DECALRE_VARIABLE STRING replace_pattern
pattern = "[NAME]
replace_pattern = "SmartAssembly"

FILE_OPEN "lib:sample.txt" "r" fileIn


FILE_READ fileIn content
REG_EXP_REPLACE REPLACE_ALL TRUE content pattern replace_pattern
output
FILE_CLOSE fileIn

FILE_OPEN "lib:output.txt" "w" fileOut


FILE_WRITE fileOut output
FILE_CLOSE fileOut
§
FILE_WRITE
Writes the content of a string variable to an open file.
Syntax
FILE_WRITE file<:in> "content"
Arguments

file
Name of the file descriptor which was opened for writing or
appending.

content
Content to be written to the file. Any string expression is allowed.
Error handling
The program execution will be canceled if the file descriptor could
not be found or it is not possible to write to the file, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
Use the logical expression FILE_VALID to figure out if a file handle
is valid.
Example
DECALRE_VARIABLE STRING pattern
DECALRE_VARIABLE STRING replace_pattern
pattern = "[NAME]
replace_pattern = "SmartAssembly"

FILE_OPEN "lib:sample.txt" "r" fileIn


FILE_READ fileIn content
REG_EXP_REPLACE REPLACE_ALL TRUE content pattern replace_pattern
output
FILE_CLOSE fileIn

FILE_OPEN "lib:output.txt" "w" fileOut


FILE_WRITE fileOut output
FILE_CLOSE fileOut
§
FILE_READ_LINE
Reads a line from an open file.
Syntax
FILE_READ_LINE file<:in> paramLine<:out>
Arguments

file
Name of the file descriptor which was opened for reading.

param_line
Name of the string parameter which will receive the file line.
Error handling
The program execution will be canceled if the file descriptor could
not be found or the file not be read, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Use the logical expression FILE_VALID to figure out if a file handle
is valid. Use the logical expression FILE_END to figure out if the
file descriptor has already reached the end.
Example
FILE_OPEN "lib:sample.txt" "r" fileIn
WHILE NOT FILE_END fileIn
FILE_READ_LINE fileIn line
PRINT "%" line
END_WHILE
FILE_CLOSE fileIn
§
FILE_WRITE_LINE
Writes a line to an open file.
Syntax
FILE_WRITE_LINE [options] file<:in> "line"
Arguments

options
The following options are supported:
LINE_NUMBERS — to write the current line number in front of the
line text.

file
Name of the file descriptor which was opened for writing or
appending.

line
Line to be written to the file. Any string expression is allowed.
Error handling
The program execution will be canceled if the file descriptor could
not be found or it is not possible to write to the file, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
Use the logical expression FILE_VALID to figure out if a file handle
is valid. Use the logical expression FILE_END to figure out if the
file descriptor has already reached the end.
Example
FILE_OPEN "lib:sample_in.txt" "r" fileIn
FILE_OPEN "lib:sample_out.txt" "w" fileOut
WHILE NOT FILE_END fileIn
FILE_READ_LINE fileIn line
FILE_WRITE_LINE fileOut line
END_WHILE
FILE_CLOSE fileIn
FILE_CLOSE fileOut
§
FILE_SET_POS
Sets the file descriptor to a specific line.
Syntax
FILE_SET_POS file<:in> line_numberINT<:in>
Arguments

file
Name of the file descriptor which was opened for reading.

line_number
Line number to which the file descriptor should be set. Use 0 to set
it in the first line.
Error handling
The program execution will be canceled if the file descriptor could
not be found or set to the desired position, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
FILE_OPEN "lib:sample.txt" "r" fileIn
FILE_READ_LINE fileIn line
! set the file descriptor back to the first line.
FILE_SET_POS fileIn 0
FILE_READ_LINE fileIn line
FILE_CLOSE fileIn
§
FILE_REPLACE_LINE
Replaces a line of an existing file.
Syntax
FILE_REPLACE_LINE file<:in> line_numberINT<:in> "line"
Arguments

file
Name of the file descriptor which was opened for reading.

line_number
Line number which should be replaced by the new line. Use 0 to
replace the first line. Negative line numbers or line number bigger
than the maximum number of lines replace the last line.

line
Line to be written to the file. Any string expression is allowed.
Error handling
The program execution will be canceled if the file descriptor could
not be found or the line could not be replaced, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
FILE_OPEN "lib:sample.txt" "a" fp
FILE_REPLACE_LINE fp 0 "new first line"
FILE_REPLACE_LINE fp -1 "new last line"
FILE_REPLACE_LINE fp 2 "new 3rd line"
FILE_CLOSE fp
§
BINARY_FILE_READ
Reads the content of a binary file in a base64 encoded string.
Syntax
BINARY_FILE_READ "file_name" content<:out>
Arguments

file_name
Name of the file according to file path specification. Any string
expressions are allowed.

content
Name of the string parameter which will receive the file content as
base64 encoded string.
Error handling
The program execution will be canceled if the file could not be read,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
The command is mainly used to send binary content by a
WEBSERVICE_CALL.
Example
BINARY_FILE_READ "lib:image.jpeg" data_image

DECLARE_STRUCT NETWORK_CONNECTION network_connection


DECLARE_STRUCT HTTP_HEADER http_header
http_header.request.content_type = "image/jpeg"

DECLARE_VARIABLE STRING URL


URL = "http://localhost:8008"
WEBSERVICE_CALL network_connection "POST" URL http_header data_image
data_out
§
BINARY_FILE_WRITE
Writes a base64 encoded string to a binary file.
Syntax
BINARY_FILE_WRITE "file_name" content<:in>
Arguments

file_name
Name of the file according to file path specification. Any string
expressions are allowed.

content
Base64 encoded string which contains the file content.
Error handling
The program execution will be canceled if the file could not be
written, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The command is mainly used to save binary content retrieved from a
WEBSERVICE_CALL.
Example
DECLARE_STRUCT NETWORK_CONNECTION network_connection
DECLARE_STRUCT HTTP_HEADER http_header
DECLARE_VARIABLE STRING URL

URL = "https://www.buw-soft.de/de/wp-
content/uploads/2016/11/Slider_Startseite6.jpg"
WEBSERVICE_CALL network_connection "GET" URL http_header "" data_out
BINARY_FILE_WRITE "lib:image.jpg" data_out
§
WAIT_FOR_FILE
Waits until a file is created.
Syntax
WAIT_FOR_FILE "file_name" [options]
Arguments

file_name
Name of the file according to file path specification. Any string
expressions are allowed.

options
The following options are available:
EXCLUSIVE valueBOOL — to specify if the command should wait until
the process have exclusive access or shared access. Default is a
wait for exclusive access.

TIMEOUT secondsDOUBLE — to define a time out period. After the time


out period has been exceeded the function fails. By default there
is no time out defined.
Error handling
The program execution will be canceled if a time out period is
exceeded, unless errors are handled by BEGIN_CATCH_ERROR.
Example
BEGIN_CATCH_ERROR
CLEAR_CATCH_ERROR
WAIT_FOR_FILE "d:\\temp\\file.txt" TIMEOUT 10.0
END_CATCH_ERROR
IF ERROR
PRINT "File was not accessible for 10.0 sec"
ELSE
PRINT "File is accessible".
END_IF
About Commands for Relations
Commands to create feature or model relations. The following commands
are available:
CREATE_RELATION — to create relations on models.
REMOVE_RELATION — to remove existing relations of a model.
CREATE_FEATURE_RELATION — to create relations on features.
REMOVE_FEATURE_RELATION — to remove existing feature relations.
REGEN_RELATIONS — to regenerate the relations of a model, component
or feature.
GET_RELATIONS — to retrieve all relations from a model, component
or feature.
ADD_RELATIONS — to add an array of relations to a model, a
component or a feature.
SEARCH_RELATIONS — to search for specific relations in a model,
component or feature.
VERIFY_RELATIONS — to verify relations returns if they are valid.
REMOVE_RELATIONS — to remove all relations from a model.
SEARCH_RELATION_ELEMENTS — to search in a model for all elements
which own a relation set.
SET_RELATIONS_UNIT_SENSITIVE — to sets the sensitivity state of the
model relations.
GET_RELATIONS_UNIT_SENSITIVE — to retrieves the sensitivity state
of the model relations.
CREATE_RELATION
Creates a Creo Elements/Pro model relation.
Syntax
CREATE_RELATION model [options]
parameter lines
parameter lines
...
END_CREATE_RELATION
Arguments

model
Model for which the relation should be written.

options
The following options are available:
INITIAL — creates initial relations. This is default if the option
is not specified.
POST_REGEN — creates relations for post regeneration
NO_REGEN — avoids to regenerate the relations of the model.
NO_DEL_IDENT — avoids to add an delete identifier as comment.

parameter lines
Usually these lines consist of the normal commands which are used in
Creo Elements/Pro relations. The following elements could be used for
Ampersand & — indicates to use a parameter from script language.
:FID — Indicates a feature id.
/+ — can be used for comments in the relations. It will be replaced
by /*.
Note
In contrast to the normal evaluation of string operands, arguments
are only regarded as variables if the have a leading ampersand &.
Session IDs are automatically appended in case of variables which
have been searched or exported.
Example
CREATE_RELATION THIS
Test = &paramTest:FID
END_CREATE_RELATION
REMOVE_RELATION
Removes Creo Elements/Pro feature relations.
Syntax
REMOVE_RELATION model [options]
RELATION_LINE1
RELATION_LINE2
RELATION_BLOCK1
RELATION_BLOCK2
...
END_REMOVE_RELATION
Arguments

model
Model on which the relations should be removed.

options
The following options are available:
INITIAL — creates initial relations. This is default if the option
is not specified.
POST_REGEN — removes relations for post regeneration
NO_REGEN — avoids to regenerate the relations of the model.

relation lines
Single relations lines which could contain wildcards. Every existing
relation line is matched against it. Additional to normal string the
following elements could be used:
Ampersand & — indicates to use a parameter from script language.
:FID — Indicates a feature id.

relation block
A group of relation lines can be defined by the following syntax:
BEGIN_RELATION_BLOCK
RELATION_LINE1
RELATION_LINE2
...
END_RELATION_BLOCK

Error handling
The program execution will be canceled if the remaining relation
could not be regenerated, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
In contrast to the normal evaluation of string operands, arguments
are only regarded as variables if the have a leading ampersand &.
White characters as spaces and tabulators are not considered in the
comparison of the relations unless they appear inside quotes. Use an
asterisk * as wildcard.
Example
REMOVE_RELATION THIS
Test = &paramTest:FID
BEGIN_RELATION_BLOCK
IF TEST == *
*
END_IF
END_RELATION_BLOCK
END_REMOVE_RELATION
CREATE_FEATURE_RELATION
Creates a Creo Elements/Pro feature relation.
Syntax
CREATE_FEATURE_RELATION reference<:in> [options]
parameter lines
parameter lines
...
END_CREATE_RELATION
Arguments

reference
Name of a feature reference. This indicates the owner of the Creo
Elements/Pro relation.

options
The following options are available:
NO_REGEN — avoids to regenerate the relations of the model.
NO_DEL_IDENT — avoids to add an delete identifier as comment.

parameter lines
Usually these lines consist of the normal commands which are used in
Creo Elements/Pro relations. The following elements could be used for
Ampersand & — indicates to use a parameter from script language.
:FID — Indicates a feature id.
/+ — can be used for comments in the relations. It will be replaced
by /*.
Note
In contrast to the normal evaluation of string operands, arguments
are only regarded as variables if the have a leading ampersand &.
Session IDs are automatically appended in case of variables which
have been searched or exported.
Example
CREATE_FEATURE_RELATION refFeature
Test = &paramTest:FID
END_CREATE_RELATION
REMOVE_FEATURE_RELATION
Removes Creo Elements/Pro feature relations.
Syntax
REMOVE_FEATURE_RELATION reference<:in> [options]
RELATION_LINE1
RELATION_LINE2
RELATION_BLOCK1
RELATION_BLOCK2
...
END_REMOVE_RELATION
Arguments

reference
Name of a feature reference. This indicates the owner of the Creo
Elements/Pro relation.

options
The following options are available:
NO_REGEN — avoids to regenerate the relations of the model.

parameter lines
Single relations lines which could contain wildcards. Every existing
relation line is matched against it. Additional to normal string the
following elements could be used:
Ampersand & — indicates to use a parameter from script language.
:FID — Indicates a feature id.

relation block
A group of relation lines can be defined by the following syntax:
BEGIN_RELATION_BLOCK
RELATION_LINE1
RELATION_LINE2
...
END_RELATION_BLOCK

Error handling
The program execution will be canceled if the remaining relation
could not be regenerated, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
In contrast to the normal evaluation of string operands, arguments
are only regarded as variables if the have a leading ampersand
&.White characters as spaces and tabulators are not considered in the
comparison of the relations unless they appear inside quotes. Use an
asterisk * as wildcard.
Example
REMOVE_FEATURE_RELATION refFeature
Test = &paramTest:FID
BEGIN_RELATION_BLOCK
IF TEST == *
*
END_IF
END_RELATION_BLOCK

END_REMOVE_RELATION
REGEN_RELATIONS
Regenerates all relations of a Creo Elements/Pro model, component or
feature.
Syntax
REGEN_RELATIONS reference<:in> [options]
Arguments

reference
Existing reference to a model, a component, a feature or a pattern.

options
The following options are available:
INITIAL — retrieves initial relations. This is default if the
option is not specified.
POST_REGEN — retrieves relations for post regeneration.
OWNER_TYPE "type" — provides the information about the type of the
reference owner. Valid values are MODEL, COMPONENT and ANY. Default
is ANY.
Error handling
The program execution will be canceled if the reference is not found
or if the relations could not be regenerated, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
REGEN_RELATIONS refPart
§
GET_RELATIONS
Gets all relations of a Creo Elements/Pro model, component or
feature.
Syntax
GET_RELATIONS reference<:in> [options] arrayRelations<:out>
Arguments

reference
Existing reference to a model, a component, a feature or a pattern.

options
The following options are available:.
INITIAL — retrieves initial relations. This is default if the
option is not specified.
POST_REGEN — retrieves relations for post regeneration.
OWNER_TYPE "type" — provides the information about the type of the
reference owner. Valid values are MODEL, COMPONENT and ANY. Default
is ANY.

arrayRelations
Name of the array which received the relation lines.
Example
GET_RELATIONS PART INITIAL arrayAllInitialRelations
FOR relation REF ARRAY arrayAllInitialRelations
PRINT "%" relation
END_FOR
§
ADD_RELATIONS
Adds an array of relations to a Creo Elements/Pro model, a component
or a feature.
Syntax
ADD_RELATIONS reference<:in> [options] arrayRelations<:in>
Arguments

reference
Existing reference to a model, a component, a feature or a pattern.

options
The following options are available:
INITIAL — retrieves initial relations. This is default if the
option is not specified.
POST_REGEN — retrieves relations for post regeneration.
NO_REGEN — avoids to regenerate the relations of the model.
NO_DEL_IDENT — avoids to add an delete identifier as comment.
OWNER_TYPE "type" — provides the information about the type of the
reference owner. Valid values are MODEL, COMPONENT and ANY. Default
is ANY.

arrayRelations
Existing array with string content.
Error handling
The program execution will be canceled if the reference is not found,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_ARRAY array
ADD_ARRAY_ELEM array "IF A < 10"
ADD_ARRAY_ELEM array "B = 20"
ADD_ARRAY_ELEM array "ENDIF"
ADD_RELATIONS PART NO_DEL_IDENT array
§
SEARCH_RELATIONS
Searches for specific relations of a Creo Elements/Pro model,
component or feature.
Syntax
SEARCH_RELATIONS reference<:in> [options] "filter"
arrayRelations<:out>
Arguments

reference
Existing reference to a model, a component, a feature or a pattern.

options
The following options are available:
INITIAL — retrieves initial relations. This is default if the
option is not specified.
POST_REGEN — retrieves relations for post regeneration.
OWNER_TYPE "type" — provides the information about the type of the
reference owner. Valid values are MODEL, COMPONENT and ANY. Default
is ANY.

filter
White characters as spaces and tabulators are not considered in the
comparison of the relations unless they appear inside quotes. The
asterisk * can be used as wildcard.
Ampersand & — indicates to use a parameter from script language.
:FID — Indicates a feature id.

arrayRelations
Name of the array which received the relation lines.
Example
SEARCH_RELATIONS PART INITIAL "*BUW*" allInitialBUWRelations
FOR relation REF ARRAY allInitialBUWRelations
PRINT "%" relation
END_FOR
§
VERIFY_RELATIONS
Verifies the relations of a reference and returns if they are valid.
Syntax
VERIFY_RELATIONS reference<:in> [options] parameterBOOL<:out>
Arguments

reference
Existing reference to a model, a component, a feature or a pattern.

options
The following options are available:.
INITIAL — retrieves initial relations. This is default if the
option is not specified.
POST_REGEN — retrieves relations for post regeneration.
OWNER_TYPE "type" — provides the information about the type of the
reference owner. Valid values are MODEL, COMPONENT and ANY. Default
is ANY.

parameter
Name of the boolean parameter which should receive the boolean
information.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Use GET_REF_OWNER in case you have a reference to a component and
want to test the model relations. In case of a reference to the
model, GET_REF_OWNER will not alter this reference.
Example
! check an assembly recursively for invalid relations
DECLARE_ARRAY allModels
ADD_ARRAY_ELEM allModels ASSEMBLY
SEARCH_MDL_REFS RECURSIVE ASSEMBLY MODEL "*" allModels
FOR mdl REF ARRAY allModels
SEARCH_RELATION_ELEMENTS mdl allRelationElements
FOR relationElement REF ARRAY allRelationElements
VERIFY_RELATIONS relationElement IsValid
IF IsValid == FALSE
PRINT "Invalid Relations at: %" relationElement
END_IF
END_FOR
END_FOR
§
REMOVE_RELATIONS
Removes all relations from a model.
Syntax
REMOVE_RELAIONS model [options]
Arguments

model
Model which is to be erased from memory according to model
specification.

options
The following options are available:
INITIAL — creates initial relations. This is default if the option
is not specified.
POST_REGEN — creates relations for post regeneration.
OWNER_TYPE "type" — provides the information about the type of the
reference owner. Valid values are MODEL, COMPONENT and ANY. Default
is ANY.
Error handling
The program execution will be canceled if the model could not be
found or the remaining relations could not be regenerated, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
REMOVE_RELATIONS THIS
§
SEARCH_RELATION_ELEMENTS
Searches in a model for all elements which own a relation set. That
can be the model itself, component features, features and patterns.
Syntax
SEARCH_RELATION_ELEMENTS refOwner<:in> arrayRelationElements<:out>
Arguments

reference
Name of an existing reference to a model, a component or a feature.

arrayRelationElements
Name of the array which should receive the references to relation
elements.
Error handling
The program execution will be canceled if the owner reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! check an assembly recursively for invalid relations
DECLARE_ARRAY allModels
ADD_ARRAY_ELEM allModels ASSEMBLY
SEARCH_MDL_REFS RECURSIVE ASSEMBLY MODEL "*" allModels
FOR mdl REF ARRAY allModels
SEARCH_RELATION_ELEMENTS mdl allRelationElements
FOR relationElement REF ARRAY allRelationElements
VERIFY_RELATIONS relationElement IsValid
IF IsValid == FALSE
PRINT "Invalid Relations at: %" relationElement
END_IF
END_FOR
END_FOR
§
SET_RELATIONS_UNIT_SENSITIVE
Sets the sensitivity state of the model relations. This command
requires Creo 2.0 M110 or above.
Syntax
SET_RELATIONS_UNIT_SENSITIVITY model<:in> [options] sensitivityBOOL
<:in>
Arguments

model
Model for which the sensitivity state should be set.

options
The following options are available:
INITIAL — set the state for the initial relations. This is default
if the option is not specified.
POST_REGEN — sets the state for the post regeneration relations.
OWNER_TYPE "type" — provides the information about the type of the
reference owner. Valid values are MODEL, COMPONENT and ANY. Default
is ANY.

sensitivity
Boolean value for the sensitivity.
Example
SET_RELATIONS_UNIT_SENSITIVE ASSEMBLY TRUE
§
GET_RELATIONS_UNIT_SENSITIVE
Retrieves the sensitivity state of the model relations. This command
requires Creo 2.0 M110 or above.
Syntax
GET_RELATIONS_UNIT_SENSITIVITY model<:in> [options] sensitivityBOOL
<:out>
Arguments

model
Model for which the relation should be written.

options
The following options are available:.
INITIAL — retrieves the state of the initial relations. This is
default if the option is not specified.
POST_REGEN — retrieves the state of the post regeneration
relations.
OWNER_TYPE "type" — provides the information about the type of the
reference owner. Valid values are MODEL, COMPONENT and ANY. Default
is ANY.

sensitivity
Name of the variable which receives the sensitivity state as a
boolean value.
Example
GET_RELATIONS_UNIT_SENSITIVE ASSEMBLY sensitivity
PRINT "sensitivity: %" sensitivity
About Commands for Patterns
Commands for reading and writing pattern information and for creating
reference patterns.
The following commands are available:
GET_TBLPATTERN_TABLES — to retrieve the names of the table pattern
tables.
GET_TBLPATTERN_DATA — to read data of a pattern table.
SET_TBLPATTERN_DATA — to write data to a pattern table.
SET_TBLPATTERN_TABLE — to set a table pattern to a specific table.
EXPORT_TBLPATTERN_DATA — to export data from a pattern table.
CREATE_REF_PATTERN — to create a reference pattern.
CREATE_GENERAL_PATTERN — to create a pattern based on an existing
feature or group.
READ_GENERAL_PATTERN — to read the description of an existing
pattern.
MODIFY_GENERAL_PATTERN — to modify an existing pattern.
GET_PATTERN — to retrieve the reference to a pattern.
GET_PATTERN_MEMBER — to get access to a specific member of a
pattern.
GET_PATTERN_MEMBER_NUM — to retrieve the number of members in a
pattern.
GET_PATTERN_TYPE — to retrieve the type of a pattern.
REMOVE_PATTERN — to remove a pattern.
§
GET_TBLPATTERN_TABLES
Retrieves the names of the table pattern tables in an array.
Syntax
GET_TBLPATTERN_TABLES reference_pattern<:in> array<:out>
Arguments

reference_pattern
Name of an existing reference to a table pattern or a member of this
pattern.

array
Name of the array which should receive the pattern tables.
Error handling
The program execution will be canceled if the pattern reference is
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refPattern
GET_TBLPATTERN_TABLES refPattern arrayTableNames
FOR tableName REF ARRAY arrayTableNames
PRINT "%" tableName
END_FOR
§
GET_TBLPATTERN_DATA
Reads data of a table pattern in an array.
Syntax
GET_TBLPATTERN_DATA reference_pattern<:in> array<:out>
Arguments

reference_pattern
Name of an existing reference to a table pattern or a member of this
pattern.

array
Name of the array which should receive the pattern data. The array
consists of sub arrays. Each sub array specifies a cell of the table
and has three elements. First element is the row index, second
element is the column index and third element is the value from the
pattern table. Row and column index start counting with 0 for the
first element.
Error handling
The program execution will be canceled if the pattern reference is
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refPattern
GET_TBLPATTERN_DATA refPattern arrayPatternData
EXPORT_TBLPATTERN_DATA arrayPatternData output
§
SET_TBLPATTERN_DATA
Updates table pattern with data from an array.
Syntax
SET_TBLPATTERN_DATA reference_pattern<:in> array<:in>
Arguments

reference_pattern
Name of an existing reference to a table pattern or a member of this
pattern.

array
Name of the array containing the pattern data. The array must consist
of sub arrays. Each sub array specifies a cell of the table and has
three elements. First element is the row index, second element is the
column index and third element is the value from the pattern table.
Row and column index start counting with 0 for the first element.
Error handling
The program execution will be canceled if the pattern reference or
the array is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
! retrieve pattern data from excel
EXCEL_CONNECT
EXCEL_NEW_DOCUMENT
EXCEL_GET_SELECTION arrayNewData
EXCEL_DISCONNECT

! update pattern data


USER_SELECT FEATURE refPattern
SET_TBLPATTERN_DATA refPattern arrayNewData
REGEN_MDL refPattern
§
SET_TBLPATTERN_TABLE
Activates a specific table of a table pattern.
Syntax
SET_TBLPATTERN_TABLE refPattern<:in> "table name"
Arguments

refPattern
Reference to a pattern or to a member of this pattern.

table name
String expression of the table name.
Error handling
The program execution will be canceled if the pattern reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE pattern
SET_TBLPATTERN_TABLE pattern "TABLE2"
§
EXPORT_TBLPATTERN_DATA
Exports table pattern data which was already retrieved in an array in
the Creo Elements/Pro table file format.
Syntax
EXPORT_TBLPATTERN_DATA array<:in> "file_name"
Arguments

array
Name of the array containing the pattern data. The array must consist
of sub arrays. Each sub array specifies a cell of the table and has
three elements. First element is the row index, second element is the
column index and third element is the value from the pattern table.
Row and column index start counting with 0 for the first element.

file_name
File name of file which should receive the table pattern data in the
Creo Elements/Pro format. No file name extension should be specified.
Any string expression is allowed.
Error handling
The program execution will be canceled if the array is not existing,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refPattern
GET_TBLPATTERN_DATA refPattern arrayPatternData
EXPORT_TBLPATTERN_DATA arrayPatternData output
CREATE_REF_PATTERN
Creates reference patterns of features and components.
Syntax
CREATE_REF_PATTERN ref_in<:in> [ref_out<:out>]
Arguments

ref_in
Reference to the feature or the component which should be patterned
by reference.

ref_out
Optional reference for the created reference pattern.
Error handling
The program execution will be canceled if the feature or the
component does not does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT refComp
CREATE_REF_PATTERN refComp
§
CREATE_GENERAL_PATTERN
Patterns an existing feature or group. This command requires
Pro/ENGINEER Wildfire 5 or above.
Syntax
CREATE_GENERAL_PATTERN feature<:in> pattern_data<:in>
ref_pattern<:out>
Arguments

feature
Reference to an existing feature or group which should be patterned.

pattern_data
Structure variable of type PATTERN_DATA which contains the pattern
definition.

ref_pattern
Name of the reference which should receive the reference to the
pattern.
Error handling
The program execution will be canceled if the feature is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note
Due do a limitation in the Creo API, directional patterns can't be
created based on a CSYS direction. For this reason they are mimicked
by a translational direction pattern.
Example
USER_SELECT FEATURE feat

DECLARE_STRUCT PATTERN_DATA pattern_data


pattern_data.type = "FILL_PATTERN"

pattern_data.fill_pattern.fill_type = "SPIRAL"
pattern_data.fill_pattern.spacing = 11
pattern_data.fill_pattern.min_distance = 2.71
pattern_data.fill_pattern.rot_angle = 21
pattern_data.fill_pattern.radial_spacing = 3.14

USER_SELECT FEATURE pattern_data.pattern_ref

CREATE_GENERAL_PATTERN feat pattern_data pattern


§
READ_GENERAL_PATTERN
Reads the description of a pattern. This command requires
Pro/ENGINEER Wildfire 5 or above.
Syntax
READ_GENERAL_PATTERN ref_pattern<:in> pattern_data<:out>
Arguments

ref_pattern
Existing reference to a pattern.

pattern_data
Structure variable of type PATTERN_DATA which will receive the
pattern definition.
Error handling
The program execution will be canceled if the reference to the
pattern is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat

READ_GENERAL_PATTERN feat pattern_data


PRINT "type: %" pattern_data.type

IF pattern_data.type == "DIMENSION_PATTERN"

PRINT "dimensions first dir"


FOR pattern_dimension REF ARRAY
pattern_data.array_dimensions_first_dir
PRINT "dimension_ref: %" pattern_dimension.dimension_ref

IF pattern_dimension.dimension_by_value == TRUE
PRINT "value: %" pattern_dimension.value
ELSE
FOR relation REF ARRAY pattern_dimension.array_relations
PRINT "relation: %" relation
END_FOR
END_IF
END_FOR

PRINT "number_instances_first_dir: %"


pattern_data.number_instances_first_dir

PRINT "dimensions second dir"


FOR pattern_dimension REF ARRAY
pattern_data.array_dimensions_second_dir
PRINT "dimension_ref: %" pattern_dimension.dimension_ref

IF pattern_dimension.dimension_by_value == TRUE
PRINT "value: %" pattern_dimension.value
ELSE
FOR relation REF ARRAY pattern_dimension.array_relations
PRINT "relation: %" relation
END_FOR
END_IF
END_FOR

PRINT "number_instances_second_dir: %"


pattern_data.number_instances_second_dir

ELSE_IF pattern_data.type == "DIRECTION_PATTERN"


PRINT "direciton1"
PRINT "direction_type: %"
pattern_data.direction_pattern.direction1.direction_type
PRINT "direction_ref: %"
pattern_data.direction_pattern.direction1.direction_ref
PRINT "direction_vector: %/%/%"
pattern_data.direction_pattern.direction1.direction_vector.x
pattern_data.direction_pattern.direction1.direction_vector.y
pattern_data.direction_pattern.direction1.direction_vector.z
PRINT "direction_flip: %"
pattern_data.direction_pattern.direction1.direction_flip
PRINT "direction_spacing: %"
pattern_data.direction_pattern.direction1.direction_spacing

PRINT "dimensions first dir"


FOR pattern_dimension REF ARRAY
pattern_data.array_dimensions_first_dir
PRINT "dimension_ref: %" pattern_dimension.dimension_ref

IF pattern_dimension.dimension_by_value == TRUE
PRINT "value: %" pattern_dimension.value
ELSE
FOR relation REF ARRAY pattern_dimension.array_relations
PRINT "relation: %" relation
END_FOR
END_IF
END_FOR

PRINT "number_instances_first_dir: %"


pattern_data.number_instances_first_dir

PRINT "direciton2"
PRINT "direction_type: %"
pattern_data.direction_pattern.direction2.direction_type
PRINT "direction_ref: %"
pattern_data.direction_pattern.direction2.direction_ref
PRINT "direction_vector: %/%/%"
pattern_data.direction_pattern.direction2.direction_vector.x
pattern_data.direction_pattern.direction2.direction_vector.y
pattern_data.direction_pattern.direction2.direction_vector.z
PRINT "direction_flip: %"
pattern_data.direction_pattern.direction2.direction_flip
PRINT "direction_spacing: %"
pattern_data.direction_pattern.direction2.direction_spacing

PRINT "dimensions second dir"


FOR pattern_dimension REF ARRAY
pattern_data.array_dimensions_second_dir
PRINT "dimension_ref: %" pattern_dimension.dimension_ref

IF pattern_dimension.dimension_by_value == TRUE
PRINT "value: %" pattern_dimension.value
ELSE
FOR relation REF ARRAY pattern_dimension.array_relations
PRINT "relation: %" relation
END_FOR
END_IF
END_FOR

PRINT "number_instances_second_dir: %"


pattern_data.number_instances_second_dir
ELSE_IF pattern_data.type == "AXIS_PATTERN"
PRINT "pattern_ref: %" pattern_data.pattern_ref
PRINT "angle_offset: %" pattern_data.axis_pattern.angle_offset
PRINT "angle_flip: %" pattern_data.axis_pattern.angle_flip
PRINT "radial_offset: %" pattern_data.axis_pattern.radial_offset
PRINT "radial_flip: %" pattern_data.axis_pattern.radial_flip
PRINT "angle_extend: %" pattern_data.axis_pattern.angle_extend

PRINT "dimensions first dir"


FOR pattern_dimension REF ARRAY
pattern_data.array_dimensions_first_dir
PRINT "dimension_ref: %" pattern_dimension.dimension_ref

IF pattern_dimension.dimension_by_value == TRUE
PRINT "value: %" pattern_dimension.value
ELSE
FOR relation REF ARRAY pattern_dimension.array_relations
PRINT "relation: %" relation
END_FOR
END_IF
END_FOR

PRINT "number_instances_first_dir: %"


pattern_data.number_instances_first_dir

PRINT "dimensions second dir"


FOR pattern_dimension REF ARRAY
pattern_data.array_dimensions_second_dir
PRINT "dimension_ref: %" pattern_dimension.dimension_ref

IF pattern_dimension.dimension_by_value == TRUE
PRINT "value: %" pattern_dimension.value
ELSE
FOR relation REF ARRAY pattern_dimension.array_relations
PRINT "relation: %" relation
END_FOR
END_IF
END_FOR

PRINT "number_instances_second_dir: %"


pattern_data.number_instances_second_dir

ELSE_IF pattern_data.type == "FILL_PATTERN"


PRINT "fill_type: %" pattern_data.fill_pattern.fill_type
PRINT "spacing: %" pattern_data.fill_pattern.spacing
PRINT "min_distance: %" pattern_data.fill_pattern.min_distance
PRINT "rot_angle: %" pattern_data.fill_pattern.rot_angle
PRINT "radial_spacing: %" pattern_data.fill_pattern.radial_spacing
PRINT "pattern_ref: %" pattern_data.pattern_ref

ELSE_IF pattern_data.type == "TABLE_PATTERN"

PRINT "dimensions:"
FOR dim REF ARRAY pattern_data.table_pattern.array_dimensions
PRINT "%" dim
END_FOR

PRINT "tables":
FOR table REF ARRAY pattern_data.table_pattern.array_tables
PRINT "name: %" table.name

FOR instance REF ARRAY table.array_instances


PRINT "index: %" instance.index

FOR value REF ARRAY instance.array_dim_values


PRINT "value: %" value
END_FOR
END_FOR
END_FOR

PRINT "Active Table: %" pattern_data.table_pattern.active_table

ELSE_IF pattern_data.type == "REFERENCE_PATTERN"


! no additional data
ELSE_IF pattern_data.type == "CURVE_PATTERN"
PRINT "use_number: %" pattern_data.curve_pattern.use_number
PRINT "spacing: %" pattern_data.curve_pattern.spacing
PRINT "number: %" pattern_data.curve_pattern.number
PRINT "pattern_ref: %" pattern_data.pattern_ref

ELSE_IF pattern_data.type == "POINT_PATTERN"


PRINT "pattern_ref: %" pattern_data.pattern_ref
END_IF

PRINT "regen_option: %" pattern_data.regen_option


§
MODIFY_GENERAL_PATTERN
Modifies an existing pattern. This command requires Pro/ENGINEER
Wildfire 5 or above.
Syntax
MODIFY_GENERAL_PATTERN ref_pattern<:in> pattern_data<:in>
Arguments

ref_pattern
Existing reference to a pattern.

pattern_data
Structure variable of type PATTERN_DATA which contains the pattern
definition.
Error handling
The program execution will be canceled if the reference to the
pattern is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat

READ_GENERAL_PATTERN feat pattern_data

! modify an existing dimension pattern


IF pattern_data.type <> "DIMENSION_PATTERN"
EXIT
END_IF

DECLARE_STRUCT PATTERN_DATA pattern_data_new


pattern_data_new = pattern_data

! clear existing dimension values for first direction


CLEAR_ARRAY pattern_data_new.array_dimensions_first_dir

! populate new dimension values for first direction


FOR dim REF ARRAY pattern_data.array_dimensions_first_dir
dim.value = 10
dim.dimension_by_value = TRUE
ADD_ARRAY_ELEM pattern_data_new.array_dimensions_first_dir dim
END_FOR

pattern_data_new.number_instances_first_dir = 3

! clear existing dimension values for second direction


CLEAR_ARRAY pattern_data_new.array_dimensions_second_dir

! populate new dimension values for second direction


FOR dim REF ARRAY pattern_data.array_dimensions_second_dir
dim.value = 20
dim.dimension_by_value = TRUE
ADD_ARRAY_ELEM pattern_data_new.array_dimensions_second_dir dim
END_FOR

pattern_data_new.number_instances_second_dir = 4

MODIFY_GENERAL_PATTERN feat pattern_data_new


§
GET_PATTERN
Retrieves the reference to the pattern based on the reference to a
pattern member.
Syntax
GET_PATTERN refPatternMember<:in> refPattern<:in>
Arguments

refPatternMember
Reference to a member inside the pattern.

refPattern
Reference which will receive the pattern.
Error handling
The program execution will be canceled if the pattern member is not
defined, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE patternMember
GET_PATTERN patternMember pattern
§
GET_PATTERN_MEMBER
Retrieves the reference to a specified pattern member of the group.
The input reference can be any feature inside this pattern.
Syntax
GET_PATTERN_MEMBER refAnyPatternMember<:in> indexINT
refIndexPatternMember<:out>
Arguments

reAnyfPatternMember
Reference to a member inside the pattern.

index
Index to specify the element of the pattern. 0 means pattern header,
1 means first member of the pattern.

refIndexPatternMember
Reference which will receive the pattern member according to the
specified index.
Error handling
The program execution will be canceled if the input pattern member is
not defined, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE featInPattern
GET_PATTERN_MEMBER featInPattern 10 memberNumber10
§
GET_PATTERN_MEMBER_NUM
Retrieves the number of pattern members. The input reference can be
any feature inside this pattern.
Syntax
GET_PATTERN_MEMBER_NUM refAnyPatternMember<:in> paramNumMembers<:out>
Arguments

reAnyfPatternMember
Reference to a member inside the pattern.

paramNumMembers
Name of the parameter which will receive the number of pattern
members.
Error handling
The program execution will be canceled if the input pattern member is
not defined, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE featInPattern
GET_PATTERN_MEMBER_NUM featInPattern num
PRINT "Pattern contains % members" num
§
GET_PATTERN_TYPE
Retrieves the pattern type of a pattern.
Syntax
GET_PATTERN_TYPE refPattern<:in> paramPatternType<:out>
Arguments

refPattern
Reference to a pattern or to a pattern member.

paramPatternType
Parameter which will receive the pattern type as a string. Valid
pattern types are:
DIMENSION_PATTERN — for dimension patterns.
REFERENCE_PATTERN — for reference patterns.
TABLE_PATTERN — for table patterns.
FILL_PATTERN — for fill patterns.
AXIS_PATTERN — for axis patterns.
DIRECTION_PATTERN — for direction patterns.
CURVE_PATTERN — to curve patterns.
POINT_PATTERN — to point patterns.
Error handling
The program execution will be canceled if the feature or the
component does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT feature pattern
GET_PATTERN_TYPE pattern paramType
§
REMOVE_PATTERN
Removes a pattern by preserving the patterned feature.
Syntax
REMOVE_PATTERN refPattern<:in>
Arguments

refPattern
Reference to a pattern or to a pattern member.
Error handling
The program execution will be canceled if the feature or the
component does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT feature pattern
REMOVE_PATTERN pattern
About Commands for Family Tables
Commands to manipulate and to retrieve information from family
tables. Commands for the following topics are available:
Family Table Instances — to retrieve, insert, delete instances and
to find references from generics in an instance and vice versa.
Family Table Items — to insert and delete items and to access and
modify the values of an item.
General — to apply general operations on family tables.
Also the option FAMINSTANCES for a for loop can be used to iterate
all instances of a family table.
About Commands for Family Table Instances
Commands to retrieve, insert and delete family table instances and to
find references from generics in an instance and vice versa.
The following commands are available:
GET_REF_FAMINSTANCE — to retrieve an existing reference in a
specific family table instance.
GET_REF_GENERIC — to retrieve an existing reference in the generic
of a family table.
GET_FAMINSTANCE_NAMES — to retrieve an array of all family table
instance names.
INSERT_FAMINSTANCE — to insert a new instance to the family table.
LOOKUP_FAMINSTANCE — to lookup a family table instance by dimension
or parameter items.
LOOKUP_FAMINSTANCES — to lookup an array of family table instances
by dimension or parameters items.
SELECT_FAMINSTANCE — to let the user select an instance of the
family table.
DELETE_FAMINSTANCE — to delete an instance of the family table.
ERASE_FAMINSTANCES — to erase all instances of a family table from
session.
VERIFY_FAMINSTANCE — to verify instances of a family table.
GET_FAMINSTANCE_LOCK_STATUS — to detect the lock status of a family
table instance.
SET_FAMINSTANCE_LOCK_STATUS — to set the lock status for family
table instances.
INTEGRATE_NESTED_FAMINSTANCES — to restructure nested family
tables.
GET_REF_FAMINSTANCE
Retrieves reference to a family table instance item based on a
specific reference and the instance name.
Syntax
GET_REF_FAMINSTANCE reference<:in> "instance name"
reference_instance<:out>
Arguments

reference
Name of an existing reference, either to generic or to a family table
item.

instance name
Name of the Creo Elements/Pro family table instance. Any string
expression is allowed. Also wildcards are allowed to specify the
instance name.

reference_instance
Name of the reference which should receive the information.
Error handling
The program execution will be canceled if the specified reference is
not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT POINT sample_point
GET_REF_FAMINSTANCE sample_point "SAMPLE_INSTANCE"
sample_point_instance
GET_REF_GENERIC
Retrieves reference to the generic item based on a specified
reference to a family table instance item.
Syntax
GET_REF_GENERIC [option] reference<:in> reference_generic<:out>
Arguments

options
Valid options are:
IMMEDIATE: to receive the immediate generic.
TOP_LEVEL: to receive the top level generic.
If no option is specified IMMEDIATE is used as default.

reference
Existing reference in a family table instance.

reference_generic
Name of the reference which should receive the information of the
corresponding reference in the generic.
Error handling
The program execution will be canceled if the reference to the
instance is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT POINT sample_point
GET_REF_GENERIC IMMEDIATE sample_point sample_point_generic
§
GET_FAMINSTANCE_NAMES
Retrieve an array of all family table instance names.
Syntax
GET_FAMINSTANCE_NAMES modelGeneric arrayName<:out>
Arguments

modelGeneric
Generic model specified according to model specification.

arrayName
Name of the array which will receive the instance names.
Error handling
The program execution will be canceled if the reference to the
generic is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Only direct instances of a family table will be found. To retrieve
nested family table instances use GET_REF_FAMINSTACE to get a
reference of a nested generic and use the command for this reference.
Example
GET_FAMINSTANCE_NAMES THIS arrayInstanceNames
FOR instanceName REF ARRAY arrayInstanceNames
PRINT "Instance: %" instanceName
END_FOR
INSERT_FAMINSTANCE
Inserts new instances to a family table.
Syntax
INSERT_FAMINSTANCE modelGeneric "instance_name"
Arguments

modelGeneric
Generic model specified according to model specification.

instance_name
Name for the new instance. Any string expression is allowed.
Error handling
The program execution will be canceled if the reference to the
generic is not existing, unless errors are handled by
BEGIN_CATCH_ERROR. In case the family table instance is already
existing, no error will occur.
Example
INSERT_FAMINSTANCE THIS "new_instance_1"
INSERT_FAMINSTANCE THIS "new_instance_2"
DELETE_FAMINSTANCE
Deletes an existing instances from a family table.
Syntax
DELETE_FAMINSTANCE [options] modelGeneric "instance_name"
Arguments

options
The following options are available:
ERASE_FAMINSTANCE eraseBOOL — determines if the family table
instances should also be erased from memory. Default is TRUE.

refGeneric
Generic model specified according to model specification.

instance_name
Name for the existing instance. Any string expression is allowed.
Also wildcards are allowed to specify the instance name.
Error handling
The program execution will be canceled if the reference to the
generic is not existing, unless errors are handled by
BEGIN_CATCH_ERROR. In case the family table instance is not existing,
no error will occur.
Note
By the use of wildcards also several instances can be removed with
this command. Using an asterisk '*' means to delete all instances.
Example
DELETE_FAMINSTANCE THIS "new_instance_1"
DELETE_FAMINSTANCE THIS "new_inst*"
LOOKUP_FAMINSTANCE
Searches a family table instance name according to dimension or
parameter values of the family item. In case of several matching
instances the first one is returned.
Syntax
LOOKUP_FAMINSTANCE modelGeneric "condition term" instance_name<:out>
Arguments

modelGeneric
Generic model specified according to model specification.

condition term
Condition term to evaluate according the rules of logical
expressions. Parameter or dimension names are regarded as the
variable names.

instance_name
Name of the parameter which should receive the information.
Error handling
The program execution will be canceled if the generic is not existing
or no family table instance is found, unless errors are handled by
BEGIN_CATCH_ERROR.
Note:
The condition term should either be written in quotes (" ... ") or
stored in a string variable. In case comparisons against strings have
to be done, character constants for double quotes ('\"') have to be
used (e.g. "name == '\"'spring'\"').
Example
LOOKUP_FAMINSTANCE THIS "DIA==20.0 AND H==100.0" instance_name
GET_REF_FAMINSTANCE THIS instance_name instance
§
LOOKUP_FAMINSTANCES
Searches all family table instance names according to dimension or
parameter values of the family items.
Syntax
LOOKUP_FAMINSTANCES modelGeneric "condition term"
arrayInstanceNames<:out>
Arguments

modelGeneric
Generic model specified according to model specification.

condition term
Condition term to evaluate according the rules of logical
expressions. Parameter or dimension names are regarded as the
variable names.

arrayInstanceNames
Name of the array which should receive instance names.
Error handling
The program execution will be canceled if the generic is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Note:
The condition term should either be written in quotes (" ... ") or
stored in a string variable. In case comparisons against strings have
to be done, character constants for double quotes ('\"') have to be
used (e.g. "name == '\"'spring'\"').
Example
LOOKUP_FAMINSTANCES THIS "DIA==20.0 OR H==100.0" arrayInstanceNames
FOR instance_name REF ARRAY arrayInstanceNames
GET_REF_FAMINSTANCE THIS instance_name instance
END_FOR
SELECT_FAMINSTANCE
Shows up a selection dialog to let the user select an instance of the
family table.
Syntax
SELECT_FAMINSTANCE modelGeneric refInstance<:out>
Arguments

modelGeneric
Generic model specified according to model specification.

refInstance
Reference to the selected instance.
Error handling
The program execution will be canceled if the generic is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SELECT_FAMINSTANCE THIS instance
GET_MDL_NAME instance name
PRINT "%" name
ERASE_FAMINSTANCES
Erases all family instances from a generic model in Creo
Elements/Pro.
Syntax
ERASE_FAMINSTANCES modelGeneric
Description

modelGeneric
Generic model those family table instances are to be erased.
Specified according to model specification.
Error handling
The program execution will be canceled if the generic model could not
be found, unless errors are handled by BEGIN_CATCH_ERROR. If family
table instances could not be erased from memory, no error occurs.
Example
ERASE_FAMINSTANCES THIS
VERIFY_FAMINSTANCE
Verifies one or all family table instances of a specified family
table.
Syntax
VERIFY_FAMINSTANCE [options] reference<:in> "instance name"
Arguments

options
The following options are supported:
RECURSIVE — to traverse the model recursive and verify also sub
components.

reference
Name of existing reference either in an instance or in the generic.

instance name
Name of the Creo Elements/Pro family table instance. Any string
expression is allowed. Also wildcards are allowed to specify the
instance name.
Error handling
The program execution will be canceled if the reference is not
existing or if the instance could not be verified, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
In case an asterisk '*' is specified as instance name all instances
will be verified.
Example
VERIFY_FAMINSTANCE THIS "*"
VERIFY_FAMINSTANCE THIS "SAMPLE_INST"
§
GET_FAMINSTANCE_LOCK_STATUS
Detects the lock status of a specified family table instance.
Syntax
GET_FAMINSTANCE_LOCK_STATUS model<:in> "instance name" status<:out>
Arguments

model
Either an instance or the generic model specified according to model
specification.

instance name
Name of the family table instance. Any string expression is allowed.
Also wildcards are allowed to specify the instance name.

status
Boolean variable which receives the lock status information.
Error handling
The program execution will be canceled if the model or the instance
is not existing or if the lock status could not be detected, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
In case an asterisk '*' is specified as instance name the lock status
of the first instance will be detected.
Example
GET_FAMINSTANCE_LOCK_STATUS PART "instance1" status
PRINT "Instance1 is locked: %" status
§
SET_FAMINSTANCE_LOCK_STATUS
Sets the lock status of the specified family table instances.
Syntax
SET_FAMINSTANCE_LOCK_STATUS model<:in> "instance name" status<:out>
Arguments

model
Either an instance or the generic model specified according to model
specification.

instance name
Name of the family table instance. Any string expression is allowed.
Also wildcards are allowed to specify the instance name.

status
Boolean variable which receives the lock status information.
Error handling
The program execution will be canceled if the model is not existing
or if the lock status could not be determined, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
In case an asterisk '*' is specified as instance name all instances
will be set.
Example
! lock all instances
SET_FAMINSTANCE_LOCK_STATUS PART "*" TRUE
§
INTEGRATE_NESTED_FAMINSTANCES
This command helps to restructure nested family table instances. It
integrates all tested family table instances to the specified
generic.
Syntax
INTEGRATE_NESTED_FAMINSTANCES modelGeneric
Arguments

modelGeneric
Generic model specified according to model specification.
Error handling
The program execution will be canceled if the reference to the
generic is not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
The command works recursively. In case deeper nested family table
exists on the generic model, they will all be appended as instance to
the generic. Standard values in nested instances represented by an
asterisk '*' could not be maintained. They will be replaced by their
real value. Comment lines in a nested instance could not be regarded
at all. They will be lost.
Example
INTEGRATE_NESTED_FAMINSTANCES THIS
About Commands for Family Table Items
Commands to manipulate and to retrieve information from family
tables.
The following commands are available:
GET_FAMITEM_STATE — to retrieve the state of a reference in a
family table for a specific instance.
SET_FAMITEM_STATE — to suppress or resume a reference in a family
table for a specific instance.
GET_FAMITEM_VALUE — to retrieve the value of an item in a family
table for a specific instance.
SET_FAMITEM_VALUE — to set the value of an item in the family table
for a specific instance.
GET_FAMITEM_NAME — to retrieve the name of a family table item.
GET_FAMITEM_SYMBOL — to retrieve the symbol of a family table item.
GET_FAMITEM_TYPE — to retrieve the type of a family table item.
INSERT_FAMITEM — to insert an item to a family table.
DELETE_FAMITEM — to delete an item from a family table.
GET_FAMITEMS — to retrieve an array of all items of a family table.
GET_FAMITEM_STATE
Retrieves the state of a family table item for a specific instance
and stores it to a variable of type string parameter.
Syntax
GET_FAMITEM_STATE model_generic model_instance reference_item<:in>
paramState<:out>
Arguments

model_generic
Generic model specified according to model specification.

model_instance
Instance model in which the item should be set specified according to
model specification.

reference_item
Existing reference to a feature whose state should be determined.

paramState
Name of the string parameter which will receive either SUPPRESSED or
RESUMED as feature state.
Error handling
The program execution will be canceled if the reference or the
generic or instance model is not existing, unless errors are handled
by BEGIN_CATCH_ERROR.
Note
In case reference items are suppressed in the generic, SEARCH_MDL_REF
with option ALLOW_SUPPRESSED could be used. If the current state of a
item should be determined, GET_FEATURE_STATE could also be used.
Example
USER_SELECT FEATURE refFeature
GET_REF_FAMINSTANCE THIS "sample_instance" instance
GET_FAMITEM_STATE THIS instance refFeature paramState
SET_FAMITEM_STATE
Sets the state of a family table item a specific instance to
suppressed or resumed.
Syntax
SET_FAMITEM_STATE model_generic model_instance reference_item<:in>
'state'
Arguments

model_generic
Generic model specified according to model specification.

model_instance
Instance model in which the item should be set specified according to
model specification, or asterisk '*' for all instances.

reference_item
Name of the existing reference which should be set.

state
SUPPRESSED — to suppress a family item.
RESUMED — to resume a family item.
Error handling
The program execution will be canceled if the reference or the
generic or instance model is not existing, unless errors are handled
by BEGIN_CATCH_ERROR.
Note
Instead of a single family table instance an asterisk '*' could be
specified to set the state of all instances. In case reference items
are suppressed in the generic, SEARCH_MDL_REF with option
ALLOW_SUPPRESSED could be used. If the current state of a item should
be determined, GET_FEATURE_STATE could be used.
Example
USER_SELECT FEATURE refFeature
SET_FAMITEM_STATE THIS * refFeature SUPPRESSED
GET_FAMITEM_VALUE
Retrieve the value of a family table item for a specific instance and
stores it to a variable of type parameter.
Syntax
GET_FAMITEM_VALUE modelGeneric "instance_name" "item_name"
param_value<:out>
Arguments

modelGeneric
Generic model specified according to model specification.

instance_name
Name of the family table instance. Any string expression is allowed.
Also wildcards are allowed to specify the instance name.

item_name
Name of the family table item. Any string expression is allowed. Also
wildcards are allowed to specify the instance name.

param_value
Name of the parameter which will receive the content of the family
table item for the specific instance.
Error handling
The program execution will be canceled if the reference or the
generic or the instance do not exist or if the item could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
Print out all family table values:
GET_FAMINSTANCE_NAMES THIS arrayInstanceNames
GET_FAMITEMS THIS arrayFamitems
FOR instanceName REF ARRAY arrayInstanceNames
FOR item REF ARRAY arrayFamitems
GET_FAMITEM_VALUE THIS instanceName item value
PRINT "%/%: %" instanceName item value
END_FOR
END_FOR
SET_FAMITEM_VALUE
Sets the value of a family table item for a specific instance and
stores it to a variable of type parameter.
Syntax
SET_FAMITEM_VALUE modelGeneric "instance_name" "item_name"
valueSTRNUM
Arguments

modelGeneric
Generic model specified according to model specification.

instance_name
Name of the family table instance. Any string expression is allowed.
Also wildcards are allowed to specify the instance name.

item
Name of the family table item. Any string expression is allowed. Also
wildcards are allowed to specify the instance name.

value
Value which should be set to the item Any string expression or math
expression is allowed.
Error handling
The program execution will be canceled if the reference or the
generic does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
In case of using wildcards, if more that one family table instance or
item is matching, the value will be applied to all possibilities.
Example
SET_FAMITEM_VALUE THIS "*" "dm" 10.0
GET_FAMITEM_NAME
Retrieves the name of a family table item.
Syntax
GET_FAMITEM_NAME modelGeneric "item" param_name<:out>
Arguments

modelGeneric
Generic model specified according to model specification.

item
Name or symbol of the family table item. Any string expression is
allowed. Also wildcards are allowed to specify the instance name.

param_name
Name of the parameter which will receive the name of the family table
item.
Error handling
The program execution will be canceled if the generic does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_FAMITEMS PART arrayFamitems
FOR item REF ARRAY arrayFamitems
GET_FAMITEM_NAME PART item name
GET_FAMITEM_SYMBOL PART item symbol
GET_FAMITEM_TYPE PART item type

PRINT "% - % - %" name symbol type


END_FOR
GET_FAMITEM_SYMBOL
Retrieves the symbol of a family table item.
Syntax
GET_FAMITEM_SYMBOL modelGeneric "item" param_symbol<:out>
Arguments

modelGeneric
Generic model specified according to model specification.

item_name
Name or symbol of the family table item. Any string expression is
allowed. Also wildcards are allowed to specify the instance name.

param_symbol
Name of the parameter which will receive the symbol of the family
table item.
Error handling
The program execution will be canceled if the generic does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_FAMITEMS PART arrayFamitems
FOR item REF ARRAY arrayFamitems
GET_FAMITEM_NAME PART item name
GET_FAMITEM_SYMBOL PART item symbol
GET_FAMITEM_TYPE PART item type

PRINT "% - % - %" name symbol type


END_FOR
GET_FAMITEM_TYPE
Retrieves the type of a family table item.
Syntax
GET_FAMITEM_TYPE modelGeneric "item" param_type<:out>
Arguments

modelGeneric
Generic model specified according to model specification.

item
Name or symbol of the family table item. Any string expression is
allowed. Also wildcards are allowed to specify the instance name.

param_type
Name of the parameter which will receive the type of the family table
item.
Error handling
The program execution will be canceled if the generic does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
The following types are available:
ANNOT_ELEM_PARAM
ASMCOMP
ASMCOMP_MODEL
COMP_CURVE_PARAM
CONNECTION_PARAM
CURVE_PARAM
DIMENSION
EDGE_PARAM
EXTERNAL_REFERENCE
FEATURE
FEATURE_PARAM
GTOL
INH_PART_REF
IPAR_NOTE
MERGE_PART_REF
MP_SOURCE
MP_USER_PARAM
QUILT_PARAM
SIM_OBJ
SURFACE_PARAM
SYSTEM_PARAM
TOL_MINUS
TOL_PLUS
TOL_PLUSMINUS
UDF
USER_PARAM
Example
GET_FAMITEMS PART arrayFamitems
FOR item REF ARRAY arrayFamitems
GET_FAMITEM_NAME PART item name
GET_FAMITEM_SYMBOL PART item symbol
GET_FAMITEM_TYPE PART item type

PRINT "% - % - %" name symbol type


END_FOR
INSERT_FAMITEM
Inserts family table item to a family table to the specified
generic.
Syntax
INSERT_FAMITEM [options] model_generic paramEntityVAR [
paramItem<:out>]
Arguments

options
Valid options are:
INSERT_AS_PATTERN — to insert the reference to a table pattern as
table pattern item and not as feature.
INSERT_AS_EXT_REF — to insert the reference to an external copy
geometry as external reference. This option is only supported for
Creo 4.0 M100 / Creo 5.0.5.0 / Creo 6.0.2.0 and above.
INSERT_AS_ABSOLUTE — to insert a dimension as absolute dimension
value with a $ prefix. This is required to control absolute
dimension values.

INSERT_AS_SINGLE_COMP value BOOL — to insert just the component


itself or all its occurrences. Default is FALSE.

model_generic
Generic model in which the item should be inserted. Models are
specified in the following manner.

paramEntity
Name of an existing variable of type parameter or reference which
contains the information about the item which is to be inserted.

paramItem
Optional name for a parameter receiving the information about the
created family table item.
Error handling
The program execution will be canceled if the reference or the
generic model is not existing, unless errors are handled by
BEGIN_CATCH_ERROR. In case the family table item is already existing,
no error will occur.
Note
To insert a family table item of a Creo Elements/Pro parameter or
dimension, not only it's name, but also the container like parameter,
model dimension or feature dimension is required. Therefor only
variable parameters can be inserted those content was determined by
SEARCH_MDL_PARAM, SEARCH_FEAT_PARAM, INSERT_FAMITEM or GET_FAMITEMS.
Example
SEARCH_MDL_PARAM THIS DM paramDM
SEARCH_MDL_REF THIS PLANE DTM1 refDtm1
INSERT_FAMITEM THIS paramDM
INSERT_FAMITEM THIS refDtm1 paramItem
DELETE_FAMITEM
Deletes family table item from a family table of the specified
generic.
Syntax
DELETE_FAMITEM modelGeneric "item_name"
Arguments

modelGeneric
Generic model specified according to model specification.

item_name
Name of the family table item. Any string expression is allowed. Also
wildcards are allowed to specify the instance name.
Error handling
The program execution will be canceled if the the generic does not
exist, unless errors are handled by BEGIN_CATCH_ERROR. In case the
family table item is not existing, no error will occur.
Note
In case of using wildcards, multiple family table items can be
removed.
Example
DELETE_FAMITEM THIS "*"
DELETE_FAMITEM THIS "d1"
§
GET_FAMITEMS
Collects all family table items of a generic model.
Syntax
GET_FAMITEMS modelGeneric arrayItems<:out>
Arguments

modelGeneric
Generic model specified according to model specification.

arrayItems
Name of the array which will receive the family table items.
Error handling
The program execution will be canceled if the generic does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
Print out all family table values:
GET_FAMINSTANCE_NAMES THIS arrayInstanceNames
GET_FAMITEMS THIS arrayFamitems
FOR instanceName REF ARRAY arrayInstanceNames
FOR item REF ARRAY arrayFamitems
GET_FAMITEM_VALUE THIS instanceName item value
PRINT "%/%: %" instanceName item value
END_FOR
END_FOR
About Commands for General Family Table Operations
General command to access family tables. The following commands are
available:
DELETE_FAMTABLE — to delete a complete family table of a generic
model.
DELETE_FAMTABLE
Deletes a complete family table of a generic model.
Syntax
DELETE_FAMTABLE modelGeneric
Arguments

modelGeneric
Generic model specified according to model specification.
Error handling
The program execution will be canceled if the generic does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
DELETE_FAMTABLE THIS
About Commands for Drawing Support
Commands for drawing support. Commands for the following topics are
available:
Drawing Views — to create and modify drawing views.
Drawing Dimensions — to create modify and show drawing dimensions.
Drawing Tables — to add rows, add text or format drawing tables.
These commands are also valid for Creo Elements/Pro layouts.
Drawing Notes — to create, modify and delete drawing notes.
Drawing Symbols — to create drawing symbols, search for them or
to retrieve their properties.
Drawing Geometric Tolerances — to create, modify and create
geometric tolerances.
Drawing Items — to search for drawing items on a view and to
relate them to a view.
Drawing Annotations — to process commands on all kind of drawing
annotations.
Drawing Models — to add, set and delete models on a drawing.
General — to apply general operations on drawings.
About Commands for Drawing Views
Commands for creating, modifying and retrieving information from
drawing views.
The following commands are available:
SEARCH_DRW_VIEW — to search for a specific view on a drawing.
SEARCH_DRW_VIEWS — to search for various views on a drawing.
GET_DRW_REF_VIEW — to retrieve the reference of a drawing view
from an existing reference.
SET_DRW_REF_VIEW — to assign the reference of a drawing view to
an existing reference.
GET_BACKGROUND_VIEW — to get the background view of a drawing
sheet.
GET_DRW_VIEW_MDL — to retrieve the model associated with a
drawing view.
CREATE_DRW_VIEW_GENERAL — to create a general drawing view.
CREATE_DRW_VIEW_PROJECTION — to create a projected drawing view.
CREATE_DRW_VIEW_DETAIL — to create a detailed drawing view.
SET_DRW_VIEW_DETAIL_OUTLINE — to set the outline of an existing
drawing view.
CREATE_DRW_VIEW_DETAIL_CIRCLE — to create a detailed drawing
view with a circular outline.
SET_DRW_VIEW_DETAIL_OUTLINE_CIRCLE — to set the circular outline
of an existing drawing view.
SET_DRW_VIEW_PARTIAL_AREA — to set a partial area in a drawing
view.
SET_DRW_VIEW_BROKEN_AREA — to set a broken area in a drawing
view.
EXPLODE_DRW_VIEW — Activates or deactivates the default
explosion state in a drawing view. This function requires
GET_DRW_VIEW_SIMPREP — to retrieves the name of the simplified
representation which is used in the drawing view.
SET_DRW_VIEW_SIMPREP — to set the simplified representation
which is used in the drawing view.
GET_DRW_VIEW_POS — to determine the position of a view on a
drawing.
MOVE_DRW_VIEW — to move a drawing view to another position.
SET_DRW_VIEW_NAME — to set the name of a drawing view.
GET_DRW_VIEW_NAME — to read the name of a drawing view.
GET_DRW_VIEW_TYPE — to retrieve the type of a drawing view.
DELETE_DRW_VIEW — to delete a drawing view.
GET_DRW_VIEW_ORIENTATION — to determine the name of the
orientation of the solid model which fits to the drawing view.
SET_DRW_VIEW_ORIENTATION — to set the orientation of a drawing
view according to the view of the associated model.
GET_DRW_VIEW_PNT_COORD — to calculate the coordinate of a point
with respect to a drawing view.
GET_DRW_VIEW_PNT_ORIENT — to determine the orientation of a
point concerning a coordinate system in a drawing view.
GET_DRW_VIEW_REF_POS — to calculate the position of a
geometrical reference or a feature in a drawing.
GET_DRW_VIEW_MATRIX — to retrieve the orientation of a drawing
view as a matrix.
ROTATE_DRW_VIEW — to rotate a drawing view normal to the drawing
view area.
UPDATE_DRW_VIEWS — to update all drawing views.
REPLACE_DRW_VIEW_MDL — to replace the drawing view model against
another family table member.
SET_DRW_LAYER_STATUS — to modify the visibility of a view.
SET_DRW_LAYER_STATUS_EX — to modify the visibility of a view.
Extended version for more visibility states.
GET_DRW_VIEW_OUTLINE — to calculate the outline of a drawing
view.
GET_DRW_VIEW_DISPLAY — to retrieve the display status of an
existing drawing view.
SET_DRW_VIEW_DISPLAY — to set the display status of an existing
drawing view.
SET_DRW_VIEW_TANGENT_EDGE_DISPLAY — to set the display style for
tangent edges.
SET_DRW_VIEW_QUILT_HLR — to set the hidden line removal option
for quilts on a drawing view.
SET_DRW_VIEW_SKELETON_DISPLAY— to set the skeleton model display
option for a drawing view.
GET_DRW_VIEW_AXIS — to retrieve the drawing view axis from a
solid model axis.
SHOW_DRW_VIEW_ANNOTATION — to show a solid model annotation in
the drawing view.
GET_DRW_VIEW_STATE— to determine the suppress state of a drawing
view.
SET_DRW_VIEW_STATE — to suppress or resume a drawing view.
GET_DRW_VIEW_NORM_SURFACES — to search for planar solid surfaces
in a drawing view which are directed towards the drawing area.
CREATE_DRW_VIEW_SECTION — to creates a cross section in a
drawing view based on a solid model section.
GET_DRW_VIEW_SECTION_NUM — to retrieve the number of sections in
a drawing view.
GET_DRW_VIEW_SECTION_NAME — to retrieve the name of a section
from a drawing view.
GET_DRW_VIEW_SECTION_TYPE — to retrieve the type of a section
from a drawing view.
§
SEARCH_DRW_VIEW
Searches for a view in a Creo Elements/Pro drawing.
Syntax
SEARCH_DRW_VIEW refDrawing<:in> "name" sheetINT refDrwView<:out>
Arguments

refDrawing
Reference to an existing drawing.

name
This is the Creo Elements/Pro name of the drawing view to search for.
Any string expression is allowed. The view name could also be
specified by the use of wildcards.

sheet
Sheet number of the drawing. First sheet has the number 1. Any math
expression is allowed. An asterisk '*' as sheet number means, that
the whole drawing is searched for the view.

refDrwView
Retrieves reference of the found drawing view.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist or if the view could not be found, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
! Search drawing for a specific model. In case of a drawing
! the argument "dwg" is just use to keep the syntax.
! See SEARCH_MDL_REF for more information.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Search view called 'FRONT_VIEW' on drawing sheet 1
SEARCH_DRW_VIEW refDrawing FRONT_VIEW 1 refDrwView
SEARCH_DRW_VIEW refDrawing "MAIN" 1 refDrwView
CREATE_DRW_VIEW_PROJECTION refDrwView 10 10 refProjView
§
SEARCH_DRW_VIEWS
Searches for views in a Creo Elements/Pro drawing by specifying name
and sheet number with wildcards.
Syntax
SEARCH_DRW_VIEWS refDrawing<:in> "name" sheetINT array_views<:out>
Arguments

refDrawing
Reference to an existing drawing.

name
This is the Creo Elements/Pro name of the drawing view to search for.
the Any string expression is allowed. The view name could also be
specified by the use of wildcards.

sheet
Sheet number of the drawing. First sheet has the number 1. Any math
expression is allowed. An asterisk '*' as sheet number means, that
the whole drawing is searched for the view.

array_views
Array to receive the references to all found views.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
SEARCH_DRW_VIEWS refDrawing "*" "*" arrayAllViews
§
GET_DRW_REF_VIEW
Retrieves the reference of a drawing view from an existing reference.
Syntax
GET_DRW_REF_VIEW ref<:in> refDrwView<:out>
Arguments

ref
Existing reference which contains the view information.

refDrwView
Retrieves reference of the found drawing view.
Error handling
The program execution will be canceled if the reference does not
exist or does not contain the view information, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
The view information is only part of a reference if it was selected
in the drawing view, and not searched or selected in the model.
Example
USER_SELECT EDGE edge
GET_DRW_REF_VIEW edge view
§
SET_DRW_REF_VIEW
Assigns the the reference of a drawing view to an existing reference.
Syntax
SET_DRW_REF_VIEW ref<:in> refDrwView<:in>
Arguments

ref
Existing reference which contains the view information.

refDrwView
Existing reference to a drawing view.
Error handling
The program execution will be canceled if the reference or the view
references does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
The view information is only part of a reference if it was selected
in the drawing view, and not searched or selected in the model. This
command allows to assign the view information after searching it.
Example
SEARCH_MDL_REF PART EDGE "sample_edge" edge
SET_DRW_REF_VIEW edge view
§
GET_BACKGROUND_VIEW
Retrieves the background view of a drawing sheet.
Syntax
GET_BACKGROUND_VIEW refDrawing<:in> sheetINT refBackgroundView<:out>
Arguments

refDrawing
Reference to an existing drawing

sheet
Sheet number of the drawing. First sheet has the number 1.

refBackgroundView
Receives the background view.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
This command is required for searching an applying drawing items
which do not relate to a model view.
Example
! Relates a drawing items of the first drawing sheet to the
background view.
SEARCH_MDL_REF PART DRAWING "drw" refDrawing
GET_BACKGROUND_VIEW refDrawing 1 backgroundView
SET_DRW_ITEM_VIEW refDrwItem backgroundView
§
GET_DRW_VIEW_MDL
Retrieves reference to the model of the drawing view. This command is
useful for drawing programs.
Syntax
GET_DRW_VIEW_MDL refDrwView<:in> refModel<:out>
Arguments

refDrwView
Reference to an existing drawing view.

refModel
Retrieves reference of the found drawing model.
Error handling:
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
The following example works on a drawing program. THIS is specifying
the current drawing.
! Search view called 'MAIN' in the current drawing on sheet 1
SEARCH_DRW_VIEW THIS MAIN 1 refMainView
! Determine the model of this view.
GET_DRW_VIEW_MDL refMainView refMainMdl
§
CREATE_DRW_VIEW_GENERAL
Creates a general drawing view. The orientation is specified by the a
model view.
Syntax
CREATE_DRW_VIEW_GENERAL refDrawing<:in> refMdl<:in> options
"view_name" sheetINT posXDOUBLE posYDOUBLE scaleDOUBLE
refDrwView<:out>
Arguments

refDrawing
Reference to an existing drawing.

refMdl
Reference to the model which should be placed on the drawing.

view_name
Name of existing model view. This view will be used for the
orientation. Any string expression is allowed.

options
The following options are available:
USE_SIMPREP "repname" — to create the drawing with an existing
simplified representation.

sheet
Sheet number of the drawing. First sheet has the number 1. Any math
expression is allowed.

posX
Placement position of the view in X direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

posY
Placement position of the view in Y direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

scale
Scale of the view which is to be created. Any math expression is
allowed. For scale <= 0 the view has the default scale.

refDrwView
Reference to the created general view.
Error handling
The program execution will be canceled if the references to the
drawing or the model do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
The placement position is the center point of the views bounding box.
Use MOVE_DRW_VIEW to set a position regarding a reference.
Example
! Search drawing for a specific model.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Create general drawing view based on model view 'MAIN' on
! first drawing sheet at position 10/10 with scale 0.5.
CREATE_DRW_VIEW_GENERAL refDrawing THIS "MAIN" 1 10 10 0.5
refMainView
§
CREATE_DRW_VIEW_PROJECTION
Creates a projected drawing view regarding an existing one.
Syntax:
CREATE_DRW_VIEW_PROJECTION refDrwViewParent<:in> posXDOUBLE
posYDOUBLE refDrwView<:out>
Arguments

refDrwViewParent
Reference to an existing drawing view

posX
Placement position of the view in X direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

posY
Placement position of the view in Y direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

refDrwView
Reference to the created projected view.
Error handling
The program execution will be canceled if the reference to the parent
view does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The placement position is the center point of the views bounding box.
Use MOVE_DRW_VIEW to set a position regarding a reference.
Example
! Search drawing for a specific model.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Search view called 'MAIN' in the current drawing on sheet 1
SEARCH_DRW_VIEW THIS MAIN 1 refDrwView
! Create projected drawing view at position 10/10
CREATE_DRW_VIEW_PROJECTION refDrwView 10 10 refProjView
§
CREATE_DRW_VIEW_DETAIL
Creates a detailed drawing view regarding an existing one with a
specified outline curve. This function requires Pro/ENGINEER Wildfire
5 / Creo Elements/Pro 5 or above.
Syntax:
CREATE_DRW_VIEW_DETAIL refDrwViewParent<:in> refCenterPnt<:in>
refOutlineCrv<:in> posXDOUBLE posYDOUBLE refDrwView<:out>
Arguments

refDrwViewParent
Reference to an existing drawing view.

refCenterPnt
Reference to an existing point on the parent view to be used as
center point for the detailed view.

refOutlineCurve
Reference to an existing curve in the parent view to be used as
outline.

posX
Placement position of the view in X direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

posY
Placement position of the view in Y direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

refDrwView
Reference to the created projected view.
Error handling
The program execution will be canceled if the references to the
parent view, center point or outline curve do not exist, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
The placement position is the center point of the views bounding box.
Use MOVE_DRW_VIEW to set a position regarding a reference.
Example
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
SEARCH_DRW_VIEW THIS MAIN 1 refDrwView
SEARCH_MDL_REF THIS POINT "PNT0" refCenterPnt
SEARCH_MDL_REF THIS COMPOSITE_CURVE "outline" refOutlineCurve
CREATE_DRW_VIEW_DETAIL refDrwView refCenterPnt refOutlineCurve 10 10
refDetailView
§
SET_DRW_VIEW_DETAIL_OUTLINE
Sets a new outline spline for an existing detail view based on a
specified outline curve. This function requires Pro/ENGINEER Wildfire
5 / Creo Elements/Pro 5 or above.
Syntax:
SET_DRW_VIEW_DETAIL_OUTLINE refDrwViewDetail<:in> refOutlineCrv<:in>
Arguments

refDrwViewDetail
Reference to an existing detail drawing view.

refOutlineCurve
Reference to an existing curve in the parent view to be used as
outline.
Error handling
The program execution will be canceled if the references to the
detail view or outline curve do not exist, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_VIEW view
USER_SELECT COMPOSITE_CURVE refOutlineCurve
SET_DRW_VIEW_DETAIL_OUTLINE view refOutlineCurve
§
CREATE_DRW_VIEW_DETAIL_CIRCLE
Creates a detailed drawing view regarding an existing one with a
circular outline. This function requires Pro/ENGINEER Wildfire 5 /
Creo Elements/Pro 5 or above.
Syntax:
CREATE_DRW_VIEW_DETAIL_CIRCLE refDrwViewParent<:in> refCenterPnt<:in>
posXDOUBLE posYDOUBLE radiusDOUBLE refDrwView<:out>
Arguments

refDrwViewParent
Reference to an existing drawing view.

refCenterPnt
Reference to an existing point on the parent view to be used as
center point for the detailed view.

posX
Placement position of the view in X direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

posY
Placement position of the view in Y direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

radius
Radius of outline circle. Any math expression is allowed.

refDrwView
Reference to the created projected view.
Error handling
The program execution will be canceled if the references to the
parent view or center point do not exist, unless errors are handled
by BEGIN_CATCH_ERROR.
Note
The placement position is the center point of the views bounding box.
Use MOVE_DRW_VIEW to set a position regarding a reference.
Example
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
SEARCH_DRW_VIEW THIS MAIN 1 refDrwView
SEARCH_MDL_REF THIS POINT "PNT0" refCenterPnt
CREATE_DRW_VIEW_DETAIL_CIRCLE refDrwView refCenterPnt 10 10 20
refDetailView
§
SET_DRW_VIEW_DETAIL_OUTLINE_CIRCLE
Sets a new circular outline spline for an existing detail view based.
This function requires Pro/ENGINEER Wildfire 5 / Creo Elements/Pro 5
or above.
Syntax:
SET_DRW_VIEW_DETAIL_OUTLINE_CIRCLE refDrwViewDetail<:in> radiusDOUBLE
Arguments

refDrwViewDetail
Reference to an existing detail drawing view.

radius
Radius of outline circle. Any math expression is allowed.
Error handling
The program execution will be canceled if the reference to the detail
view does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_VIEW view
SET_DRW_VIEW_DETAIL_OUTLINE_CIRCLE view 7.5
§
SET_DRW_VIEW_PARTIAL_AREA
Sets a partial area in an existing drawing view. This function
requires Pro/ENGINEER Wildfire 5 / Creo Elements/Pro 5 or above.
Syntax:
SET_DRW_VIEW_PARTIAL_AREA showBoundaryBOOL<:in> refDrwView<:in>
refPnt<:in> refCurve<:in>
Arguments

showBoundary
Boolean variable which defines if the boundary should be shown or
not.

refDrwView
Reference to an existing drawing view.

refPnt
Reference to an existing point on the view which determines the
position of the partial area.

refCurve
Reference to an existing curve to be used as outline.
Error handling
The program execution will be canceled if the references to the view,
to the point or to the curve are not existing, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART DRAWING "*" refDrw
SEARCH_DRW_VIEW refDrw "main_view" 1 view
SEARCH_MDL_REF PART POINT "DETAIL_POINT" pnt
SEARCH_MDL_REF PART CURVE "DETAIL_CURVE" crv
SET_DRW_VIEW_PARTIAL_AREA TRUE view pnt crv
§
SET_DRW_VIEW_BROKEN_AREA
Sets a broken area of an existing drawing view. This function
requires Pro/ENGINEER Wildfire 5 / Creo Elements/Pro 5 or above.
Syntax:
SET_DRW_VIEW_BROKEN_AREA refDrwView<:in> direction "refPnt1<:in>
refPnt2<:in> style
Arguments

refDrwView
Reference to an existing drawing view.

direction
Determines the direction of the broken view.
VERTICAL — create the broken view in vertical direction.
HORIZONTAL — creates the broken view in horizontal direction.

refPnt1
Reference to an existing point on the view which determines the
position of the first break line.

refPnt2
Reference to an existing point on the view which determines the
position of the second break line.

style
The following styles for the break line are available:
STRAIGHT — for straight break lines.
S_CURVE — for S-curve break lines.
HEART_BEAT.— for heart beat break lines.
Error handling
The program execution will be canceled if the references to the view
or to the points are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
The placement for the two sub-views and the geometry shape for the
S_CURVE and HEART_BEAT styles are calculated by Pro/ENGINEER / Creo.
Unfortunately the results are quite poor at the moment and need to be
adjusted manually.
Example
SEARCH_MDL_REF PART DRAWING "*" refDrw
SEARCH_DRW_VIEW refDrw "main_view" 1 view
SEARCH_MDL_REF PART POINT "pnt0" pnt0
SEARCH_MDL_REF PART POINT "pnt1" pnt1
SET_DRW_VIEW_BROKEN_AREA view VERTICAL pnt0 pnt1 STRAIGHT
§
EXPLODE_DRW_VIEW
Activates or deactivates the default explosion state in a drawing
view. This function requires Pro/ENGINEER Wildfire 5 / Creo
Elements/Pro 5 or above.
Syntax:
EXPLODE_DRW_VIEW refDrwView<:in> stateBOOL
Arguments

refDrwView
Reference to an existing drawing view.

state
Boolean value which defines if the view should be displayed exploded
or not.
Error handling
The program execution will be canceled if the references to the view
is not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW drawing "main_view" "*" view
EXPLODE_DRW_VIEW view TRUE
§
GET_DRW_VIEW_SIMPREP
Retrieves the name of the simplified representation which is used in
the drawing view. This function requires Pro/ENGINEER Wildfire 5 /
Creo Elements/Pro 5 or above.
Syntax:
GET_DRW_VIEW_SIMPREP refDrwView<:in> simprep<:out>
Arguments

refDrwView
Reference to an existing drawing view.

simprep
Name of the variable which receives the name of the about the
simplified representation.
Error handling
The program execution will be canceled if the references to the view
is not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW drawing "main_view" "*" view
GET_DRW_VIEW_SIMPREP view simprep
PRINT "Current active simprep: %" simprep
§
SET_DRW_VIEW_SIMPREP
Set the active simplified representation of the drawing view. This
function requires Pro/ENGINEER Wildfire 5 / Creo Elements/Pro 5 or
above.
Syntax:
SET_DRW_VIEW_SIMPREP refDrwView<:in> "simprep"
Arguments

refDrwView
Reference to an existing drawing view.

simprep
Specifies simplified representation by name or by keyword.
Error handling
The program execution will be canceled if the references to the view
is not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW drawing "main_view" "*" view
SET_DRW_VIEW_SIMPREP view "MASTER"
§
GET_DRW_VIEW_POS
Determines the position of a view on a drawing
Syntax
GET_DRW_VIEW_POS reference_origin<:in> refDrwView<:in> paramX<:out>
paramY<:out>
Arguments

reference_origin
Determines the origin for measuring the point coordinates. The
following situations are supported:
NULL
The position will be calculated by the center of the bounding box
of the view.
origin is a point, vertex, coordinate system
The position will be calculated regarding this position.

refDrwView
Reference to an existing drawing view.

paramX
Parameter which will receive the x coordinate.

paramY
Parameter which will receive the y coordinate.
Error handling
The program execution will be canceled if the drawing view reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_DRW_VIEW_MDL refView mdl
SEARCH_MDL_REF mdl CSYS "CS0" refCsys
GET_DRW_VIEW_POS refCsys refView x y
PRINT "view pos: % %" x y
GET_DRW_VIEW_POS NULL refView x y
PRINT "view pos for bounding box: % %" x y
§
MOVE_DRW_VIEW
Moves a view on a drawing to the desired position.
Syntax
MOVE_DRW_VIEW reference_origin<:in> refDrwView<:in> posXDOUBLE
posYDOUBE
Arguments

reference_origin
Determines the origin for measuring the point coordinates. The
following situations are supported:
NULL
The position will be calculated by the center of the bounding box
of the view.
origin is a point, vertex, coordinate system
The position will be calculated regarding this position.

refDrwView
Reference to an existing drawing view.

posX
Placement position of the dimension in X direction regarding the
lower left corner of the drawing sheet. Any math expression is
allowed.

posY
Placement position of the dimension in Y direction regarding the
lower left corner of the drawing sheet. Any math expression is
allowed.
Error handling
The program execution will be canceled if the drawing view reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_DRW_VIEW_MDL refView mdl
SEARCH_MDL_REF mdl CSYS "CS0" refCsys
MOVE_DRW_VIEW refCsys refView 0 0
MOVE_DRW_VIEW NULL refView 100 100
§
SET_DRW_VIEW_NAME
Sets the name of a drawing view. This function requires Pro/ENGINEER
Wildfire 5 / Creo Elements/Pro 5 or above.
Syntax
SET_DRW_VIEW_NAME refDrwView<:in> "view_name"
Arguments

refDrwView
Reference to an existing drawing view.

view_name
New drawing view name.
Error handling
The program execution will be canceled if the drawing view does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW THIS "new_view" 1 refView
SET_DRW_VIEW_NAME refView "MAIN_VIEW"
§
GET_DRW_VIEW_NAME
Reads the name of a drawing view.
Syntax
GET_DRW_VIEW_NAME refDrwView<:in> view_name<:out>
Arguments

refDrwView
Reference to an existing drawing view.

view_name
Variable which receives the name of a drawing view.
Error handling
The program execution will be canceled if the drawing view does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEWS THIS "*" "*" arrayAllViews
FOR view REF ARRAY arrayAllViews
GET_DRW_VIEW_NAME view name
PRINT "%" name
END_FOR
§
GET_DRW_VIEW_TYPE
Retrieves the type of a drawing view. This function requires
Pro/ENGINEER Wildfire 5 / Creo Elements/Pro 5 or above.
Syntax
GET_DRW_VIEW_TYPE refDrwView<:in> type<:out>
Arguments

refDrwView
Reference to an existing drawing view.

type
Variable which receives the type of a drawing view.
The following types are available:
GENERAL
PROJECTION
AUXILIARY
DETAIL
REVOLVE
COPY_AND_ALIGN
FLAT_TYPE
Error handling
The program execution will be canceled if the drawing view does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEWS THIS "*" "*" arrayAllViews
FOR view REF ARRAY arrayAllViews
GET_DRW_VIEW_NAME view name
GET_DRW_VIEW_TYPE view type
PRINT "% %" name type
END_FOR
§
DELETE_DRW_VIEW
Delete a view from a drawing.
Syntax
DELETE_DRW_VIEW refDrwView<:in>
Arguments

refDrwView
Reference to an existing drawing view.
Error handling
The program execution will be canceled if the drawing view does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
§
GET_DRW_VIEW_ORIENTATION
Determines the name of the orientation of the solid model which fits
to the drawing view.
Syntax
GET_DRW_VIEW_ORIENTATION refDrwView<:in> paramViewName<:out>
Arguments

refDrwView
Reference to an existing drawing view

paramViewName
Name of the string variable which receives the name of the
orientation.
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
The command could not figure out if the orientation is actually set,
but only if it has the same orientation. If non orientation fits, the
variable will be set to an empty string.
Example:
! Search drawing for a specific model.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Search view called 'MAIN' in the current drawing on sheet 1
SEARCH_DRW_VIEW THIS MAIN 1 refDrwView
! Set drawing view orientation according model view called 'FRONT'
GET_DRW_VIEW_ORIENTATION refDrwView orientation
PRINT "Orientation: %" orientation
§
SET_DRW_VIEW_ORIENTATION
Re-orients an existing drawing view according to specified model
view.
Syntax
SET_DRW_VIEW_ORIENTATION refDrwView<:in> "view_name"
Arguments

refDrwView
Reference to an existing drawing view

view_name
Name of existing model view. This view will be used for the re-
orientation. Any string expression is allowed.
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example:
! Search drawing for a specific model.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Search view called 'MAIN' in the current drawing on sheet 1
SEARCH_DRW_VIEW THIS MAIN 1 refDrwView
! Set drawing view orientation according model view called 'FRONT'
SET_DRW_VIEW_ORIENTATION refDrwView FRONT
§
GET_DRW_VIEW_PNT_COORD
Calculates the coordinates of a point with respect to a drawing view.
Syntax
GET_DRW_VIEW_PNT_COORD refDrwView<:in> refPnt<:in> paramX<:out>
paramY<:out>
Arguments

refDrwView
Reference to an existing drawing view.

refPnt
Reference to a point, coordinate system or vertex in the model
associated to the drawing view.

paramX
Parameter which will receive the x coordinate.

paramY
Parameter which will receive the y coordinate.
Error handling
The program execution will be canceled if the drawing view reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
CREATE_UDF bore face
UDF_REF REF_FACE face
UDF_REF REF_POINT pnt
END_CREATE_UDF

SEARCH_MDL_REF face DRAWING dwg refDrawing


SEARCH_DRW_VIEW refDrawing "MAIN" 1 refDrwView
GET_DRW_VIEW_PNT_COORD refDrwView pnt X Y
CREATE_DRW_VIEW_NOTE refDrwView X Y "note"
§
GET_DRW_VIEW_PNT_ORIENT
Determines the orientation of a point concerning a coordinate system
in the drawing view. The result is calculated in model coordinates.
This function can be used to determine on which side a point is
located in the drawing view and if it is before or behind the drawing
sheet.
Syntax
GET_DRW_VIEW_PNT_ORIENT reference_origin<:in> refDrwView<:in>
refPnt<:in> point_out<:out>
Arguments

reference_origin
Determines the origin for measuring the point coordinates. The
following situations have to be regarded:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to the indicated model.

refDrwView
Reference to an existing drawing view.

refPnt
Reference to a point, coordinate system or vertex in the model
associated to the drawing view.

point_out
Structure variable of type POINT will receive the calculation result.
Error handling
The program execution will be canceled if the reference origin, the
drawing view or the reference point do not exist, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW refDrawing "MAIN" 1 refDrwView
GET_DRW_VIEW_POINT_ORIENT NULL refDrwView refPnt point_orient
IF point_orient.z < 0
EXIT
END_IF

GET_DRW_VIEW_PNT_COORD refDrwView pnt X Y


IF point_orient.x < 0
CREATE_DRW_VIEW_NOTE refDrwView X-5 Y "note"
ELSE
CREATE_DRW_VIEW_NOTE refDrwView X+5 Y "note"
END_IF
§
GET_DRW_VIEW_REF_POS
Retrieves the position of a geometrical reference. If the reference
was selected the pick position of the mouse is supplied. Otherwise
the center position is calculated.
Syntax
GET_DRW_VIEW_REF_POS refDrwView<:in> reference<:in> pos<:out>
Arguments

refDrwView
Reference to an existing drawing view.

reference
Geometrical or feature reference.

pos
Structure variable of type POINT will receive the result.
Error handling
The program execution will be canceled if the drawing view or the
reference does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_DRW_VIEW_REF_POS refView feature pos
PRINT "x: %" pos.x
PRINT "y: %" pos.y
PRINT "z: %" pos.z
§
GET_DRW_VIEW_MATRIX
Retrieves the orientation of a drawing view and calculates a matrix
for this.
Syntax
GET_DRW_VIEW_MATRIX refDrwView<:in> matrix<:out>
Arguments

refDrwView
Reference to an existing drawing view.

matrix
Structure variable of type MATRIX.
Error handling
The program execution will be canceled if the view does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW THIS "TOP" "*" view
GET_DRW_VIEW_MATRIX view matrix
§
ROTATE_DRW_VIEW
Rotates a drawing view normal to the drawing area.
Syntax
ROTATE_DRW_VIEW refDrwView<:in> angleDOUBLE
Arguments

refDrwView
Reference to an existing drawing view.

angle
Double value in degree to rotate in counter clock orientation.
Error handling
The program execution will be canceled if the drawing view does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
ROTATE_DRW_VIEW view 45.0
§
UPDATE_DRW_VIEWS
Updates drawing views on a specific drawing sheet.
Syntax
UPDATE_DRW_VIEWS refDrawing<:in> sheet INT
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has the number 1. Any math
expression is allowed.
Error handling
The program execution will be canceled if the drawing reference does
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
UPDATE_DRW_VIEWS refDrw 1
§
REPLACE_DRW_VIEW_MDL
Replaces the model of a drawing view. This function works only for
replacing models of the same family table.
Syntax
REPLACE_DRW_VIEW_MDL refDrwView<:in> refMdl<:in>
Arguments

refDrwView
Reference to an existing drawing view.

refMdl
Reference to the model which displayed in the view.
Error handling
The program execution will be canceled if the drawing view or the
model reference does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
The old and the new model of the drawing view must be members of the
same family table.
Example
SEARCH_DRW_VIEW THIS "MAIN" 1 refDrwView
GET_DRW_VIEW_MDL refDrwView refDrwViewMdl
GET_REF_FAMINSTANCE refDrwViewMdl "sample_inst" instance
REPLACE_DRW_VIEW_MDL refDrwView instance
§
SET_DRW_LAYER_STATUS
Switches display status of an independent drawing layer.
Syntax
SET_DRW_LAYER_STATUS refDrwView<:in> "layer_name" visibility
Arguments

refDrwView
Reference to an existing drawing view.

layer_name
Name of existing drawing layer. Any string expression is allowed.

visibility
DISPLAY — Display layer
BLANK — Blank layer
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
This command is only working if drawing layers are handled
independent from model layers. This could be configured by Settings >
Drawing Layer Status when layer tree is shown. "Ignore display status
of layers in the model" should have a check mark. This could be
configured in the drawing options (File > Properties > Drawing
Options) via ignore_model_layer_status as yes.
Layers must be associated to a view and not to the top model of the
drawing. The specific view could be selected in the list box of the
layer tree.
A layer of the same name will be searched in the associated solid
model. Layer items from this layer will be copied over to the drawing
layer.
Example
! Search drawing for a specific model.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Search view called 'MAIN' in the current drawing on sheet 1
SEARCH_DRW_VIEW THIS MAIN 1 refDrwView
! Set display independent drawing layer 00_SAMPLE_LAYER
SET_DRW_LAYER_STATUS refDrwView 00_SAMPLE_LAYER DISPLAY
§
SET_DRW_LAYER_STATUS_EX
Switches display status of an independent drawing layer. Extended
version of SET_DRW_LAYER_STATUS to set more visibility states.
Syntax
SET_DRW_LAYER_STATUS_EX refDrwView<:in> "layer_name" "visibility"
Arguments

refDrwView
Reference to an existing drawing view.

layer_name
Name of existing drawing layer. Any string expression is allowed.

visibility
Visibility state. Any string expression is allowed. The following
states are supported:
DISPLAY—layer is displayed.
BLANK—layer is blanked.
ISOLATE—layer is isolated.
HIDDEN_LINE—layer shows components in hidden line display.
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
This command is only working if drawing layers are handled
independent from model layers. This could be configured by Settings >
Drawing Layer Status when layer tree is shown. "Ignore display status
of layers in the model" should have a check mark. This could be
configured in the drawing options (File > Properties > Drawing
Options) via ignore_model_layer_status as yes.
Layers must be associated to a view and not to the top model of the
drawing. The specific view could be selected in the list box of the
layer tree.
A layer of the same name will be searched in the associated solid
model. Layer items from this layer will be copied over to the drawing
layer.
Example
! Search drawing for a specific model.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Search view called 'MAIN' in the current drawing on sheet 1
SEARCH_DRW_VIEW THIS MAIN 1 refDrwView
! Set display independent drawing layer 00_SAMPLE_LAYER
SET_DRW_LAYER_STATUS_EX refDrwView 00_SAMPLE_LAYER ISOLATE
§
GET_DRW_VIEW_OUTLINE
Calculates the outline of a drawing view.
Syntax
GET_DRW_VIEW_OUTLINE refDrwView<:in> outline<:out>
Arguments

refDrwView
Reference to an existing drawing view.

outline
Structure variable of type BOX will receive the outline coordinates
of the drawing view.
Error handling
The program execution will be canceled if the drawing view reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW refDrawing "MAIN" 1 refDrwView
GET_DRW_VIEW_OUTLINE refDrwView outline
PRINT "% % %" outline.x1 outline.y1 outline.z1
PRINT "% % %" outline.x2 outline.y2 outline.z2
§
GET_DRW_VIEW_DISPLAY
Retrieves the display status of an existing drawing view.
Syntax
GET_DRW_VIEW_DISPLAY refDrwView<:in> paramDisplayMode<:out>
Arguments

refDrwView
Reference to an existing drawing view

paramDisplayMode
Name of the string variable which receives the display mode
information. The following modes are available:
DEFAULT
WIREFRAME
HIDDEN_LINE
NO_HIDDEN
SHADED
SHADED_WITH_EDGES — Available for Creo 3.0 M010 and above.
ENVIRONMENT
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example:
SEARCH_DRW_VIEWS drawing "*" * arrayViews
FOR view REF ARRAY arrayViews
GET_DRW_VIEW_DISPLAY view mode
PRINT "Display mode. %" mode
END_FOR
§
SET_DRW_VIEW_DISPLAY
Sets the display status of an existing drawing view.
Syntax
SET_DRW_VIEW_DISPLAY refDrwView<:in> "displayMode"
Arguments

refDrwView
Reference to an existing drawing view

display_mode
Display mode of the view. The following modes are available:
DEFAULT
WIREFRAME
HIDDEN_LINE
NO_HIDDEN
SHADED
SHADED_WITH_EDGES — Available for Creo 3.0 M010 and above.
ENVIRONMENT
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example:
SEARCH_DRW_VIEWS drawing "*" * arrayViews
FOR view REF ARRAY arrayViews
SET_DRW_VIEW_DISPLAY view WIREFRAME
END_FOR
§
SET_DRW_VIEW_TANGENT_EDGE_DISPLAY
Sets the display style for tangent edges.
Syntax
SET_DRW_VIEW_TANGENT_EDGE_DISPLAY refDrwView<:in> edge_display_style
Arguments

refDrwView
Reference to an existing drawing view

edge_display_style
Display style for tangent edges. The following styles are available:
DEFAULT
NONE
SOLID
DIMMED
CENTERLINE
PHANTOM
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEWS drawing "*" * arrayViews
FOR view REF ARRAY arrayViews
SET_DRW_VIEW_TANGENT_EDGE_DISPLAY view DIMMED
END_FOR
§
SET_DRW_VIEW_QUILT_HLR
Sets the hidden line removal option for quilts on a drawing view.
Syntax
SET_DRW_VIEW_QUILT_HLR refDrwView<:in> quiltHLRBOOL
Arguments

refDrwView
Reference to an existing drawing view

quiltHLR
Boolean parameter determines if the hidden line removal for quilts
should be enabled.
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEWS drawing "*" * arrayViews
FOR view REF ARRAY arrayViews
SET_DRW_VIEW_QUILT_HLR view TRUE
END_FOR
§
SET_DRW_VIEW_SKELETON_DISPLAY
Sets the skeleton model display option for a drawing view
Syntax
SET_DRW_VIEW_SKELETON_DISPLAY refDrwView<:in> displaySkeletonBOOL
Arguments

refDrwView
Reference to an existing drawing view

displaySkeleton
Boolean parameter determines if a skeleton model should be displayed
in the view.
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEWS drawing "*" * arrayViews
FOR view REF ARRAY arrayViews
SET_DRW_VIEW_SKELETON_DISPLAY view TRUE
END_FOR
§
GET_DRW_VIEW_AXIS
Retrieves the reference to a drawing view axis from an axis of the
solid model. This is only possible if the drawing axis is displayed.
Since cross-hair style axes could not be selected in the center, a
search direction can be specified. This is especially important when
using this axis for a dimension reference.
Syntax
GET_DRW_VIEW_AXIS [options] refDrwView<:in> refSolidAxis<:in>
refDrawingViewAxis<:out>
Arguments

options
The following options are supported:
SEARCH_DIRECTION "direction" — Valid values for the search
direction are TOP, BOTTOM, LEFT and RIGHT. Default is BOTTOM.

refDrwView
Reference to an existing drawing view.

refSolidAxis
Reference to an axis in the model of the drawing view.

refDrawingViewAxis
Receives the drawing view axis
Error handling
The program execution will be canceled if the reference to the
drawing view or the solid axis does not exist or if the drawing view
axis could not be detected, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
! Search view called 'LEFT' and places symbol to every drawing view
axis
BEGIN_ASM_DESCR
SEARCH_MDL_REF PART DRAWING "dwg" refDrawing
SEARCH_DRW_VIEW refDrawing "LEFT" 1 refDrawingView
SEARCH_MDL_REFS PART AXIS "*" arrayAxis
FOR axis REF ARRAY arrayAxis
DECLARE_REFERENCE drwAxis
INVALIDATE_REF drwAxis
BEGIN_CATCH_ERROR
GET_DRW_VIEW_AXIS refDrawingView axis drwAxis
END_CATCH_ERROR
IF REF_VALID drwAxis
CREATE_DRW_VIEW_SYMBOL refDrawingView "lib:sample" 0 0
ON_ENTITY drwAxis
END_CREATE_DRW_VIEW_SYMBOL
END_IF
END_FOR
END_ASM_DESCR
§
SHOW_DRW_VIEW_AXIS
Shows a drawing view axis based on a solid axis in the view model.
The command is limited to show all axes which belong to the same
feature in all drawing views of the model. The retrieved reference
will be determined by its position. Since cross-hair style axes could
not be selected in the center, a search direction can be specified.
This is especially important when using this axis for a dimension
reference.
Syntax
SHOW_DRW_VIEW_AXIS [options] refDrwView<:in> refSolidAxis<:in>
refDrawingViewAxis<:out>
Arguments

options
The following options are supported:
SEARCH_DIRECTION "direction" — Valid values for the search
direction are TOP, BOTTOM, LEFT and RIGHT. Default is BOTTOM.

refDrwView
Reference to an existing drawing view.

refSolidAxis
Reference to an axis in the model of the drawing view.

refDrawingViewAxis
Receives the drawing view axis
Error handling
The program execution will be canceled if the reference to the
drawing view or the solid axis does not exist or if the drawing view
axis could not be detected, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF RECURSIVE ASSEMBLY AXIS "A_1" axis1
SEARCH_MDL_REF RECURSIVE ASSEMBLY AXIS "A_2" axis2

SEARCH_MDL_REF ASSEMBLY DRAWING "*" drw


SEARCH_DRW_VIEW drw "new_view_2" 1 view

SHOW_DRW_VIEW_AXIS view axis1 refDrwAxis1


SHOW_DRW_VIEW_AXIS view axis2 refDrwAxis2
CREATE_DRW_VIEW_DIM view 2 refDrwAxis1 refDrwAxis2 140 115 refDim4
§
SHOW_DRW_VIEW_ANNOTATION
Shows existing Creo Elements/Pro annotations like a note on a drawing
view by specifying the annotation of the solid model.
Syntax
SHOW_DRW_VIEW_ANNOTATION refDrwView<:in> refAnnotation<:in>
Arguments

refDrwView
Reference to an existing drawing view.

refAnnotation
Reference to an existing annotation in the Creo Elements/Pro model.
Error handling
The program execution will be canceled if the references to the
drawing view or to the annotation do not exist or if the annotation
could not be displayed, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Creo Elements/Pro can show an annotation only in one view. In case
the annotation is already shown in another view, it will be erased
there.
Example
SEARCH_MDL_REF ASSEMBLY DRAWING "*" refDrw
SEARCH_DRW_VIEW refDrw "MAIN" 1 refViewMain
SEARCH_MDL_REFS ASSEMBLY NOTE "*" allNotes
FOR note REF ARRAY allNotes
PRINT "Note: " note
SHOW_DRW_VIEW_ANNOTATION refViewMain note
END_FOR
§
GET_DRW_VIEW_STATE
Determines the suppress status of a drawing view. This function
requires Pro/ENGINEER Wildfire 5 / Creo Elements/Pro 5 or above.
Syntax
GET_DRW_VIEW_STATE refDrwView<:in> parameter<:out>
Arguments

refDrwView
Reference to an existing drawing view

parameter
Name of the string parameter which will receive either SUPPRESSED or
RESUMED as drawing view state.
Error handling
The program execution will be canceled if the drawing view is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEWS THIS "*" "*" arrayAllViews
FOR view REF ARRAY arrayAllViews
GET_DRW_VIEW_STATE view state
PRINT "%" state
END_FOR
§
SET_DRW_VIEW_STATE
Suppresses or resumes a drawing view. This function requires
Pro/ENGINEER Wildfire 5 / Creo Elements/Pro 5 or above.
Syntax
SET_DRW_VIEW_STATE refDrwView<:in> state
Arguments

refDrwView
Reference to an existing drawing view

state
SUPPRESSED — to suppress a drawing view.
RESUMED — to resume a drawing view.
Error handling:
The program execution will be canceled if the drawing view is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEWS THIS "*" "*" arrayAllViews
FOR view REF ARRAY arrayAllViews
SET_DRW_VIEW_STATE view SUPPRESSED
END_FOR
§
GET_DRW_VIEW_NORM_SURFACES
Searches for planar solid surfaces in a drawing view which are
directed towards the drawing area.
Syntax
GET_DRW_VIEW_NORM_SURFACES refDrwView<:in> arrayNormSurfaces<:out>
Arguments

refDrwView
Reference to an existing drawing view

arrayNormSurfaces
Name of the array which will receive the planar surfaces normal to
the drawing area.
Error handling
The program execution will be canceled if the drawing view is not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW THIS "MAIN" 1 view
GET_DRW_VIEW_NORM_SURFACES view arrayNormSurfaces
FOR surface REF ARRAY arrayNormSurfaces
PRINT "%" surface
END_FOR
§
CREATE_DRW_VIEW_SECTION
Creates a cross section in a drawing view base on a solid model
section. The command requires Wildfire 5.0 and above. Before Creo 2.0
M230 / Creo 3.0 M090 the cross section is shown with area model edge
visibility. Afterwards it shows as total model edge visibility.
Syntax
CREATE_DRW_VIEW_SECTION refDrwViewSection<:in> refDrwViewArrow<:in>
"section_name"
Arguments

refDrwViewSection
Reference to an existing drawing view in which the section should be
created.

refDrwViewArrow
Reference to an existing drawing view in which the arrow is
displayed. NULL can be used if no arrow should be displayed.

section_name
Section name defined in the solid model. of the section Any string
expression is allowed and wildcards can be used.
Error handling
The program execution will be canceled if the drawing view for the
section or for the arrow are not existing, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
CREATE_DRW_VIEW_SECTION view viewArrow "DRAWING"
§
GET_DRW_VIEW_SECTION_NUM
Retrieves the number of sections in a drawing view. The command
requires Wildfire 5.0 and above.
Syntax
GET_DRW_VIEW_SECTION_NUM refDrwView<:in> num_sections<:out>
Arguments

refDrwView
Reference to an existing drawing view

num_sections
Name of the variable which will receive the numbers of sections in a
drawing view.
Error handling
The program execution will be canceled if the drawing view does not
existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_VIEW view
GET_DRW_VIEW_SECTION_NUM view num

DECLARE_VARIABLE INTEGER n
n = 0
WHILE n <= num
GET_DRW_VIEW_SECTION_NAME view n name
PRINT "%" name

GET_DRW_VIEW_SECTION_TYPE view n type


PRINT "%" type

n++
END_WHILE
§
GET_DRW_VIEW_SECTION_NAME
Retrieves the name of a section from the drawing view. The command
requires Wildfire 5.0 and above.
Syntax
GET_DRW_VIEW_SECTION_NAME refDrwView<:in> indexINT name<:out>
Arguments

refDrwView
Reference to an existing drawing view

index
Index to specify the section in the drawing view. The first section
has the number 0.

name
Name of the variable which will receive the name of the specified
section.
Error handling
The program execution will be canceled if the drawing view or the
section are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_VIEW view
GET_DRW_VIEW_SECTION_NUM view num

DECLARE_VARIABLE INTEGER n
n = 0
WHILE n <= num
GET_DRW_VIEW_SECTION_NAME view n name
PRINT "%" name

GET_DRW_VIEW_SECTION_TYPE view n type


PRINT "%" type

n++
END_WHILE
§
GET_DRW_VIEW_SECTION_TYPE
Retrieves the type of a section from the drawing view. The command
requires Wildfire 5.0 and above.
Syntax
GET_DRW_VIEW_SECTION_TYPE refDrwView<:in> indexINT type<:out>
Arguments

refDrwView
Reference to an existing drawing view

index
Index to specify the section in the drawing view. The first section
has the number 0.

type
Name of the variable which will receive the name of the specified
section. The following types are available:
FULL
HALF
LOCAL
UNFOLD
ALIGNED
Error handling
The program execution will be canceled if the drawing view or the
section are not existing, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_VIEW view
GET_DRW_VIEW_SECTION_NUM view num

DECLARE_VARIABLE INTEGER n
n = 0
WHILE n <= num
GET_DRW_VIEW_SECTION_NAME view n name
PRINT "%" name

GET_DRW_VIEW_SECTION_TYPE view n type


PRINT "%" type

n++
END_WHILE
About Commands for Drawing Dimensions
Commands for searching, creating and showing drawing dimensions.
The following commands are available:
SEARCH_DRW_VIEW_DIM — to search for a drawing dimension.
SEARCH_DRW_VIEW_DIMS — to search for various drawing dimensions.
SHOW_DRW_VIEW_DIM — to show a dimension in the drawing view.
SHOW_DRW_SHEET_DIM — to show a dimension in the drawing sheet.
MOVE_DRW_DIM — to move a drawing dimension.
GET_DRW_DIM_POS — to retrieve the position of a drawing dimension.
GET_DRW_DIM_TEXT_POS — to retrieve the position of a drawing
dimension text.
GET_DRW_DIM_TEXT_ANGLE — to retrieve the angle of a drawing
dimension text.
ERASE_DRW_DIM_WITNESS_LINE — to erase a witness line from a
dimension on the drawing.
CREATE_DRW_VIEW_DIM — to create a drawing dimension.
DELETE_DRW_VIEW_DIM — to delete a drawing dimension.
CREATE_DRW_VIEW_DIM_ORDINATE_BASELINE — to create a drawing
ordinate dimension baseline.
CONVERT_DRW_VIEW_DIM_TO_ORDINATE — to convert a linear dimension to
a ordinate dimension.
GET_DRW_VIEW_DIM_METHOD — to figure out if a dimension was shown or
created.
GET_DRW_VIEW_DIM_REFS — to retrieve the references of a created
dimension.
GET_DRW_DIM_ATTACHED — to retrieve the information about the
attachment state of drawing dimensions.
CLEANUP_DRW_VIEW_DIMS — to clean up dimensions of a drawing view.
§
SEARCH_DRW_VIEW_DIM
Searches a drawing dimension.
Syntax
SEARCH_DRW_VIEW_DIM [options] refDrwView<:in> "dim_name" refDim<:out>
Arguments

options
The following options are supported:
INCLUDE_ERASED valueBOOL — determines if also erased dimensions
should be regarded. This option is limited to dimension which are
created in the drawing (these dimensions have the default names
starting with "dd", "rdd" or "add" and are created because of the
config.pro option create_drawing_dims_only was set to yes. Default
is FALSE.

refDrwView
Reference to an existing drawing view.

dim_name
Name of the dimension to search for. Every string expression is
allowed.

refDim
Reference which will receive the dimension.
Error handling
The program execution will be canceled if the drawing view reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrawing
SEARCH_DRW_VIEW refDrawing "main" 1 refDrwView
SEARCH_DRW_VIEW_DIM refDrwView "od2" refBaseline
SEARCH_DRW_VIEW_DIM refDrwView ad4 refDim
CONVERT_DRW_VIEW_DIM_TO_ORDINATE refDrwView refDim refBaseline
§
SEARCH_DRW_VIEW_DIMS
Searches for dimensions in a drawing view by specifying the name with
wildcards.
Syntax
SEARCH_DRW_VIEW_DIMS [options] refDrwView<:in> "dim_name"
array_dims<:out>
Arguments

options
The following options are supported:
INCLUDE_ERASED valueBOOL — determines if also erased dimensions
should be regarded. This option is limited to dimension which are
created in the drawing (these dimensions have the default names
starting with "dd", "rdd" or "add" and are created because of the
config.pro option create_drawing_dims_only was set to yes. Default
is FALSE.

refDrwView
Reference to an existing drawing view.

dim_name
Name of the dimension to search for. Every string expression is
allowed. The dimension name could also be specified by the use of
wildcards.

array_dims
Array to receive the references to all found dimensions.
Error handling
The program execution will be canceled if the drawing view reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrawing
SEARCH_DRW_VIEWS refDrawing "*" "*" arrayViews
FOR view REF ARRAY arrayViews
SEARCH_DRW_VIEW_DIMS view "*" arrayDims
FOR dim REF ARRAY arrayDims
GET_DIM_SYMBOL dim symbol
GET_DIM_VALUE dim value
PRINT "%: %" symbol value
END_FOR
END_FOR
§
SHOW_DRW_VIEW_DIM
Shows existing Creo Elements/Pro dimension in a drawing view by
specifying the dimension of the solid model.
Syntax
SHOW_DRW_VIEW_DIM refDrwView<:in> refDim<:in> [DECIMAL_PLACES
num_dec_placesINT]
Arguments

refDrwView
Reference to an existing drawing view.

refDim
Reference to an existing dimension in the Creo Elements/Pro model.

DECIMAL_PLACES num_dec_placesINT
Optional command for specifying number of decimal places for the
dimension. If not specified configuration option UDF_DECIMAL_PLACES
is used to determine the number of decimal places.
Error handling
The program execution will be canceled if the references to the
drawing view or to the dimension do not exist or if the dimension
could not be displayed, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Creo Elements/Pro can show a dimension only in one view. In case the
dimension is already shown in another view it will be erased there.
Example
! Search drawing for a specific model.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Search view called 'MAIN' in the current drawing on sheet 1
SEARCH_DRW_VIEW refDrawing MAIN 1 refView
! Search for model dimension called 'WIDTH'
SEARCH_MDL_REF THIS DIMENSION WIDTH dimWidth
! Show this dimension in the view
SHOW_DRW_VIEW_DIM refView dimWidth
§
SHOW_DRW_SHEET_DIM
Shows existing Creo Elements/Pro dimension on a drawing sheet
specifying the dimension of the solid model.
Syntax
SHOW_DRW_SHEET_DIM refDrawing<:in> sheetINT refDim<:in>
[DECIMAL_PLACES num_dec_placesINT]
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has the number 1. Any math
expression is allowed.

refDim
Reference to an existing dimension in the Creo Elements/Pro model.

DECIMAL_PLACES num_dec_placesINT
Optional command for specifying number of decimal places for the
dimension. If not specified configuration option UDF_DECIMAL_PLACES
is used to determine the number of decimal places.
Error handling
The program execution will be canceled if the references to the
drawing view or to the dimension do not exist or if the dimension
could not be displayed, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Creo Elements/Pro can show a dimension only in one view. In case the
dimension is already shown in another view it will be erased there.
Example
! Search drawing for a specific model.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Search for model dimension called 'WIDTH'
SEARCH_MDL_REF THIS DIMENSION WIDTH dimWidth
! Show this dimension in the fist sheet of the drawing
SHOW_DRW_SHEET_DIM refDrawing 1 dimWidth
§
MOVE_DRW_DIM
Moves a drawing dimension to a specified position. This command is
valid for shown and created dimensions.
Syntax
MOVE_DRW_DIM refDrawing<:in> refDim<:in> posXDOUBLE posYDOUBLE
Arguments

refDrawing
Reference to an existing drawing

refDim
Reference to an existing dimension on this drawing.

posX
Placement position of the dimension in X direction regarding the
lower left corner of the drawing sheet. Any math expression is
allowed.

posY
Placement position of the dimension in Y direction regarding the
lower left corner of the drawing sheet. Any math expression is
allowed.
Error handling
The program execution will be canceled if the reference to the
drawing or the drawing dimension does not exist, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DIMENSION "LENGTH" refDim
SEARCH_MDL_REF THIS DRAWING "drw" refDrawing
SEARCH_DRW_VIEW refDrawing "main_view" 1 refView
SHOW_DRW_VIEW_DIM refView refDim
MOVE_DRW_DIM refDrawing refDim 10 10
§
GET_DRW_DIM_POS
Retrieves the position of a drawing dimension.
Syntax
GET_DRW_DIM_POS refDrawing<:in> refDim<:in> paramX<:out> paramY<:out>
Arguments

refDrawing
Reference to an existing drawing

refDim
Reference to an existing dimension on this drawing.

paramX
Parameter which receives the x coordinate of the dimension position.

paramY
Parameter which receives the y coordinates of the dimension position.
Error handling
The program execution will be canceled if the reference to the
drawing or the drawing dimension does not exist, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
The command provides the lower left corner of the dimension as the
MOVE_DRW_DIM is using as input. However due to a technical change in
Creo Elements/Pro in older versions the midpoint of the dimension is
returned.
Creo Elements/Pro Wildfire 2.0: Always the Midpoint if the
dimension.
Creo Elements/Pro Wildfire 3.0: Since M170 the lower left corner.
In earlier date codes the midpoint.
Creo Elements/Pro Wildfire 4.0: Since M050 the lower left corner.
In earlier date codes the midpoint.
Creo Elements/Pro Wildfire 5.0: Always the lower left corner.
Example
SEARCH_DRW_VIEW THIS "main" 1 view
SEARCH_DRW_VIEW_DIM view "d2" dim1
SEARCH_DRW_VIEW_DIM view "ad3" dim2

GET_DRW_DIM_POS THIS dim1 x1 y1


PRINT "dim1 % %" x1 y1

GET_DRW_DIM_POS THIS dim2 x2 y2


PRINT "dim2 % %" x2 y2
§
GET_DRW_DIM_TEXT_POS
Retrieves the position of a drawing dimension text.
Syntax
GET_DRW_DIM_TEXT_POS refDrawing<:in> refDim<:in> paramX<:out>
paramY<:out>
Arguments

refDrawing
Reference to an existing drawing

refDim
Reference to an existing dimension on this drawing.

paramX
Parameter which receives the x coordinate of the dimension position.

paramY
Parameter which receives the y coordinates of the dimension position.
Error handling
The program execution will be canceled if the reference to the
drawing or the drawing dimension does not exist, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
The command provides the middle left position of the dimension text,
so a note placed on this position can substitute the dimension.
Example
USER_SELECT DIMENSION dim
GET_DRW_DIM_TEXT_POS THIS dim x y
GET_DRW_DIM_TEXT_ANGLE THIS dim angle
GET_DIM_SYMBOL dim symbol
CREATE_DRW_VIEW_NOTE view x y "&" + symbol ANGLE angle
ERASE_DRW_ANNOTATION THIS dim
UPDATE_DRW_VIEWS THIS 1
§
GET_DRW_DIM_TEXT_ANGLE
Retrieves the angle of the drawing dimension text.
Syntax
GET_DRW_DIM_POS refDrawing<:in> refDim<:in> angle<:out>
Arguments

refDrawing
Reference to an existing drawing

refDim
Reference to an existing dimension on this drawing.

angle
Parameter which receives the angle of the dimension text.
Error handling
The program execution will be canceled if the reference to the
drawing or the drawing dimension does not exist, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
GET_DRW_DIM_TEXT_POS THIS dim x y
GET_DRW_DIM_TEXT_ANGLE THIS dim angle
GET_DIM_SYMBOL dim symbol
CREATE_DRW_VIEW_NOTE view x y "&" + symbol ANGLE angle
ERASE_DRW_ANNOTATION THIS dim
UPDATE_DRW_VIEWS THIS 1
§
ERASE_DRW_DIM_WITNESS_LINE
Erases the witness line of a drawing dimension on the specified end.
This function requires Creo 2.0 M160 / Creo 3.0 M040 or above.
Syntax
ERASE_DRW_DIM_WITNESS_LINE refDrawing<:in> refDim<:in> indexINT
Arguments

refDrawing
Reference to an existing drawing.

refDim
Reference to an existing dimension on this drawing.

index
Number which defines the side on which the witness line is to be
erased. This is either 1 or 2. Any math expression is allowed.
Error handling
The program execution will be canceled if the reference to the
drawing or the dimension does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART DRAWING "*" drw
SEARCH_MDL_REF PART DIMENSION "d2" dimD2
ERASE_DRW_DIM_WITNESS_LINE drw dimD2 1
USER_SELECT DIMENSION dim
ERASE_DRW_DIM_WITNESS_LINE drw dim 1
SWITCH_TO_MDL drw
§
CREATE_DRW_VIEW_DIM
Creates a drawing dimension in a drawing view according to specified
model references and placement position.
Syntax
CREATE_DRW_VIEW_DIM refDrwView<:in> num_refsINT [refForDim1<:in>
refForDim2<:in> ... ] posXDOUBLE posYDOUBLE [options][refDim<:out>]
Arguments

refDrwView
Reference to an existing drawing.

num_refs
Number of references to dimensions which follow directly after this
argument. Any math expression is allowed.

refForDim ...
References to dimension in the Creo Elements/Pro model associated to
the drawing view. The number of references must fit to the number
specified in the argument num_refs.

posX
Placement position of the dimension in X direction regarding the
lower left corner of the drawing sheet. Any math expression is
allowed.

posY
Placement position of the dimension in Y direction regarding the
lower left corner of the drawing sheet. Any math expression is
allowed.

options
The following options are supported:
DECIMAL_PLACES num_dec_placesINT
Optional command for specifying the number of decimal places for
the dimension. If not specified the configuration option
UDF_DECIMAL_PLACES is used to determin the number of decimal
places.
ORIENTATION type
The following orientation types are supported:
HORIZONTAL— for a horizontal dimension.
VERTICAL — for a vertical dimension.
SLANTED — for a slanted dimension.
ARC_ANGLE — for dimensioning an arc by its angle. In this case
only on reference to the arc should be supplied and the
ATTACH_TYPE_REF1 and ATTACh_TYP_REF2 must be NONE.
ARC_LENGTH — for dimensioning an arc by its length. In this case
only on reference to the arc should be supplied and the
ATTACH_TYPE_REF1 and ATTACh_TYP_REF2 must be NONE.
The default orientation is VERTICAL.
ATTACH_TYPE_REF1 END1 | END2 | CENTER | MIDPOINT | NONE
To specify if the first reference of the dimension should be
attached on the first end, on the second end, in the center (only
valid for arcs and circles), at the middle point or without further
specification.
ATTACH_TYPE_REF2 END1 | END2 | CENTER | MIDPOINT | NONE
To specify if the second reference of the dimension should be
attached on the first end, on the second end, in the center (only
valid for arcs and circles), at the middle point or without further
specification.

refDim
Optional reference which will receive the created dimension.
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Number and type of specified references matches to the procedure if
you create drawing dimensions manually. In case a diameter should be
created instead of a radius the same reference has to be specified
twice. The optional reference to the created dimension could be used
to apply a dimension text with SET_DIM_TEXT.
Axis can currently not be used as dimension references.
Example
! Search drawing for a specific model.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Search view called 'MAIN' in the current drawing on sheet 1
SEARCH_DRW_VIEW refDrawing MAIN 1 refView
! let the user select an edge in Creo Elements/Pro model
USER_SELECT EDGE edge
! create a diameter dimension on the drawing view
CREATE_DRW_VIEW_DIM refView 1 edge 10 10 refDim
! apply a dimension text to it.
SET_DIM_TEXT refDim "@D\nDiameter"
§
DELETE_DRW_VIEW_DIM
Deletes a drawing dimension which was created or shown on the
drawing.
Syntax
DELETE_DRW_VIEW_DIM refView<:in> refDim<:in>
Arguments

refView
Reference to an existing drawing view.

refDim
Reference to an existing dimension in the Creo Elements/Pro model.
Error handling
The program execution will be canceled if the references to the
drawing view or to the dimension do not exist or if the dimension
could not be displayed, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
The example is searching for all dimensions in all views and tests
the number of references of the dimension. In case no reference is
supplied the dimension will be deleted.
SEARCH_DRW_VIEWS drawing "*" "*" arrayAllViews
FOR view REF ARRAY arrayAllViews
SEARCH_DRW_VIEW_DIMS view "*" arrayAllDims
FOR dim REF ARRAY arrayAllDims
GET_DRW_VIEW_DIM_REFS view dim arrayAllRefs
GET_ARRAY_SIZE arrayAllRefs numAllRefs
IF numAllRefs == 0
DELETE_DRW_VIEW_DIM view dim
END_IF
END_FOR
END_FOR
§
CREATE_DRW_VIEW_DIM_ORDINATE_BASELINE
Creates a drawing ordinate dimension baseline.
Syntax
CREATE_DRW_VIEW_DIM_ORDINATE_BASELINE refDrwView<:in> refDim<:in>
indexINT refBaseline<:out>
Arguments

refDrwView
Reference to an existing drawing view.

refDim
Reference to an existing dimension which should be used to create the
ordinate baseline.

index
Number which defines the side where the origin is located. This is
either 1 or 2. Any math expression is allowed.

refBaseline
Name of the variable which should receive the reference of the
created ordinate baseline.
Error handling
The program execution will be canceled if the drawing view or the
dimension does not exist or if the baseline could not be created,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_VIEW view
USER_SELECT DIMENSION dim
CREATE_DRW_VIEW_DIM_ORDINATE_BASELINE view dim 1 dimBaseline

USER_SELECT DIMENSION dim


CONVERT_DRW_VIEW_DIM_TO_ORDINATE view dim dimBaseline
§
CONVERT_DRW_VIEW_DIM_TO_ORDINATE
Convert a drawing view dimension to a ordinate dimension.
Syntax
CONVERT_DRW_VIEW_DIM_TO_ORDINATE refDrwView<:in> refDim<:in>
refBaseline<:in>
Arguments

refDrwView
Reference to an existing drawing view.

refDim
Reference to an existing dimension which should be converted to a
ordinate dimension.

refBaseline
Reference to a baseline reference. Usually this has the symbolic
dimension name "od".
Error handling
The program execution will be canceled if the drawing view, the
dimension or the baseline dimension do not exist, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF DRAWING THIS drw refDrawing
SEARCH_DRW_VIEW refDrawing "main" 1 refDrwView
SEARCH_DRW_VIEW_DIM refDrwView "od2" refBaseline
SEARCH_DRW_VIEW_DIM refDrwView ad4 refDim
CONVERT_DRW_VIEW_DIM_TO_ORDINATE refDrwView refDim refBaseline
§
GET_DRW_VIEW_DIM_METHOD
Provides information if the dimension is shown on the drawing or if
it was created.
Syntax
GET_DRW_VIEW_DIM_METHOD refView<:in> refDim<:in> paramMethod<:out>
Description

refView
Existing reference of a drawing view.

refDim
Existing reference of a drawing dimension.

paramMethod
Parameter which will receive the method of the dimension.
SHOWN— dimensions which is available in the model and shown in the
drawing. The default symbol of this kind of dimension starts with
'd'.
CREATED_IN_MODEL — dimension which was created in the model while
working on the drawing. This is the default behaviour if the Creo
Elements/Pro configuration option create_drawing_dims_only is not
set to yes. The default symbol of this kind of dimension starts
with 'ad'.
CREATED_IN_DRAWING — dimension which was created in the drawing
while the Creo Elements/Pro configuration option
create_drawing_dims_only was set to yes. The default symbol of this
kind of dimension starts with 'add'.
Error handling
The program execution will be canceled if the view or dimension
reference do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dim
USER_SELECT DRAWING_VIEW view
GET_DRW_VIEW_DIM_METHOD view dim method
§
GET_DRW_VIEW_DIM_REFS
Retrieves the references of a dimension which was created in the
drawing.
Syntax
GET_DRW_VIEW_DIM_REFS refView<:in> refDim<:in> arrayRefsDim<:out>
Arguments

refView
Reference to an existing drawing view.

refDim
Reference to an existing dimension in the Creo Elements/Pro model.

arrayRefsDim
Name of the array which will receive the items which are referenced
by the dimension.
Error handling
The program execution will be canceled if the references to the
drawing view or to the dimension do not exist or if the dimension
could not be displayed, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Only references of created dimensions will be found. For a shown
dimension the array will be empty.
Example
The example is searching for all dimensions in all views and tests
the number of references of the dimension. In case no reference is
supplied the dimension will be deleted.
SEARCH_DRW_VIEWS drawing "*" "*" arrayAllViews
FOR view REF ARRAY arrayAllViews
SEARCH_DRW_VIEW_DIMS view "*" arrayAllDims
FOR dim REF ARRAY arrayAllDims
GET_DRW_VIEW_DIM_REFS view dim arrayAllRefs
GET_ARRAY_SIZE arrayAllRefs numAllRefs
IF numAllRefs == 0
DELETE_DRW_VIEW_DIM view dim
END_IF
END_FOR
END_FOR
§
GET_DRW_DIM_ATTACHED
Retrieves the information about the attachment status of a drawing
dimension. Unattached dimensions are displayed in magenta color. This
function requires the SmartAssembly60_Creo2.dll.
Syntax
GET_DRW_DIM_ATTACHED refDrawing<:in> refDim<:in> varDimAttached<:out>
Arguments

refDrawing
Reference to the drawing which contains the drawing dimension.

refDim
Reference to an existing drawing dimension.

varDimAttached
Name of the boolean variable which receives the information.
Error handling
The program execution will be canceled if the references to the
drawing or to the dimension does not exist, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEWS THIS "*" 1 allViews
DECLARE_ARRAY allDims
FOR view REF ARRAY allViews
SEARCH_DRW_VIEW_DIMS view "*" allDims
END_FOR

FOR dim REF ARRAY allDims


GET_DRW_DIM_ATTACHED THIS dim attached
PRINT "%: %" dim attached
END_FOR
§
CLEANUP_DRW_VIEW_DIMS
Cleans up dimensions of a specified drawing view. The function is
supported for Creo 2.0 and above.
Syntax
CLEANUP_DRW_VIEW_DIMS refDrwView<:in> [options]
Arguments

options
The following options are supported:
OFFSET valueDOUBLE — offset value for dimension spacing. If not
specified the value from detail option default_clean_dim_offset is
used.

INCREMENT valueDOUBLE — increment value for dimension spacing. If


not specified the value from detail option
default_clean_dim_increment is used.

refDimView
Reference to an existing drawing dimension. In case the background
view is specified, the dimensions from all views on the sheet are
cleaned up.
Error handling
The program execution will be canceled if the references to the view
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_BACKGROUND_VIEW THIS 1 viewBackground
CLEANUP_DRW_VIEW_DIMS viewBackground OFFSET 10 INCREMENT 5
About Commands for Drawing Tables
Commands to add rows to, set text to and format drawing tables. These
commands are also working for layouts.
The following commands are available:
CREATE_DRW_TABLE — to create a new drawing table based on a table
template.
SAVE_DRW_TABLE — to save an existing drawing table in txt, crv or
tbl format.
GET_DRW_TABLE_POS — to retrieve the position of a drawing table.
SET_DRW_TABLE_POS — to set the position of a drawing table.
GET_DRW_TABLE_GROWTH_DIR — to retrieve the growth of a drawing
table.
SET_DRW_TABLE_GROWTH_DIR — to set the growth direction of a drawing
table.
GET_DRW_TABLE_COL_WIDTH — to retrieve the width of a drawing table
column.
SET_DRW_TABLE_COL_WIDTH — to set the width of a drawing table
column.
GET_DRW_TABLE_ROW_HEIGHT — to retrieve the height of a drawing
table row.
SET_DRW_TABLE_ROW_HEIGHT — to set the height to a drawing table
row.
GET_DRW_TABLE_SHEET — to determine the sheet number of a drawing
table.
GET_DRW_TABLE_ID — to retrieve the ID of the drawing table
reference.
GET_DRW_TABLE_FROM_ID — to retrieve the drawing table reference
based on the drawing reference and the table id.
GET_DRW_TABLE — to search for a table by its position.
REMOVE_DRW_TABLE — to remove a drawing table.
ADD_DRW_TABLE_ROW — to add a row at the end of a drawing table.
INSERT_DRW_TABLE_ROW — to insert a row to a distinct position of a
drawing table.
REMOVE_DRW_TABLE_ROW — to remove a row from a drawing table
ADD_DRW_TABLE_COL — to add a column at the right side of a drawing
table.
INSERT_DRW_TABLE_COL — to insert a column to a distinct position of
a drawing table.
REMOVE_DRW_TABLE_COL — to remove a column from a drawing table.
GET_DRW_TABLE_SIZE — to retrieve the number of rows and columns
from a drawing table.
GET_DRW_TABLE_OUTLINE — to retrieve the outline of a drawing table.
GET_DRW_TABLE_TEXT — to retrieve text to a drawing table cell.
SET_DRW_TABLE_TEXT — to set text to a drawing table cell.
GET_DRW_TABLE_FORMAT — to retrieve the formatting information from
a drawing table cell.
SET_DRW_TABLE_FORMAT — to format a drawing table cell.
GET_DRW_TABLE_NOTE — to retrieve the note of a drawing table cell.
MERGE_DRW_TABLE — to merge cells of a drawing table.
UNMERGE_DRW_TABLE — to un-merge cells of a drawing table.
SEARCH_DRW_TABLES_FOR_MDL — to search for tables on a drawing which
use a specific model for its repeat region.
GET_DRW_FORMAT_TABLES — to retrieve the tables of the current
drawing format.
GET_DRW_TABLE_CELL_REGION — to retrieve the region id of a drawing
table cell.
CREATE_BOM_BALLOONS — to create BOM balloons for a repeat region.
CLEAN_BOM_BALLOONS — to clean up the position of BOM balloons for a
drawing view.
§
CREATE_DRW_TABLE
Creates a new drawing table based on a table template.
Syntax
CREATE_DRW_TABLE refDrawing<:in> refMdl<:in> options sheet INT posx
posy "table_file" paramTableId<:out>
Arguments

refDrawing
Reference to an existing drawing.

refMdl
Reference to the model which should be associated with the table.
NULL can be used if no model is associated.

options
The following options are available:
USE_SIMPREP "repname" — to create the drawing table with an
existing simplified representation.

sheet
Sheet number of the drawing. First sheet has number 1. Any math
expression is allowed.

posx
Location in X direction.

posy
Location in Y direction.

table_file
Specifies the table file which should be used according to the
technique to specify file paths.

paramTableId
Name of the variable which will receive the id of the created table.
Error handling
The program execution will be canceled if the reference to the
drawing or to the model does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
CREATE_DRW_TABLE refDrawing THIS 1 100 100 "lib:table1.tbl" tableId1
CREATE_DRW_TABLE refDrawing NULL
§
SAVE_DRW_TABLE
Saves an existing drawing table in text, csv or tbl file.
Syntax
SAVE_DRW_TABLE refDrawing<:in> table_id INT "format" "filename"
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table whose position should be retrieved.

format
Format of the output file. Any string expression is allowed. This is
one of the following values:
TXT — save the file in plain text format.
CSV — save the file in the comma separated values format.
TBL — save the file in the PTC drawing table format.

filename
Name and path of the file which should be saved. See path
specifications for details.
Example
RETRIEVE_MDL "drw0001.drw drawing
SAVE_DRW_TABLE drawing 0 "TBL" "export
§
GET_DRW_TABLE_POS
Retrieves the position of the drawing table. The position is the
upper left corner of the first segment.
Syntax
GET_DRW_TABLE_POS refDrawing<:in> table_id INT posX<:out> posY<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table whose position should be retrieved.

posX
Parameter which receives the X position.

posY
Parameter which receives the Y position.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
USER_SELECT DRAWING_TABLE drw_tab
GET_REF_ID drw_tab tab_id
GET_DRW_TABLE_POS THIS tab_id x y
PRINT "position % %" x y
§
SET_DRW_TABLE_POS
Sets the position of a drawing table.
Syntax
SET_DRW_TABLE_POS refDrawing<:in> table_id INT posX DOUBLE posY
DOUBLE
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table whose position is to be set.

posX
Position in X direction.

posY
Position in Y direction.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
USER_SELECT DRAWING_TABLE drw_tab
GET_REF_ID drw_tab tab_id
SET_DRW_TABLE_POS THIS tab_id 100 100
UPDATE_DRW_VIEWS THIS 1
§
GET_DRW_TABLE_GROWTH_DIR
Determines the growth direction of a drawing table.
Syntax
GET_DRW_TABLE_GROWTH_DIR refDrawing<:in> table_id INT growthDir<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table whose position is to be set.

growthDir
Name of the string variable which receives the growth direction. This
is one of the following values:
DOWNRIGHT — growth direction is rightward and descending.
DOWNLEFT — growth direction is leftward and descending.
UPRIGHT — growth direction is rightward and ascending.
UPLEFT — growth direction is leftward and ascending.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
SEARCH_MDL_REF PART DRAWING "*" drw
GET_DRW_TABLE_GROWTH_DIR drw 0 dir
PRINT "Growth direction is: %" dir
§
SET_DRW_TABLE_GROWTH_DIR
Sets the growth direction of a drawing table.
Syntax
SET_DRW_TABLE_GROWTH_DIR refDrawing<:in> table_id INT "growthDir"
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table whose position is to be set.

growthDir
Growth direction. Any string expression is allowed. This is one of
the following values:
DOWNRIGHT — growth direction is rightward and descending.
DOWNLEFT — growth direction is leftward and descending.
UPRIGHT — growth direction is rightward and ascending.
UPLEFT — growth direction is leftward and ascending.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
SEARCH_MDL_REF PART DRAWING "*" drw
SET_DRW_TABLE_GROWTH_DIR drw 0 "DOWNRIGHT"
§
GET_DRW_TABLE_COL_WIDTH
Determines the width of a drawing table column.
Syntax
GET_DRW_TABLE_COL_WIDTH [options] refDrawing<:in> table_id INT column
INT width<:out>
Arguments

options
The following options are supported:
USE_DRAWING_UNITS valueBOOL — specifies the width in drawing units
rather than characters. Default is FALSE.

refDrawing
Reference to an existing drawing.

table_id
Table id of the table for which the column width should be set.

column
Position of the column which width should be determined. The column
number starts with 1.

width
Name of the variable which will receive the width of the specified
column.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2. In case column number is set to -1, the width is
set for all columns. Using negative numbers can lead to ambiguous
expressions and parsing problems. See how to avoid ambiguity for
negative numbers.
Example
SET_DRW_TABLE_COL_WIDTH USE_DRAWING_UNITS TRUE THIS 1 (-1) 10
SET_DRW_TABLE_COL_WIDTH USE_DRAWING_UNITS TRUE THIS 1 2 5
§
SET_DRW_TABLE_COL_WIDTH
Set the width of a drawing table column.
Syntax
SET_DRW_TABLE_COL_WIDTH [options] refDrawing<:in> table_id INT
position INT width DOUBLE
Arguments

options
The following options are supported:
USE_DRAWING_UNITS valueBOOL — specifies the width in drawing units
rather than characters. Default is FALSE.
NO_REGEN — specifies that the drawing should not be regenerated
after the table column width was set.

refDrawing
Reference to an existing drawing.

table_id
Table id of the table for which the column width should be set.

position
Position of the column which width should be set. The column number
starts with 1. In case the column number is -1, the width is set for
all columns.

width
Width of the drawing table column.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2. In case column number is set to -1, the width is
set for all columns. Using negative numbers can lead to ambiguous
expressions and parsing problems. See how to avoid ambiguity for
negative numbers.
Example
GET_DRW_TABLE_COL_WIDTH USE_DRAWING_UNITS TRUE THIS 1 (-1) width
GET_DRW_TABLE_COL_WIDTH USE_DRAWING_UNITS TRUE THIS 1 2 width
§
GET_DRW_TABLE_ROW_HEIGHT
Determines the height of a drawing table row.
Syntax
GET_DRW_TABLE_ROW_HEIGHT [options] refDrawing<:in> table_id INT row
INT height<:out>
Arguments

options
The following options are supported:
USE_DRAWING_UNITS valueBOOL — specifies the height in drawing units
rather than characters. Default is FALSE.

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the row should be appended.

row
Position of the row which height should be set. The row number starts
with 1.

height
Name of the variable which will receive the height of the specified
row.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2. In case row number is set to -1, the height is set
for all rows. Using negative numbers can lead to ambiguous
expressions and parsing problems. See how to avoid ambiguity for
negative numbers.
Example
GET_DRW_TABLE_ROW_HEIGHT USE_DRAWING_UNITS FALSE THIS 1 (-1) height
GET_DRW_TABLE_ROW_HEIGHT USE_DRAWING_UNITS FALSE THIS 1 2 height
§
SET_DRW_TABLE_ROW_HEIGHT
Set the height to a drawing table row.
Syntax
SET_DRW_TABLE_ROW_HEIGHT [options] refDrawing<:in> table_id INT
position INT height DOUBLE
Arguments

options
The following options are supported:
USE_DRAWING_UNITS valueBOOL — specifies the height in drawing units
rather than characters. Default is FALSE.
NO_REGEN — specifies that the drawing should not be regenerated
after the table row height was set.

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the row should be appended.

position
Position of the row which height should be set. The row number starts
with 1. In case the row number is -1, the height is set for all rows.

height
Height of the drawing table row.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2. In case row number is set to -1, the height is set
for all rows. Using negative numbers can lead to ambiguous
expressions and parsing problems. See how to avoid ambiguity for
negative numbers.
Example
SET_DRW_TABLE_ROW_HEIGHT USE_DRAWING_UNITS FALSE THIS 1 (-1) 10
SET_DRW_TABLE_ROW_HEIGHT USE_DRAWING_UNITS FALSE THIS 1 2 5
§
GET_DRW_TABLE_SHEET
Determines the sheet number of a drawing table. The first drawing
sheet has the number 1. In case of several table segments the sheet
number of the first one is determined.
Syntax
GET_DRW_TABLE_SHEET refDrawing<:in> table_id INT sheetNr<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table whose position should be retrieved.

sheetNr
Parameter which receives the drawing sheet number.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
SEARCH_MDL_REFS THIS DRAWING_TABLE "*" arrayTables
FOR table REF ARRAY arrayTables
GET_REF_ID table tab_id
GET_DRW_TABLE_SHEET THIS tab_id sheet
PRINT "table: % sheet: %" tab_id sheet
END_FOR
§
GET_DRW_TABLE_ID
Retrieves the ID from a drawing table reference.
Syntax
GET_DRW_TABLE_ID refDrawingTable<:in> table_id<:out>
Arguments

refDrawingTable
Existing reference to a drawing table.

table_id
Name of the integer variable which receives the table id. Any math
expression is allowed.
Error handling
The program execution will be canceled if the reference to the
drawing table does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_TABLE table

GET_DRW_TABLE_ID table id
PRINT "%" id

GET_DRW_TABLE_FROM_ID THIS id table2


PRINT "%" table
PRINT "%" table2
§
GET_DRW_TABLE_FROM_ID
Retrieves the drawing table reference based on the drawing reference
and the table id.
Syntax
GET_DRW_TABLE_FROM_ID refDrawing<:in> table_id INT
refDrawingTable<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table whose position should be retrieved. Any math
expression is allowed.

refDrawingTable
Name of the variable which receives the reference to the drawing
table.
Error handling
The program execution will be canceled if the reference to the
drawing or the table does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
USER_SELECT DRAWING_TABLE table

GET_DRW_TABLE_ID table id
PRINT "%" id

GET_DRW_TABLE_FROM_ID THIS id table2


PRINT "%" table
PRINT "%" table2
§
GET_DRW_TABLE
Searches for a drawing table according its position.
Syntax
GET_DRW_TABLE refDrawing<:in> sheet INT x DOUBLE y DOUBLE table<:out>
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has number 1. Any math
expression is allowed.

x
X location of the table to find.

y
y location of the table to find.

table
Output reference which receives the table.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist or the table could not be found, unless errors
are handled by BEGIN_CATCH_ERROR.
Note
Use SEARCH_MDL_REF ... DRAWING_TABLE to search for a drawing table by
its id.
Example
GET_DRW_TABLE refDrw 1 33.5 1.25 title_block
§
REMOVE_DRW_TABLE
Removes a drawing table.
Syntax
REMOVE_DRW_TABLE refDrawing<:in> table_id INT
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table from which the row should be deleted.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
USER_SELECT DRAWING_TABLE drw_tab
GET_REF_ID drw_tab tab_id
REMOVE_DRW_TABLE refDrw tab_id
§
ADD_DRW_TABLE_ROW
Adds a row to an existing drawing table.
Syntax
ADD_DRW_TABLE_ROW refDrawing<:in> table_id INT height DOUBLE
paramRow<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the row should be appended.

height
Height of the drawing table row in number of characters.

paramRow
Parameter which receives the row number as integer value. The first
row has the number 1.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
In case the row should not be appended at the end but inserted to a
distinct location use the command INSERT_DRW_TABLE_ROW.
Example
ADD_DRW_TABLE_ROW refDrw 0 1 paramRow
SET_DRW_TABLE_TEXT refDrw 0 paramRow 1 "cell1"
SET_DRW_TABLE_TEXT refDrw 0 paramRow 2 "cell2"
SET_DRW_TABLE_TEXT refDrw 0 paramRow 3 "cell3"
§
INSERT_DRW_TABLE_ROW
Inserts a row to an existing drawing table.
Syntax
INSERT_DRW_TABLE_ROW [options] refDrawing<:in> table_id INT position
INT height DOUBLE paramRow<:out>
Arguments

options
The following options are supported:
USE_DRAWING_UNITS valueBOOL — specifies the height in drawing units
rather than characters. Default is FALSE.
NO_REGEN — specifies that the drawing should not be regenerated
after the table row was inserted.

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the row should be appended.

position
Position after which the new row should be inserted. The row number
starts with 1. Use 0 if the row should be inserted in the very first
line.

height
Height of the drawing table row in number of characters.

paramRow
Parameter which receives the row number as integer value. The first
row has the number 1.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
In case the row should be appended at the end, use the command
ADD_DRW_TABLE_ROW.
Example
INSERT_DRW_TABLE_ROW refDrw 0 5 1 paramRow
SET_DRW_TABLE_TEXT refDrw 0 paramRow 1 "cell1"
SET_DRW_TABLE_TEXT refDrw 0 paramRow 2 "cell2"
SET_DRW_TABLE_TEXT refDrw 0 paramRow 3 "cell3"
§
REMOVE_DRW_TABLE_ROW
Removes a row of an existing drawing table.
Syntax
REMOVE_DRW_TABLE_ROW refDrawing<:in> table_id INT position INT
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table from which the row should be deleted.

position
Position at which the row should be deleted. The row number starts
with 1.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
USER_SELECT DRAWING_TABLE drw_tab
GET_REF_ID drw_tab tab_id
REMOVE_DRW_TABLE_ROW refDrw tab_id 2
§
ADD_DRW_TABLE_COL
Adds a column to an existing drawing table.
Syntax
ADD_DRW_TABLE_COL refDrawing<:in> table_id INT width DOUBLE
paramCol<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the column should be appended.

width
Width of the drawing table column in number of characters.

paramCol
Parameter which receives the column number as integer value. The
first column has the number 1.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
In case the row should not be appended at the end but inserted to a
distinct location use the command INSERT_DRW_TABLE_ROW.
Example
ADD_DRW_TABLE_COL refDrw 0 1 paramCol
SET_DRW_TABLE_TEXT refDrw 0 1 paramCol "cell1"
SET_DRW_TABLE_TEXT refDrw 0 2 paramCol "cell2"
SET_DRW_TABLE_TEXT refDrw 0 3 paramCol "cell3"
§
INSERT_DRW_TABLE_COL
Inserts a column to an existing drawing table.
Syntax
INSERT_DRW_TABLE_COL [options] refDrawing<:in> table_id INT position
INT width DOUBLE paramCol<:out>
Arguments

options
The following options are supported:
USE_DRAWING_UNITS valueBOOL — specifies the width in drawing units
rather than characters. Default is FALSE.
NO_REGEN — specifies that the drawing should not be regenerated
after the table column was inserted.

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the column should be appended.

position
Position after which the new column should be inserted. The column
number starts with 1. Use 0 if the column should be inserted in the
very first position.

width
Width of the drawing table column in number of characters.

paramCol
Parameter which receives the column number as integer value. The
first row has the number 1.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
In case the column should be appended at the end, use the command
ADD_DRW_TABLE_COL.
Example
INSERT_DRW_TABLE_COL refDrw 0 5 10 paramCol
SET_DRW_TABLE_TEXT refDrw 0 1 paramCol "cell1"
SET_DRW_TABLE_TEXT refDrw 0 2 paramCol "cell2"
SET_DRW_TABLE_TEXT refDrw 0 3 paramCol "cell3"
§
REMOVE_DRW_TABLE_COL
Removes a column of an existing drawing table.
Syntax
REMOVE_DRW_TABLE_COL refDrawing<:in> table_id INT position INT
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table from which the column should be deleted.

position
Position at which the column should be deleted. The column number
starts with 1.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
USER_SELECT DRAWING_TABLE drw_tab
GET_REF_ID drw_tab tab_id
REMOVE_DRW_TABLE_COLUMN refDrw tab_id 2
§
GET_DRW_TABLE_SIZE
Retrieves the number of rows and columns from a drawing table.
Syntax
GET_DRW_TABLE_SIZE refDrawing<:in> table_id INT paramNumRows<:out>
paramNumCols<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table whose size should be retrieved.

paramNumRows
Parameter which receives the number of rows as an integer value.

paramNumCols
Parameter which receives the number of columns as an integer value.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
! example for drw entry in sel_list.txt
USER_SELECT DRAWING_TABLE drw_tab
GET_REF_ID drw_tab tab_id
GET_DRW_TABLE_SIZE THIS tab_id numRows numColumns
PRINT "Num rows: % num columns: %" numRows numColumns
§
GET_DRW_TABLE_OUTLINE
Retrieves the outline of a table.
Syntax
GET_DRW_TABLE_OUTLINE refDrawing<:in> table_id INT xLeft<:out>
yTop<:out> xRight<:out> yBottom<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table whose outline should be retrieved.

xLeft
Parameter which receives the leftmost position.

yTop
Parameter which receives the topmost position.

xRight
Parameter which receives the rightmost position.

yBottom
Parameter which receives the bottommost position.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
! example for drw entry in sel_list.txt
USER_SELECT DRAWING_TABLE drw_tab
GET_REF_ID drw_tab tab_id
GET_DRW_TABLE_OUTLINE THIS tab_id x1 y1 x2 y2
PRINT "outline % % % %" x1 y1 x2 y2
§
GET_DRW_TABLE_TEXT
Retrieves text from a drawing table.
Syntax
GET_DRW_TABLE_TEXT refDrawing<:in> table_id INT row INT col INT
text<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the row should be appended.

row
Row of the cell in which the text is to be inserted. Row number
starts with 1.

col
Column of the cell in which the text is to be inserted. Column number
starts with 1.

text
Output variable which receives the cell text.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
GET_DRW_TABLE_TEXT refDrw 0 1 1 text
PRINT "Content %" text
§
SET_DRW_TABLE_TEXT
Inserts text to a drawing table.
Syntax
SET_DRW_TABLE_TEXT refDrawing<:in> table_id INT row INT col INT
"text"
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the row should be appended.

row
Row of the cell in which the text is to be inserted. Row number
starts with 1.

col
Column of the cell in which the text is to be inserted. Column number
starts with 1.

text
Text which should be inserted to the cell. Any string expression is
allowed.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
INSERT_DRW_TABLE_ROW refDrw 0 5 1 paramRow
SET_DRW_TABLE_TEXT refDrw 0 paramRow 1 "cell1"
SET_DRW_TABLE_TEXT refDrw 0 paramRow 2 "cell2"
SET_DRW_TABLE_TEXT refDrw 0 paramRow 3 "cell3"
§
GET_DRW_TABLE_FORMAT
Retrieves formatting information from a table cell on a drawing.
Syntax
GET_DRW_TABLE_FORMAT refDrawing<:in> table_id INT row INT col INT
drw_table_format<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the row should be appended.

row
Row of the cell which should be formatted. Row number starts with 1.

col
Column of the cell with should be formatted. Column number starts
with 1.

drw_table_format
Name for the structure variable of type DRW_TABLE_FORMAT.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
GET_DRW_TABLE_FORMAT THIS 0 1 1 drw_table_format
PRINT "auto_adjust_method: %" drw_table_format.auto_adjust_method
PRINT "font: %" drw_table_format.font
PRINT "height: %" drw_table_format.height
PRINT "horizontal: %" drw_table_format.horizontal
PRINT "slant: %" drw_table_format.slant
PRINT "thickness: %" drw_table_format.thickness
PRINT "vertical: %" drw_table_format.vertical
PRINT "width_factor: %" drw_table_format.width_factor
§
SET_DRW_TABLE_FORMAT
Assigns formatting information to a table cell on a drawing.
Syntax
SET_DRW_TABLE_FORMAT refDrawing<:in> table_id INT row INT col INT
options
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the row should be appended.

row
Row of the cell which should be formatted. Row number starts with 1.
In case the row number is -1, all rows will be formatted.

col
Column of the cell with should be formatted. Column number starts
with 1. In case the column number is -1, all columns will be
formatted.

options
One or more options which should be applied the table cell. The
following options are available:
HEIGHT value DOUBLE
Sets text height.

WIDTH_FACTOR value DOUBLE


Sets the width factor

THICKNESS value DOUBLE


Sets the thickness.

SLANT value DOUBLE


Sets the slant angle.
FONT "fontname"
Sets font by specifying the name. Every string expression is
allowed. Information about fonts is available in the Specify Fonts
section.
HORIZONTAL horizontal_alignment
Sets the horizontal alignment by one of the alignment options LEFT,
CENTER or RIGHT
VERTICAL vertical_alignment
Sets the vertical alignment by one of the alignment options TOP,
MIDDLE or BOTTOM.
WRAP_TEXT
Wraps the text in a cell. This option is available for Pro/ENGINEER
Wildfire 5 and above.

AUTO_ADJUST_HEIGHT adjust BOOL


Adjusts the height of the column to which the cell belongs. This
command is available for Creo 1 and above.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2. In case row and column number is set to -1, the
complete table is formatted. Using negative numbers can lead to
ambiguous expressions and parsing problems. See how to avoid
ambiguity for negative numbers.
Example
SET_DRW_TABLE_FORMAT refDrw 0 1 1 HEIGHT 5
SET_DRW_TABLE_FORMAT refDrw 0 1 2 HORIZONTAL CENTER VERTICAL MIDDLE
SET_DRW_TABLE_FORMAT refDrw 0 1 3 FONT "cgtime"

! set height for the complete table


SET_DRW_TABLE_FORMAT refDrw 1 (-1) (-1) HEIGHT 5
§
GET_DRW_TABLE_NOTE
Retrieves the note of a drawing table cell.
Syntax
GET_DRW_TABLE_NOTE refDrawing<:in> table_id INT row INT col INT
note_ref<:out>
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table to which the row should be appended.

row
Row of the cell which should be formatted. Row number starts with 1.

col
Column of the cell with should be formatted. Column number starts
with 1.

note_ref
Name of the reference for the drawing table note.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist or if there is no drawing table cell note
available, unless errors are handled by BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2. Empty cells may have not drawing cell note
available.
Example
GET_DRW_TABLE_NOTE refDrw 0 1 1 note
§
MERGE_DRW_TABLE
Merges the specified cells in a drawing table.
Syntax
MERGE_DRW_TABLE refDrawing<:in> table_id INT row_from INT col_from
INT row_to INT col_to INT
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table for which cells should be merged.

row_from
Row in which the merge operation should start. Row number starts with
1.

col_from
Column in which the merge operation should start. Column number
starts with 1.

row_to
Row in which the merge operation should end. Row number starts with
1.

col_to
Column in which the merge operation should end. Column number starts
with 1.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
MERGE_DRW_TABLE refDrw 0 1 1 2 2
§
UNMERGE_DRW_TABLE
Un-merges the cells in the specified rectangle of a drawing table.
Syntax
MERGE_DRW_TABLE refDrawing<:in> table_id INT row_from INT col_from
INT row_to INT col_to INT
Arguments

refDrawing
Reference to an existing drawing.

table_id
Table id of the table for which cells should be un-merged.

row_from
Row in which the un-merge operation should start. Row number starts
with 1.

col_from
Column in which the un-merge operation should start. Column number
starts with 1.

row_to
Row in which the un-merge operation should end. Row number starts
with 1.

col_to
Column in which the un-merge operation should end. Column number
starts with 1.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
To figure out the table id of a table, set the selection filter to
Table and move the mouse over the specific table. The message line
information contains the table id. For example ID2(TABLE) means that
the table id is 2.
Example
GET_DRW_TABLE_SIZE refDrw 0 rows cols
UMERGE_DRW_TABLE refDrw 0 1 1 rows cols
§
SEARCH_DRW_TABLES_FOR_MDL
Searches for tables on a drawing which use a specific model for its
repeat region.
Syntax
SEARCH_DRW_TABLES_FOR_MDL refDrawing<:in> refMdl<:in>
arrayTableIds<:out>
Arguments

refDrawing
Reference to an existing drawing.

refMdl
Reference to a model.

arrayTableIds
Name of the array which receives all ids of tables which are using
the specified model for its repeat region.
Error handling
The program execution will be canceled if the reference to the
drawing or the model does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
It is currently not possible to search for MFG models in a repeat
region.
Example
RETRIEVE_MDL "asm0001.asm" mdl
SEARCH_DRW_TABLES_FOR_MDL THIS mdl arrayTableIds
FOR tableId REF ARRAY arrayTableIds
PRINT "%" tableId
END_FOR
§
GET_DRW_FORMAT_TABLES
Retrieves all tables of the current drawing format.
Syntax
GET_DRW_FORMAT_TABLES refDrawing<:in> sheetINT arrayTableIds<:out>
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has number 1. Any math
expression is allowed.

arrayTableIds
Name of the array which receives all ids of tables which are located
on the current drawing format.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_DRW_FORMAT_TABLES drw 1 arrayTableIds
FOR tableId REF ARRAY arrayTableIds
PRINT "%" tableId
END_FOR
§
GET_DRW_TABLE_CELL_REGION
Retrieves the region id for a specific drawing table cell. The
command is available since Creo 3.0 M130 / Creo 4.0 M020 and above.
Syntax
GET_DRW_TABLE_CELL_REGION refDrawingTable<:in> row INT col INT
region_id<:out>
Arguments

refDrawingTable
Reference to an existing drawing table.

row
Row of the cell which should be formatted. Row number starts with 1.

col
Column of the cell with should be formatted. Column number starts
with 1.

region_id
Name of the integer variable which receives the region number. In
case the cell does not belong to a region, the number is -1.
Example
USER_SELECT DRAWING_TABLE table
GET_DRW_TABLE_CELL_REGION table 1 1 id
§
CREATE_BOM_BALLOONS
Creates BOM balloons for a repeat region. The command is available
since Creo 2.0 M050 and above.
Syntax
CREATE_BOM_BALLOONS [options] refDrawingTable<:in> region_id INT
view<:in>
Arguments

options
The following options are supported
BOM_COMPONENTS arrayComponents — to specify the components for
which the BOM balloons should be created. In case of an empty
array, the balloons are created for all components.

refDrawingTable
Reference to an existing drawing table.

region_id
ID of the repeat region in the drawing. Currently there is no
reliable way to determine the region id automatically. The first
repeat region which was create starts with the number 0. Any math
expression is allowed. In case a negative region_id is supplied, the
first region of the table will be used.

view
Reference to an existing drawing view or NULL to use the first view.
Error handling
The program execution will be canceled if the reference to the
drawing table or view do not exist or the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_TABLE table
USER_SELECT DRAWING_VIEW view
CREATE_BOM_BALLOONS table 0 view
§
CLEAN_BOM_BALLOONS
Cleans up the position of BOM balloons for a drawing view. The
command is available since Creo 2.0 M050 and above.
Syntax
CLEAN_BOM_BALLOONS refDrawingView<:in> [options]
Arguments

refDrawingView
Reference to an existing drawing view.

options
The following options are supported:
CLEAN_POSITIONS "clean_option" — clean option can be one of the
following:
NO_POSITION — the position of the balloons will not be cleaned
up.
VIEW_OUTLINE — position the balloons around the view border. This
is the default se
EXISTING_SNAPLINES — existing snap lines will be used to clean up
the balloons.tting.

OFFSET_VIEW_OUTLINE value DOUBLE— double value to define the border


offset. This option is only considered for the VIEW_OUTLINE clean
position setting. The default is read from the drawing detail
option def_bom_balloons_view_offset.

STAGGER value BOOL — boolean value if balloons should be staggered


at different offset distances. The default is read from the drawing
detail option def_bom_balloons_stagger.

STAGGER_INCREMENT value DOUBLE —double value for the stagger


distance increment. The default is read from the drawing detail
option def_bom_balloons_stagger_value.

CREATE_SNAP_LINES value BOOL — boolean value if corresponding snap


lines should be created. The default is read from the drawing
detail option def_bom_balloons_snap_lines.

MINIMUM_SPACING value DOUBLE — double value determines the minimum


distance between balloons. The default is read from the drawing
detail option min_dist_between_bom_balloons.
ATTACH_LEADERS "attach_option" — attach option for the leaders. The
default is read from the drawing detail option
def_bom_balloons_attachment.
EDGE — attach the balloon leaders to edges.
SURFACE — attached the balloon leaders to surfaces.
Error handling
The program execution will be canceled if the reference to the
drawing view does not exist or the command fails, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_VIEW view
CLEAN_BOM_BALLOONS view CLEAN_POSITION "EXISTING_SNAP_LINES"
About Commands for Drawing Notes
Commands to create, modify and delete drawing notes. rows to, set
text to and format drawing tables. These commands are also working
for layouts.
The following commands are available:
CREATE_DRW_VIEW_NOTE — to create a note in a drawing view.
CREATE_DRW_NOTE — to create a note on a drawing.
DELETE_DRW_NOTE — to delete a note from a drawing.
ERASE_DRW_NOTE — to erase a note from a drawing.
CREATE_DRW_NOTE_EX — extended version of the command to create a
note on a drawing.
READ_DRW_NOTE_EX — extended version of the command to read a note
on a drawing.
MODIFY_DRW_NOTE_EX — extended version of the command to modify a
note on a drawing.
GET_DRW_NOTE_TEXT —to retrieve the text from a drawing note.
SET_DRW_NOTE_TEXT — to set the text of a drawing note.
GET_DRW_NOTE_TEXT_HEIGHT — to retrieve the text height from a
drawing note.
SET_DRW_NOTE_TEXT_HEIGHT — to set the text height of a drawing
note.
GET_DRW_NOTE_TEXT_ALIGNMENT — to retrieve the horizontal and
vertical alignment from a drawing note.
SET_DRW_NOTE_TEXT_ALIGNMENT — to set the horizontal and vertical
alignment of a drawing note.
GET_DRW_NOTE_TEXT_FONT — to retrieve the font from a drawing note.
SET_DRW_NOTE_TEXT_FONT — to set the front of a drawing note.
GET_DRW_NOTE_POS — to retrieve the position of a drawing note.
SET_DRW_NOTE_POS — to modify the position of a drawing note.
GET_DRW_NOTE_ANGLE — to retrieve the angle of a drawing note.
SET_DRW_NOTE_ANGLE — to modify the angle of a drawing note.
GET_DRW_NOTE_OWNER — to retrieve the information about the owner of
a note.
MOVE_DRW_NOTE_TO_VIEW — to move a drawing note to a specified view.
ADD_DRW_NOTE_LEADER — to add one leader or an array of leaders to a
drawing note.
SET_DRW_NOTE_LEADER — to set one leader or an array of leaders for
a drawing note.
§
CREATE_DRW_VIEW_NOTE
Creates a drawing note for a specified view. An leader point could be
specified for this.
Syntax
CREATE_DRW_VIEW_NOTE refDrwView<:in> posX DOUBLE posY DOUBLE "text"
options [ref_note<:out>]
Arguments

refDrwView
Reference to an existing drawing view

posX
Placement position of the view in X direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

posY
Placement position of the view in Y direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

text
This is the note text which should be created. Any string expression
is allowed.

options
One or more options which should be applied the table cell. The
following options are available:
WITH_LEADER ref<:in>
Sets the geometric reference as leader.
OFFSET_FROM ref<:in>
Sets the reference as offset anchor.
ARROW_TYPE "type"
Arrow type for the leader. See the leader arrow type specification
for possible types. This option is only effective for Creo
Parametric 1.0 and above.

HEIGHT value DOUBLE


Sets text height.

WIDTH_FACTOR value DOUBLE


Sets the width factor

THICKNESS value DOUBLE


Sets the thickness.

SLANT value DOUBLE


Sets the slant angle.
FONT "fontname"
Sets font by specifying the name. Every string expression is
allowed. Information about fonts is available in the Specify Fonts
section.
HORIZONTAL horizontal_alignment
Sets the horizontal alignment by one of the alignment options LEFT,
CENTER or RIGHT
VERTICAL vertical_alignment
Sets the vertical alignment by one of the alignment options TOP,
MIDDLE or BOTTOM.

ANGLE value DOUBLE


Sets the angle.
Error handling
The program execution will be canceled if the reference to the view
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case of a leading ampersand &, the following text is regarded as a
variable which was searched via SEARCH_FEAT_PARAM or
SEARCH_MDL_PARAM. In case of a Creo parameter the suffix :FID should
be applied. This will be automatically replaced by the feature id.
Example
! search a feature parameter
SEARCH_FEAT_PARAM featureWithParam "sample_param" featParam
! get point for leader
SEARCH_MDL_REF THIS POINT PNT0 pnt_leader
! Search view called 'MAIN' in the current drawing on sheet 1
SEARCH_DRW_VIEW THIS MAIN 1 refDrwView
! create note with leader at position 10/10 for view main and store
the created note to a variable
CREATE_DRW_VIEW_NOTE viewMain 10 10 "note text" WITH_LEADER
pnt_leader refNote
! create note with content of a Creo Elements/Pro parameter
CREATE_DRW_VIEW_NOTE viewMain 20 10 "&featParam:FID"
§
CREATE_DRW_NOTE
Creates a drawing note.
Syntax
CREATE_DRW_NOTE refDrw<:in> posX DOUBLE posY DOUBLE "text" options
[ref_note<:out>]
Arguments

refDrw
Reference to an existing drawing.

posX
Placement position of the view in X direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

posY
Placement position of the view in Y direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

text
This is the note text which should be created. Any string expression
is allowed.

options
One or more options which should be applied the table cell. The
following options are available:
WITH_LEADER ref<:in>
Set the geometric reference as leader.
OFFSET_FROM ref<:in>
Sets the reference as offset anchor.
ARROW_TYPE "type"
Arrow type for the leader. See the leader arrow type specification
for possible types. This option is only effective for Creo
Parametric 1.0 and above.

HEIGHT value DOUBLE


Sets text height.

WIDTH_FACTOR value DOUBLE


Sets the width factor

THICKNESS value DOUBLE


Sets the thickness.

SLANT value DOUBLE


Sets the slant angle.
FONT "fontname"
Sets font by specifying the name. Every string expression is
allowed. Information about fonts is available in the Specify Fonts
section.
HORIZONTAL horizontal_alignment
Sets the horizontal alignment by one of the alignment options LEFT,
CENTER or RIGHT
VERTICAL vertical_alignment
Sets the vertical alignment by one of the alignment options TOP,
MIDDLE or BOTTOM.

ANGLE value DOUBLE


Sets the angle.
Error handling
The program execution will be canceled if the reference to the view
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case of a leading ampersand &, the following text is regarded as a
variable which was searched via SEARCH_FEAT_PARAM or
SEARCH_MDL_PARAM. In case of a Creo parameter the suffix :FID should
be applied. This will be automatically replaced by the feature id.
Example
SEARCH_FEAT_PARAM featureWithParam "sample_param" featParam
SEARCH_MDL_REF THIS DRAWING drw refDrw
CREATE_DRW_NOTE refDrw 10 10 "note text" FONT "cgtime"
CREATE_DRW_NOTE refDrw 20 10 "&featParam:FID"
§
DELETE_DRW_NOTE
Deletes a drawing note.
Syntax
DELETE_DRW_NOTE refNote<:in>
Arguments

refNote
Reference to an existing drawing note.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
SEARCH_MDL_REF refDrw DRAWING_NOTE 0 refNote
DELETE_DRW_NOTE refNote
§
ERASE_DRW_NOTE
Erases a drawing note.
Syntax
ERASE_DRW_NOTE refNote<:in>
Arguments

refNote
Reference to an existing drawing note.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
SEARCH_MDL_REF refDrw DRAWING_NOTE 0 refNote
ERASE_DRW_NOTE refNote
§
CREATE_DRW_NOTE_EX
Creates a note on a drawing.
Syntax
CREATE_DRW_NOTE_EX refDrw<:in> note_option ref_note<:out>
Arguments

refDrw
Reference to an existing drawing.

note_option
Structure variable of type NOTE_OPTION which contains the definition
of the note placement and its leaders.

ref_note
Name for the reference to the created note.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
In case notes are placed with placement_type ON_ITEM and the
placement_ref is an edge which was searched, the exact position can
either be determined by using SET_REF_POS or by specifying the
placement_pos.
For leaders to searched edge references it is the same situation. In
case SET_REF_POS is used for the selection the exact position on the
edge can be specified. For searched edge references also the specific
drawing view can be set by SET_DRW_REF_VIEW.
Example
SEARCH_DRW_VIEW drw "main_view" "*" view_main
SEARCH_DRW_VIEW drw "left_view" "*" view_left

DECLARE_STRUCT NOTE_OPTION note_option


note_option.view = view_main
note_option.placement_pos.x = 60
note_option.placement_pos.y = 180

note_option.text = "leader_note"
note_option.placement_type = "WITH_LEADER"

GET_DRW_VIEW_MDL view_main mdl

! search the references for the leaders


SEARCH_MDL_REF mdl EDGE "EDGE_TOP" edgeTop
SEARCH_MDL_REF mdl EDGE "EDGE_LEFT" edgeLeft

! use SET_REF_POS to indicate the edge position in model coordinates


DECLARE_STRUCT POINT pntEdgeLeft
pntEdgeLeft.x = 0
pntEdgeLeft.y = 0
pntEdgeLeft.z = 25
SET_REF_POS NULL edgeLeft pntEdgeLeft

DECLARE_STRUCT POINT pntEdgeTop


pntEdgeTop.x = 25
pntEdgeTop.y = 0
pntEdgeTop.z = 0
SET_REF_POS NULL edgeTop pntEdgeTop

! use SET_REF_VIEW to indicate which view should be used for the edge
reference
SET_DRW_REF_VIEW edgeLeft view_left
SET_DRW_REF_VIEW edgeTop view_main

DECLARE_STRUCT ATTACH_LEADER leader


leader.placement_ref = edgeLeft
leader.placement_type = "ON_ENTITY"
leader.arrow_type = DOT

ADD_ARRAY_ELEM note_option.array_leaders leader

DECLARE_STRUCT ATTACH_LEADER leader


leader.placement_ref = edgeTop
leader.placement_type = "ON_ENTITY"
leader.arrow_type = CROSS

ADD_ARRAY_ELEM note_option.array_leaders leader

DECLARE_STRUCT ATTACH_LEADER leader


leader.placement_pos.x = 40
leader.placement_pos.x = 50
leader.placement_type = "FREE"
leader.arrow_type = BOX

ADD_ARRAY_ELEM note_option.array_leaders leader

CREATE_DRW_NOTE_EX drw note_option note


§
READ_DRW_NOTE_EX
Reads the information from an existing note on a drawing.
Syntax
READ_DRW_NOTE_EX refNote<:in> note_option<:out>
Arguments

refNote
Reference to the note.

note_option
Name of the structure variable of type NOTE_OPTION which should
retrieve the note information.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
READ_DRW_NOTE_EX note note_option

PRINT "type: %" note_option.placement_type


PRINT "type: %/%/%" note_option.placement_pos.x \
note_option.placement_pos.y \
note_option.placement_pos.z

FOR leader REF ARRAY note_option.array_leaders


PRINT "--- LEADER ---"
PRINT "leader_type: %" leader.placement_type

IF leader.placement_type == "ON_ENTITY"
PRINT "leader_ref: %" leader.placement_ref
GET_REF_POS NULL leader.placement_ref pos
PRINT "leader_ref_pos: %/%/%" pos.x pos.y pos.z

ELSE_IF leader.placement_type == "FREE"


PRINT "leader pos: %/%/%" leader.placement_pos.x
leader.placement_pos.y leader.placement_pos.z
END_IF

PRINT "leader arrow: %" leader.arrow_type


END_FOR

PRINT "--- content ---"


PRINT "text: %" note_option.text
PRINT "height: %" note_option.text_style.height
PRINT "thickness: %" note_option.text_style.thickness
PRINT "width_factor: %" note_option.text_style.width_factor
PRINT "slant_angle: %" note_option.text_style.slant_angle
PRINT "underline: %" note_option.text_style.underline
PRINT "horz_justification: %"
note_option.text_style.horz_justification
PRINT "vert_justification: %"
note_option.text_style.vert_justification
PRINT "angle: %" note_option.text_style.angle
IF note_option.text_style.color.by_name == TRUE
PRINT "color: %" note_option.text_style.color.color_name
ELSE
PRINT "color: %/%/%" note_option.text_style.color.color_rgb.red \
note_option.text_style.color.color_rgb.green \
note_option.text_style.color.color_rgb.blue
END_IF

PRINT "mirror: %" note_option.text_style.mirror


PRINT "font: %" note_option.text_style.font
FOR note_line REF ARRAY note_option.array_note_lines
PRINT "--- NOTE_LINE ----"

FOR note_text REF ARRAY note_line.array_note_texts


PRINT "--- NOTE_TEXT ---"

PRINT "text: %" note_text.text


PRINT "height: %" note_text.text_style.height
PRINT "thickness: %" note_text.text_style.thickness
PRINT "width_factor: %" note_text.text_style.width_factor
PRINT "slant_angle: %" note_text.text_style.slant_angle
PRINT "underline: %" note_text.text_style.underline
PRINT "horz_justification: %"
note_text.text_style.horz_justification
PRINT "vert_justification: %"
note_text.text_style.vert_justification
PRINT "angle: %" note_text.text_style.angle

IF note_text.text_style.color.by_name == TRUE
PRINT "color: %" note_text.text_style.color.color_name
ELSE
PRINT "color: %/%/%"
note_text.text_style.color.color_rgb.red \
note_text.text_style.color.color_rgb.green \
note_text.text_style.color.color_rgb.blue
END_IF

PRINT "mirror: %" note_text.text_style.mirror


PRINT "font: %" note_text.text_style.font
END_FOR

END_FOR
§
MODIFY_DRW_NOTE_EX
Modifies an existing note on a drawing.
Syntax
MODIFY_DRW_NOTE_EX refNote<:in> note_option<:in>
Arguments

refNote
Reference to the note.

note_option
Structure variable of type NOTE_OPTION which contains the note
information.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.

Note
It is not possible to relocated system notes like the scale or notes
which are shown in the drawing and link to the solid node (e.g. "
{0:&Note_1}").
Example
USER_SELECT DRAWING_NOTE note
READ_DRW_NOTE_EX note note_option

DECLARE_ARRAY arrayNoteLines

FOR note_line REF ARRAY note_option.array_note_lines


DECLARE_STRUCT NOTE_LINE new_note_line

FOR note_text REF ARRAY note_line.array_note_texts

DECLARE_STRUCT NOTE_TEXT new_note_text


new_note_text = note_text
new_note_text.text_style.slant_angle = 15

ADD_ARRAY_ELEM new_note_line.array_note_texts new_note_text


END_FOR

ADD_ARRAY_ELEM arrayNoteLines new_note_line

END_FOR

note_option.array_note_lines = arrayNoteLines
MODIFY_DRW_NOTE_EX note note_option
§
GET_DRW_NOTE_TEXT
Retrieves the text from an existing drawing note.
Syntax
GET_DRW_NOTE_TEXT [options] refNote<:in> noteText<:out>
Arguments

options
The following options are supported:
SYMBOLIC_MODE valueBOOL — determines if the symbol should be shown
rather than the value. Default is FALSE.

refNote
Reference to an existing note.

noteText
Parameter which will receive the note text.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
SEARCH_MDL_REF refDrw DRAWING_NOTE 0 refNote
GET_DRW_NOTE_TEXT refNote noteText
PRINT "Note text: %" noteText
§
SET_DRW_NOTE_TEXT
Sets the text of an existing drawing note.
Syntax
SET_DRW_NOTE_TEXT refNote<:in> "text"
Arguments

refNote
Reference to an existing note.

text
This is the note text which should be created. Any string expression
is allowed.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case of a leading ampersand &, the following text is regarded as a
variable which was searched via SEARCH_FEAT_PARAM or
SEARCH_MDL_PARAM. Use :FID in case of a feature parameter to indicate
the location of the feature id.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
SEARCH_MDL_REF refDrw DRAWING_NOTE 0 refNote
! set multi lines
SET_DRW_NOTE_TEXT refNote "line1'\n'line2'\n'line3'\n'line4"
! set content of feature parameter
SEARCH_FEAT_PARAM featureWithParam "sample_param" featParam
SET_DRW_NOTE_TEXT refNote "&featParam:FID"
§
GET_DRW_NOTE_TEXT_HEIGHT
Retrieves the text height from an existing drawing note.
Syntax
GET_DRW_NOTE_TEXT_HEIGHT refNote<:in> noteHeight<:out>
Arguments

refNote
Reference to an existing note.

noteHeight
Parameter which will receive the note height.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
SEARCH_MDL_REF refDrw DRAWING_NOTE 0 refNote
GET_DRW_NOTE_TEXT_HEIGHT refNote noteHeight
PRINT "Note height: %" noteHeight
§
SET_DRW_NOTE_TEXT_HEIGHT
Sets the text height of an existing drawing note.
Syntax
SET_DRW_NOTE_TEXT_HEIGHT refNote<:in> noteHeight INT
Arguments

refNote
Reference to an existing note.

noteHeight
Height of the note. Use a negative number to set the default height.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
If the note height is negative, the default note height will be used.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
SEARCH_MDL_REF refDrw DRAWING_NOTE 0 refNote
SET_DRW_NOTE_TEXT_HEIGHT refNote -1
§
GET_DRW_NOTE_TEXT_ALIGNMENT
Retrieves the horizontal and vertical alignment from an existing
drawing note.
Syntax
GET_DRW_NOTE_TEXT_ALIGNMENT refNote<:in> horzAlignment<:out>
vertAlignment<:out>
Arguments

refNote
Reference to an existing note.

horzAlignmentt
Parameter which will receive the horizontal alignment of the note.
Valid horizontal alignments are:
LEFT
CENTER
RIGHT

vertAlignment
Parameter which will receive the vertical alignment of the note.
Valid vertical alignments are:
TOP
MIDDLE
BOTTOM
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
SEARCH_MDL_REF refDrw DRAWING_NOTE 0 refNote
GET_DRW_NOTE_TEXT_ALIGNMENT refNote horzAlignment vertAlignment
PRINT "Note alignment horz: % vert: %" horzAlignment vertAlignment
§
SET_DRW_NOTE_TEXT_ALIGNMENT
Sets the horizontal and vertical alignment of an existing drawing
note.
Syntax
SET_DRW_NOTE_TEXT_ALIGNMENT refNote<:in> horzAlignment vertAlignment
Arguments

refNote
Reference to an existing note.

horzAlignment
Horizontal alignment. Valid arguments are:
LEFT
CENTER
RIGHT

vertAlignment
Vertical Alignment. Valid arguments are:
TOP
MIDDLE
BOTTOM
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
SEARCH_MDL_REF refDrw DRAWING_NOTE 0 refNote
SET_DRW_NOTE_TEXT_ALIGNMENT refNote CENTER TOP
§
GET_DRW_NOTE_TEXT_FONT
Retrieves the text font from an existing drawing note.
Syntax
GET_DRW_NOTE_TEXT_FONT refNote<:in> noteFont<:out>
Arguments

refNote
Reference to an existing note.

noteFont
Parameter which will receive the note font.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
SEARCH_MDL_REF refDrw DRAWING_NOTE 0 refNote
GET_DRW_NOTE_TEXT_FONT refNote noteFont
PRINT "Note font: %" noteFont
§
SET_DRW_NOTE_TEXT_FONT
Sets the text font of an existing drawing note.
Syntax
SET_DRW_NOTE_TEXT_FONT refNote<:in> "fontname"
Arguments

refNote
Reference to an existing note.

fontname
Name of the font which should be applied. Any string expression is
allowed. Information about fonts is available in the Specify Fonts
section.
Error handling
The program execution will be canceled if the reference to the note
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrw
SEARCH_MDL_REF refDrw DRAWING_NOTE 0 refNote
SET_DRW_NOTE_TEXT_FONT refNote "cgtime"
§
GET_DRW_NOTE_POS
Retrieves the position of a drawing note.
Syntax
GET_DRW_NOTE_POS refNote<:in> paramX<:out> paramY<:out>
Arguments

refNote
Reference to an existing drawing note.

paramX
Parameter which receives the x coordinate of the note position.

paramY
Parameter which receives the y coordinate of the note position.
Error handling
The program execution will be canceled if the reference to the
drawing note does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_NOTE refNote
GET_DRW_NOTE_POS refNote posX posY
PRINT "location: % %" posX posY
§
SET_DRW_NOTE_POS
Modifies the position of a drawing note.
Syntax
SET_DRW_NOTE_POS refNote<:in> posX DOUBLE posY DOUBLE
Arguments

refNote
Reference to an existing drawing note.

posX
Placement position of the view in X direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

posY
Placement position of the view in Y direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.
Error handling
The program execution will be canceled if the reference to the
drawing note does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
It is not possible to relocated system notes like the scale or notes
which are shown in the drawing and link to the solid node (e.g. "
{0:&Note_1}").
Example
USER_SELECT DRAWING_NOTE refNote
SET_DRW_NOTE_POS refNote 10 10
§
GET_DRW_NOTE_ANGLE
Retrieves the angle of a drawing note.
Syntax
GET_DRW_NOTE_ANGLE refNote<:in> angle<:out>
Arguments

refNote
Reference to an existing drawing note.

angle
Name of the double variable which receives the angle of the note. The
value is in the range [0-360) degree.
Error handling
The program execution will be canceled if the reference to the
drawing note does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_NOTE refNote
GET_DRW_NOTE_ANGLE refNote angle
PRINT "angle: %" angle
§
SET_DRW_NOTE_ANGLE
Modifies the angle of a drawing note.
Syntax
SET_DRW_NOTE_ANGLE refNote<:in> angle DOUBLE
Arguments

refNote
Reference to an existing drawing note.

angle
Angle in the range [0-360) degree. Any math expression is allowed.
Error handling
The program execution will be canceled if the reference to the
drawing note does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_NOTE refNote
SET_DRW_NOTE_ANGLE refNote 90
§
GET_DRW_NOTE_OWNER
Retrieves information about the owner of a note. This can be a table,
a cross section or the drawing.
Syntax
GET_DRW_NOTE_OWNER refNote<:in> param_owner<:out>
Arguments

refNote
Reference to an existing drawing note.

param_owner
Parameter which receives the x coordinate of the note position.
Valid owners are:
DRAWING — for normal notes.
TABLE — for notes in a table cell.
XSEC — for notes of a cross section.
Error handling
The program execution will be canceled if the reference to the
drawing note does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_NOTE refNote
GET_DRW_NOTE_OWNER refNote owner
PRINT "owner: %" owner
§
MOVE_DRW_NOTE_TO_VIEW
Moves a drawing note to a specified view.
Syntax
MOVE_DRW_NOTE_TO_VIEW refNote<:in> refView<:in>
Arguments

refNote
Reference to an existing note.

refView
Reference to an existing drawing view.
Error handling
The program execution will be canceled if the reference to the note
or to the view do not exist or if the note can't be moved, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_NOTE note
USER_SELECT DRAWING_VIEW view
MOVE_DRW_NOTE_TO_VIEW note view
§
ADD_DRW_NOTE_LEADER
Adds one leader or an array of leaders to a drawing note.
Syntax
ADD_DRW_NOTE_LEADER refNote<:in> refLeader<:in> | arrayLeaders<:in>
Arguments

refNote
Reference to an existing note.

refLeader | arrayLeaders
Reference or array or references to geometric entities which could be
used as a leader.
Error handling
The program execution will be canceled if the reference to the note
or to the leaders do not exist or if the leaders could not be set,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW THIS "TOP" 1 viewTop
SEARCH_DRW_VIEW THIS "BACK" 1 viewBack

GET_DRW_VIEW_MDL viewTop mdl

SEARCH_MDL_REF mdl EDGE "ATTACH_EDGE" attachEdge

! sets the back view for the edge reference


SET_DRW_REF_VIEW attachEdge viewBack
ADD_DRW_NOTE_LEADER note attachEdge

! sets the top view for the edge reference


SET_DRW_REF_VIEW attachEdge viewTop
ADD_DRW_NOTE_LEADER note attachEdge
§
SET_DRW_NOTE_LEADER
Sets one leader or an array of leaders for a drawing note.
Syntax
SET_DRW_NOTE_LEADER refNote<:in> refLeader<:in> | arrayLeaders<:in>
Arguments

refNote
Reference to an existing note.

refLeader | arrayLeaders
Reference or array or references to geometric entities which could be
used as a leader.
Error handling
The program execution will be canceled if the reference to the note
or to the leaders do not exist or if the leaders could not be set,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW THIS "TOP" 1 viewTop
SEARCH_DRW_VIEW THIS "BACK" 1 viewBack

GET_DRW_VIEW_MDL viewTop mdl

SEARCH_MDL_REF mdl EDGE "ATTACH_EDGE" attachEdge

DECLARE_ARRAY arrayLeaders

! sets the back view for the edge reference


SET_DRW_REF_VIEW attachEdge viewBack
ADD_ARRAY_ELEM attachEdge

! sets the top view for the edge reference


SET_DRW_REF_VIEW attachEdge viewTop
ADD_ARRAY_ELEM attachEdge

SET_DRW_NOTE_LEADER note arrayLeaders


About Commands for Drawing Tables
Commands to create drawing symbols, search for them or to retrieve
their properties.
The following commands are available:
CREATE_DRW_SYMBOL — to create a symbol on the drawing.
CREATE_DRW_SYMBOL_EX — extended version of the command to create a
symbol on the drawing.
CREATE_DRW_VIEW_SYMBOL — to create a symbol in a drawing view.
CREATE_DRW_VIEW_SYMBOL_EX — extended version of the command to
create a symbol in a drawing view.
DELETE_DRW_SYMBOL — to delete a symbol from a drawing.
SEARCH_DRW_SYMBOLS — to search for drawing symbols.
SEARCH_DRW_SYMBOL_VAR_TEXT — to search for the variable text of a
symbol.
GET_DRW_SYMBOL_VAR_TEXT — to retrieve the variable text of a symbol
by its name.
SET_DRW_SYMBOL_VAR_TEXT — to set the variable text of a symbol by
its name.
SEARCH_DRW_SYMBOL_VAR_TEXT_NAMES — to search the names of variable
texts in a symbol.
SEARCH_DRW_SYMBOL_GROUP_NAMES — to search for the names of groups
in a symbol.
GET_DRW_SYMBOL_GROUP_SHOWN — to examine if a symbol group is
visible or not.
SET_DRW_SYMBOL_GROUP_SHOWN — to set a symbol group visible or none
visible.
GET_DRW_SYMBOL_GROUP_EXCLUSIVE — to examine if a symbol group is
exclusive or not.
GET_DRW_SYMBOL_POS — to retrieve the position of a symbol.
SET_DRW_SYMBOL_POS — to modify the position of a drawing symbol.
GET_DRW_SYMBOL_NAME — to retrieve the name of a symbol.
PROBE_DRW_SYMBOL_LEGACY — to Identify legacy drawing symbols from
earlier Pro/ENGINEER versions.
MOVE_DRW_SYMBOL_TO_VIEW — to move a drawing symbol to a specified
view.
ADD_DRW_SYMBOL_LEADER — to add one leader or an array of leaders to
a drawing symbol.
SET_DRW_SYMBOL_LEADER — to set one leader or an array of leaders
for a drawing symbol.
PURGE_UNUSED_DRW_SYMBOLS — to purge unused symbols from a drawing.
UPDATE_ALL_DRW_SYMBOLS — to update all symbols on a drawing.
§
CREATE_DRW_SYMBOL
Creates a drawing symbol by use of a drawing symbol file.
Syntax
CREATE_DRW_SYMBOL refDrawing<:in> sheet INT "symbol_file" posX posY
[options] [ref_symbol<:out>]
SYMBOL_CONSTRAINT1
SYMBOL_CONSTRAINT2
...
END_CREATE_DRW_SYMBOL
Arguments

refDrawing
Reference to an existing drawing

sheet
Sheet number of the drawing. First sheet has the number 1.

symbol_file
Name and path of the symbol file. According to the path specification
it could be in library or in working directory. In case no path is
specified the search order is working directory, current library
directory and PRO_SYMBOL_DIR.

posX
Location in x direction.

posY
Location in y direction.

options
WITH_LEADER ref<:in>
Sets the geometric reference as leader.
COPY_SYMBOL
Copies the symbol definition even if a definition of the same name
is already available. This option enables to use different symbol
definitions of the same name. This is important if different
versions of the same symbol should be supported.

HEIGHT valueDOUBLE
Adjusts the height of a symbol.

ANGLE valueDOUBLE
Places the symbol rotated by an angle.

ref_symbol
Optional name for reference to the created symbol.

constraint
VAR_TEXT 'name' "value"
Specify variable text element by string value.
SHOW_GROUP "path"
Shows a group in the symbol. In case of using nested groups use '\'
as sub path delimiter.
Example
CREATE_DRW_SYMBOL refDrw 1 lib:sample 100 0 COPY_SYMBOL
VAR_TEXT CITY Erlangen
VAR_TEXT COUNTRY Germany
VAR_TEXT ADDRESS "Weisse-Herz Str 2a"
VAR_TEXT COMPANY "BuW Software"
SHOW_GROUP ADDRESS
SHOW_GROUP ADDRESSEE\COMPANY
END_CREATE_DRW_SYMBOL
§
CREATE_DRW_SYMBOL_EX
Creates a drawing symbol by use of a drawing symbol file.
Syntax
CREATE_DRW_SYMBOL_EX refDrawing<:in> sheet INT "symbol_file"
symbol_option [ref_symbol<:out>]
SYMBOL_CONSTRAINT1
SYMBOL_CONSTRAINT2
...
END_CREATE_DRW_SYMBOL_EX
Arguments

refDrawing
Reference to an existing drawing

sheet
Sheet number of the drawing. First sheet has the number 1.

symbol_file
Name and path of the symbol file. According to the path specification
it could be in library or in working directory. In case no path is
specified the search order is working directory, current library
directory and PRO_SYMBOL_DIR. In case the symbol_file contains an
empty string the member variable path of SYMBOL_OPTION is used
instead.

posX
Location in x direction.

posY
Location in y direction.

symbol_option
Structure variable of type SYMBOL_OPTION which contains the
definition of the symbol placement and its leaders.

ref_symbol
Optional name for reference to the created symbol.

constraint
VAR_TEXT 'name' "value"
Specify variable text element by string value.
SHOW_GROUP "path"
Shows a group in the symbol. In case of using nested groups use '\'
as sub path delimiter.
Example
DECLARE_STRUCT SYMBOL_OPTION symbol_option
symbol_option.placement_type = "FREE"
symbol_option.placement_pos.x = 100
symbol_option.placement_pos.y = 0
symbol_option.height = 20.0
symbol_option.angle = 10.0
symbol_option.copy_symbol = TRUE

CREATE_DRW_SYMBOL_EX refDrw 1 lib:sample symbol_option


VAR_TEXT CITY Erlangen
VAR_TEXT COUNTRY Germany
VAR_TEXT ADDRESS "Weisse-Herz Str 2a"
VAR_TEXT COMPANY "BuW Software"
SHOW_GROUP ADDRESS
SHOW_GROUP ADDRESSEE\COMPANY
END_CREATE_DRW_SYMBOL_EX
§
CREATE_DRW_VIEW_SYMBOL
Creates a drawing symbol for a specific view by use of a drawing
symbol file.
Syntax
CREATE_DRW_VIEW_SYMBOL refView<:in> "symbol_file" posX posY [options]
[ref_symbol<:out>]
SYMBOL_CONSTRAINT1
SYMBOL_CONSTRAINT2
...
END_CREATE_DRW_VIEW_SYMBOL
Arguments

refView
Reference to an existing drawing view.

symbol_file
Name and path of the symbol file. According to the path specification
it could be in library or in working directory. In case no path is
specified the search order is working directory, current library
directory and PRO_SYMBOL_DIR.

posX
Location in x direction.

posY
Location in y direction.

options
WITH_LEADER ref<:in>
Sets the geometric reference as leader.
ON_ENTITY ref_pnt<:in>
Places the symbol on a reference point or a drawing view axis (use
GET_DRW_VIEW_AXIS for this). If this option is used, the x and y
placement setting will be neglected.
NORM_ENTITY ref<:in>
Places the symbol on a reference. If this option is used, the x and
y placement setting will be neglected.
OFFSET ref_dim<:in>
Places the symbol offset to a dimensions. This option requires
Wildfire 4 and above.
COPY_SYMBOL
Copies the symbol definition even if a definition of the same name
is already available. This option enables to use different symbol
definitions of the same name. This is important if different
versions of the same symbol should be supported.

HEIGHT valueDOUBLE
Adjusts the height of a symbol.
ANGLE valueDOUBLE
Places the symbol rotated by an angle.

ref_symbol
Optional name for reference to the created symbol.
SYMBOL_CONTRAINT
VAR_TEXT 'name' "value"
Specify variable text element by string value.
SHOW_GROUP "path"
Shows a group in the symbol. In case of using nested groups use '\'
as sub path delimiter.
Note
The command does not work for "Model Units" due to limitations in
Creo/TOOLKIT.
Example
CREATE_DRW_VIEW_SYMBOL refDrwView lib:sample 100 0 WITH_LEADER refPnt
VAR_TEXT CITY Erlangen
VAR_TEXT COUNTRY Germany
VAR_TEXT ADDRESS "Weisse-Herz Str 2a"
VAR_TEXT COMPANY "BuW Software"
SHOW_GROUP ADDRESS
SHOW_GROUP ADDRESSEE\COMPANY
END_CREATE_DRW_VIEW_SYMBOL
§
CREATE_DRW_VIEW_SYMBOL_EX
Creates a drawing symbol for a specific view by use of a drawing
symbol file.
Syntax
CREATE_DRW_VIEW_SYMBOL_EX refView<:in> "symbol_file" symbol_option
[ref_symbol<:out>]
SYMBOL_CONSTRAINT1
SYMBOL_CONSTRAINT2
...
END_CREATE_DRW_VIEW_SYMBOL_EX
Arguments

refView
Reference to an existing drawing view.

symbol_file
Name and path of the symbol file. According to the path specification
it could be in library or in working directory. In case no path is
specified the search order is working directory, current library
directory and PRO_SYMBOL_DIR. In case the symbol_file contains an
empty string the member variable path of SYMBOL_OPTION is used
instead.

posX
Location in x direction.

posY
Location in y direction.

symbol_option
Structure variable of type SYMBOL_OPTION which contains the
definition of the symbol placement and its leaders.

ref_symbol
Optional name for reference to the created symbol.
SYMBOL_CONTRAINT
VAR_TEXT 'name' "value"
Specify variable text element by string value.
SHOW_GROUP "path"
Shows a group in the symbol. In case of using nested groups use '\'
as sub path delimiter.
Note
he command does not work for "Model Units" due to limitations in
Creo/TOOLKIT.
Example
DECLARE_STRUCT SYMBOL_OPTION symbol_option
symbol_option.placement_type = "FREE"
symbol_option.placement_pos.x = 100
symbol_option.placement_pos.y = 0
symbol_option.height = 20.0
symbol_option.angle = 10.0
symbol_option.copy_symbol = TRUE

DECLARE_STRUCT ATTACH_LEADER attachLeader1


attachLeader1.placement_type = "FREE"
attachLeader1.placement_pos.x = 10
attachLeader1.placement_pos.y = 10
ADD_ARRAY_ELEM symbol_option.array_leaders attachLeader1

DECLARE_STRUCT ATTACH_LEADER attachLeader2


attachLeader2.placement_type = "ON_ENTITY"
attachLeader2.placement_ref = refPnt
ADD_ARRAY_ELEM symbol_option.array_leaders attachLeader2

CREATE_DRW_VIEW_SYMBOL_EX view lib:sample symbol_option


VAR_TEXT CITY Erlangen
VAR_TEXT COUNTRY Germany
VAR_TEXT ADDRESS "Weisse-Herz Str 2a"
VAR_TEXT COMPANY "BuW Software"
SHOW_GROUP ADDRESS
SHOW_GROUP ADDRESSEE\COMPANY
END_CREATE_DRW_VIEW_SYMBOL_EX
§
DELETE_DRW_SYMBOL
Deletes a drawing symbol.
Syntax
DELETE_DRW_SYMBOL refSymbol<:in>
Arguments

refSymbol
Reference to an existing drawing symbol.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS refDrw DRAWING_SYMBOL "*" allSymbols
FOR symbol REF ARRAY allSymbols
DELETE_DRW_SYMBOL symbol
END_FOR
§
SEARCH_DRW_SYMBOLS
Searches for drawing symbols. Name and sheet number can be specified
or wild cards can be used for them.
Syntax
SEARCH_DRW_SYMBOLS refDrawing<:in> "name" sheetINT
array_symbols<:out>
Arguments

refDrawing
Reference to an existing drawing.

name
This is the Creo Elements/Pro name of the symbol to search for. the
Any string expression is allowed. The view name could also be
specified by the use of wildcards.

sheet
Sheet number of the drawing. First sheet has the number 1. Any math
expression is allowed. An asterisk '*' as sheet number means, that
the whole drawing is searched for the symbol.

array_symbols
Array to receive the references to all found symbols.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Welding symbols are not found by this command. Use the
SEARCH_DRW_WELD_SYMBOLS for this task.
Example
SEARCH_DRW_SYMBOLS refDrw "SAMPLE" "*" arraySymbols
§
SEARCH_DRW_SYMBOL_VAR_TEXT
Searches the variable text of a symbol for a specific entry and
retrieve its value.
Syntax
SEARCH_DRW_SYMBOL_VAR_TEXT refSymbol<:in> "name" paramValue<:out>
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the variable text entry in the symbol to search for. the Any
string expression is allowed.

paramValue
String Parameter which will receive the width of the drawing.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist or if the variable text was not found, unless errors
are handled by BEGIN_CATCH_ERROR.
Note
The value parameter is always in string format, even if the content
is defined as double or integer in Creo Elements/Pro.
Example
USER_SELECT DRAWING_SYMBOL refSymbol
SEARCH_DRW_SYMBOL_VAR_TEXT refSymbol "name" paramName
§
GET_DRW_SYMBOL_VAR_TEXT
Retrieves the variable text of a drawing symbol by its name.
Syntax
GET_DRW_SYMBOL_VAR_TEXT refSymbol<:in> "name" text<:out>
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the variable text entry in the symbol.

text
Name of the string variable which will receive the variable text
content.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist or if the string could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
The variable text is always in string format, even if the content is
defined as double or integer in Creo Parametric.
Example
USER_SELECT DRAWING_SYMBOL symbol

SEARCH_DRW_SYMBOL_VAR_TEXT_NAMES symbol "*" allVarTexts

FOR varText REF ARRAY allVarTexts


GET_DRW_SYMBOL_VAR_TEXT symbol varText text
PRINT "%: %" varText text
END_FOR
§
SET_DRW_SYMBOL_VAR_TEXT
Sets the variable text of a drawing symbol by its name.
Syntax
SET_DRW_SYMBOL_VAR_TEXT refSymbol<:in> "name" "text"
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the variable text entry in the symbol.

text
String which should be assigned to the variable text.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist or if the string could not be assigned, unless errors
are handled by BEGIN_CATCH_ERROR.
Note
The value parameter is always in string format, even if the content
is defined as double or integer in Creo Elements/Pro.
Example
USER_SELECT DRAWING_SYMBOL refSymbol
SET_DRW_SYMBOL_VAR_TEXT refSymbol "name" "This is a text"
§
SEARCH_DRW_SYMBOL_VAR_TEXT_NAMES
Searches the names of variable texts in a symbol.
Syntax
SEARCH_DRW_SYMBOL_VAR_TEXT_NAMES refSymbol<:in> "filter"
arrayVarTextNames<:out>
Arguments

refSymbol
Reference to an existing symbol.

filter
Filter which text names should be searched. Use an ampersand '*' to
search for all names.

arrayVarTetNames
Name of the array which will receive the found var text names.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_SYMBOL refSymbol
SEARCH_DRW_SYMBOL_VAR_TEXT_NAMES refSymbol "*" arrayAllVarTextNames
FOR varTextName REF ARRAY arrayAllVarTextNames
SET_DRW_SYMBOL_VAR_TEXT refSymbol varTextName "text line"
END_FOR
§
SEARCH_DRW_SYMBOL_GROUP_NAMES
Searches the names of groups in a symbol.
Syntax
SEARCH_DRW_SYMBOL_GROUP_NAMES refSymbol<:in> "filter"
arrayGroupNames<:out>
Arguments

refSymbol
Reference to an existing symbol.

filter
Filter which text names should be searched. Use an ampersand '*' to
search for all names.

arrayGroupNames
Name of the array which will receive the found group names.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_SYMBOL symbol
SEARCH_DRW_SYMBOL_GROUP_NAMES symbol "*" names
FOR name REF ARRAY names
GET_DRW_SYMBOL_GROUP_EXCLUSIVE symbol name exclusive
GET_DRW_SYMBOL_GROUP_SHOWN symbol name visible
PRINT "% % %" name exclusive visible
END_FOR
§
GET_DRW_SYMBOL_GROUP_SHOWN
Examines if a symbol group is visible or not.
Syntax
GET_DRW_SYMBOL_GROUP_SHOWN refSymbol<:in> "name" visible<:out>
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the group

visible
Name of the boolean parameter which receives the information if the
group is visible.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_SYMBOL symbol
SEARCH_DRW_SYMBOL_GROUP_NAMES symbol "*" names
FOR name REF ARRAY names
GET_DRW_SYMBOL_GROUP_EXCLUSIVE symbol name exclusive
GET_DRW_SYMBOL_GROUP_SHOWN symbol name visible
PRINT "% % %" name exclusive visible
END_FOR
§
SET_DRW_SYMBOL_GROUP_SHOWN
Sets a symbol group visible or not visible.
Syntax
SET_DRW_SYMBOL_GROUP_SHOWN refSymbol<:in> "name" visibleBOOL
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the group

visible
The boolean parameter determines if the group is shown or not.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_SYMBOL symbol
SEARCH_DRW_SYMBOL_GROUP_NAMES symbol "*" names
FOR name REF ARRAY names
SET_DRW_SYMBOL_GROUP_EXCLUSIVE symbol name TRUE
END_FOR
§
GET_DRW_SYMBOL_GROUP_EXCLUSIVE
Examines if a symbol group is exclusive or independent.
Syntax
GET_DRW_SYMBOL_GROUP_EXCLUSIVE refSymbol<:in> "name" exclusive<:out>
Arguments

refSymbol
Reference to an existing symbol.

name
Name of the group

exclusive
Name of the boolean parameter which receives the information if the
group is exclusive.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_SYMBOL symbol
SEARCH_DRW_SYMBOL_GROUP_NAMES symbol "*" names
FOR name REF ARRAY names
GET_DRW_SYMBOL_GROUP_EXCLUSIVE symbol name exclusive
GET_DRW_SYMBOL_GROUP_SHOWN symbol name shown
PRINT "% % %" name exclusive shown
END_FOR
§
GET_DRW_SYMBOL_POS
Retrieves the position of a drawing symbol.
Syntax
GET_DRW_SYMBOL_POS refSymbol<:in> paramX<:out> paramY<:out>
Arguments

refSymbol
Reference to an existing symbol.

paramX
Parameter which receives the x coordinate of the symbol position.

paramY
Parameter which receives the y coordinate of the symbol position.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_SYMBOL refSymbol
GET_DRW_SYMBOL_POS refSymbol posX posY
PRINT "location: % %" posX posY
§
SET_DRW_SYMBOL_POS
Modifies the position of a drawing symbol.
Syntax
SET_DRW_SYMBOL_POS refSymbol<:in> posXDOUBLE posYDOUBLE
Arguments

refSymbol
Reference to an existing symbol.

posX
Placement position of the view in X direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.

posY
Placement position of the view in Y direction regarding the lower
left corner of the drawing sheet. Any math expression is allowed.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_SYMBOL refSymbol
SET_DRW_SYMBOL_POS refSymbol 0 0
§
GET_DRW_SYMBOL_NAME
Retrieves the name of a drawing symbol.
Syntax
GET_DRW_SYMBOL_NAME refSymbol<:in> paramName<:out>
Arguments

refSymbol
Reference to an existing symbol.

paramName
Parameter which receives the name information of the drawing symbol.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT DRAWING_SYMBOL refSymbol
GET_DRW_SYMBOL_NAME refSymbol name
PRINT "Symbol name: %" name
§
PROBE_DRW_SYMBOL_LEGACY
Identifies legacy drawing symbols from earlier Pro/ENGINEER versions
which are not displayed, but found by SEARCH_MDL_REF.
Syntax
PROBE_DRW_SYMBOL_LEGACY refSymbol<:in> paramLegacy<:out>
Arguments

refSymbol
Reference to an existing symbol.

paramLegacy
Boolean variable which receives the information if a symbols is a
legacy symbol.
Error handling
The program execution will be canceled if the reference to the symbol
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_SYMBOLS drw "*" * arraySymbols
FOR symbol REF ARRAY arraySymbols
PROBE_DRW_SYMBOL_LEGACY symbol legacy
IF legacy == TRUE
DELETE_DRW_SYMBOL symbol
END_IF
END_FOR
§
MOVE_DRW_SYMBOL_TO_VIEW
Moves a drawing symbol to a specified view.
Syntax
MOVE_DRW_SYMBOL_TO_VIEW refSymbol<:in> refView<:in>
Arguments

refSymbol
Reference to an existing symbol.

refView
Reference to an existing drawing view.
Error handling
The program execution will be canceled if the reference to the symbol
or to the view do not exist or if the symbol can't be moved, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
The functionality is limited to symbols which where created in the
drawings. Symbols which are created in the model and shown in the
drawing will fail.
Example
USER_SELECT DRAWING_SYMBOL symbol
USER_SELECT DRAWING_VIEW view
MOVE_DRW_SYMBOL_TO_VIEW symbol view
§
ADD_DRW_SYMBOL_LEADER
Adds one leader or an array of leaders to a drawing symbol.
Syntax
ADD_DRW_SYMBOL_LEADER refSymbol<:in> refLeader<:in> |
arrayLeaders<:in>
Arguments

refSymbol
Reference to an existing symbol.

refLeader | arrayLeaders
Reference or array or references to geometric entities which could be
used as a leader.
Error handling
The program execution will be canceled if the reference to the symbol
or to the leaders do not exist or if the leaders could not be set,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW THIS "TOP" 1 viewTop
SEARCH_DRW_VIEW THIS "BACK" 1 viewBack

GET_DRW_VIEW_MDL viewTop mdl

SEARCH_MDL_REF mdl EDGE "ATTACH_EDGE" attachEdge

! sets the back view for the edge reference


SET_DRW_REF_VIEW attachEdge viewBack
ADD_DRW_SYMBOL_LEADER symbol attachEdge

! sets the top view for the edge reference


SET_DRW_REF_VIEW attachEdge viewTop
ADD_DRW_SYMBOL_LEADER symbol attachEdge
§
SET_DRW_SYMBOL_LEADER
Sets one leader or an array of leaders for a drawing symbol.
Syntax
SET_DRW_SYMBOL_LEADER refSymbol<:in> refLeader<:in> |
arrayLeaders<:in>
Arguments

refSymbol
Reference to an existing Symbol.

refLeader | arrayLeaders
Reference or array or references to geometric entities which could be
used as a leader.
Error handling
The program execution will be canceled if the reference to the symbol
or to the leaders do not exist or if the leaders could not be set,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW THIS "TOP" 1 viewTop
SEARCH_DRW_VIEW THIS "BACK" 1 viewBack

GET_DRW_VIEW_MDL viewTop mdl

SEARCH_MDL_REF mdl EDGE "ATTACH_EDGE" attachEdge

DECLARE_ARRAY arrayLeaders

! sets the back view for the edge reference


SET_DRW_REF_VIEW attachEdge viewBack
ADD_ARRAY_ELEM attachEdge

! sets the top view for the edge reference


SET_DRW_REF_VIEW attachEdge viewTop
ADD_ARRAY_ELEM attachEdge

SET_DRW_SYMBOL_LEADER symbol arrayLeaders


§
PURGE_UNUSED_DRW_SYMBOLS
Purges drawing symbols which are not used on the drawing.
Syntax
PURGE_UNUSED_DRW_SYMBOLS refDrawing<:in>
Arguments

refDrawing
Reference to the drawing for which the symbols should be purged.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
PURGE_UNUSED_DRW_SYMBOLS drawing
§
UPDATE_ALL_DRW_SYMBOLS
Updates all drawing symbols to the latest version.
Syntax
UPDATE_ALL_DRW_SYMBOLS refDrawing<:in>
Arguments

refDrawing
Reference to the drawing for which the symbols should be updated.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
UPDATE_ALL_DRW_SYMBOLS drawing
UPDATE_DRW_VIEWS drawing 1
About Commands for Drawing Geometric Tolerances
The same commands as for solids also apply to drawing geometric
tolerances.
The following commands are available:
CREATE_GTOL — to create a new geometric tolerance.
READ_GTOL — to read the definition of a geometric tolerance from
the annotation.
MODIFY_GTOL — to modify a geometric tolerance.
DELETE_GTOL — to delete a geometric tolerance.
CREATE_GTOL_CREO4 — to create a new geometric tolerance with the
new functionality in Creo 4.0 and above.
READ_GTOL_CREO4 — to read the definition of a geometric tolerance
with the new functionality in Creo 4.0 and above.
MODIFY_GTOL_CREO4 — to modify a geometric tolerance with the new
functionality in Creo 4.0 and above.
GET_GTOL_TEXT — to read the text of a geometric tolerance.
SET_GTOL_TEXT — to set the text of a geometric tolerance.
About Commands for Drawing Items
Commands to search for drawing items on a view and to relate them to
another. Drawing items are drawing notes, symbols and drawing
entities.
The following commands are available:
SEARCH_DRW_ITEM — to search for one drawing item on a drawing view
by type and identifier.
SEARCH_DRW_ITEMS — to search for multiple drawing items on a
drawing view by type and identifier.
SET_DRW_ITEM_VIEW — to relate a drawing item to a drawing view.
SET_DRW_ITEMS_VIEW — to relate an array of drawing items to a
drawing view.
GET_DRW_ITEM_STATE — to determine the display state of a drawing
item.
§
SEARCH_DRW_ITEM
Searches for a drawing item by specifying view, sheet, identifier and
type.
Syntax
SEARCH_DRW_ITEM [options] refDrawing<:in> refDrwView<:in> sheetINT
type name refDrawingItem<:out>
Arguments

options
The following options are available:
SEARCH_METHOD "method" — The method must be either "SEARCH_BY_ID"
or "SEARCH_BY_NAME". Default is "SEARCH_BY_ID". Depending on the
method the search will either by applied for the drawing item id or
for its name.

refDrawing
Reference to the drawing on which the item should be searched.

refDrwView
Reference to an existing drawing view. Use NULL if you want to search
on any view including the background

sheet
Sheet number of the drawing starting with 1. Use an asterisk '*' to
search on any drawing sheet.

type
Type of the item which should be searched. Multiple types can be
concatenated by the pipe symbol '|'. The following types are
available:
DRAWING_ENTITY — for sketched entities on a drawing.
DRAWING_GTOL — for geometrical tolerances on a drawing.
DRAWING_NOTE — for drawing notes.
DRAWING_SYMBOL — tor drawing symbols.

name
In case the SEARCH_METHOD is "SEARCH_BY_ID" an integer or the
asterisk '*' is expected. Otherwise in case of "SEARCH_BY_NAME" a
name should be provided as string.

refDrawingItem
Name of the reference which will receive the drawing item reference.
Error handling
The program execution will be canceled if the reference to the
drawing or the drawing view does not exist or if the items was not
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! search a drawing entity on the background view of sheet number 1
SEARCH_MDL_REF PART DRAWING "drw" refDrawing
GET_BACKGROUND_VIEW refDrawing 1 backgroundView
SEARCH_DRW_ITEM refDrawing backgroundView * DRAWING_ENTITY * entity
§
SEARCH_DRW_ITEMS
Searches for an array of drawing items by specifying view, sheet,
identifier and type.
Syntax
SEARCH_DRW_ITEMS [options] refDrawing<:in> refDrwView<:in> sheetINT
type name arrayDrawingItems<:out>
Arguments

options
The following options are available:
SEARCH_METHOD "method" — The method must be either "SEARCH_BY_ID"
or "SEARCH_BY_NAME". Default is "SEARCH_BY_ID". Depending on the
method the search will either by applied for the drawing item id or
for its name.

refDrawing
Reference to the drawing on which the item should be searched.

refDrwView
Reference to an existing drawing view. Use NULL if you want to search
on any view including the background

sheet
Sheet number of the drawing starting with 1. Use an asterisk '*' to
search on any drawing sheet.

type
Type of the item which should be searched. Multiple types can be
concatenated by the pipe symbol '|'. The following types are
available:
DRAWING_ENTITY — for sketched entities on a drawing.
DRAWING_GTOL — for geometrical tolerances on a drawing.
DRAWING_NOTE — for drawing notes.
DRAWING_SYMBOL — tor drawing symbols.

name
In case the SEARCH_METHOD is "SEARCH_BY_ID" an integer or the
asterisk '*' is expected. Otherwise in case of "SEARCH_BY_NAME" a
name should be provided as string.

arrayDrawingItems
Name of the array which will receive the references of the drawing
items.
Error handling
The program execution will be canceled if the reference to the
drawing or the drawing view does not exist, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
! search all drawing items of sheet number 1
SEARCH_MDL_REF PART DRAWING "drw" refDrawing
SEARCH_DRW_ITEMS refDrawing NULL 1 DRAWING_ENTITY | DRAWING_NOTE |
DRAWING_SYMBOL * arrayDrawingItems
§
SET_DRW_ITEM_VIEW
Relates a drawing item to a specific view.
Syntax
SET_DRW_ITEM_VIEW refDrwItem<:in> refDrwView<:in>
Arguments

refDrwItem
Reference to an existing drawing item.

refDrwView
Reference to the drawing view to which the item should be related.
Error handling
The program execution will be canceled if the reference to the
drawing or to the drawing view does not exist, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
! Relates a drawing items of the first drawing sheet to the
background view.
SEARCH_MDL_REF PART DRAWING "drw" refDrawing
GET_BACKGROUND_VIEW refDrawing 1 backgroundView
SET_DRW_ITEM_VIEW refDrwItem backgroundView
§
SET_DRW_ITEMS_VIEW
Relates an array of drawing items to a specific view.
Syntax
SET_DRW_ITEMS_VIEW arrayDrwItems<:in> refDrwView<:in>
Arguments

arrayDrwItems
Reference to an existing drawing item.

refDrwView
Reference to the drawing view to which the item should be related.
Error handling
The program execution will be canceled if the reference to the
drawing or to the drawing view does not exist, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
! Relate all drawing items of the first drawing sheet to the
background view.
SEARCH_MDL_REF PART DRAWING "drw" refDrawing
SEARCH_DRW_ITEMS refDrawing NULL 1 DRAWING_ENTITY | DRAWING_NOTE |
DRAWING_SYMBOL * arrayDrawingItems
GET_BACKGROUND_VIEW refDrawing 1 backgroundView
SET_DRW_ITEMS_VIEW arrayDrawingItems backgroundView
§
GET_DRW_ITEM_STATE
Determines the display state of a drawing item.
Syntax
GET_DRW_ITEM_STATE refDrawing<:in> refItem<:in> state<:out>
Arguments

refDrawing
Reference to the drawing of the item.

refItem
Reference to the item.

state
Name of the boolean variable which indicates the display state of the
drawing item.
Error handling
The program execution will be canceled if the drawing or the item
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_ITEMS THIS NULL "*" DRAWING_NOTE "*" items
FOR item REF ARRAY items
GET_DRW_ITEM_STATE THIS item state
PRINT "%: %" item state
END_FOR
About Commands for Drawing Annotations
Commands which work an all kind of drawing annotations like:
dimensions, symbols, notes, geometrical tolerances, surface finishes
and set datum tags.
The following commands are available:
GET_DRW_ANNOTATION_VISIBILITY — to determine if a drawing
annotation is visible.
SHOW_DRW_ANNOTATION — to show an annotation on a drawing view.
ERASE_DRW_ANNOTATION — to erase an annotation on a drawing.
UNERASE_DRW_ANNOTATION — to display and erased annotation again.
GET_DRW_ANNOTATION_TEXT_STYLE — to retrieve the text style of a
drawing annotation.
SET_DRW_ANNOTATION_TEXT_STYLE — to set the text style for a drawing
annotation.
GET_DRW_ANNOTATION_POS — to retrieve the position of an annotation
on a drawing.
§
GET_DRW_ANNOTATION_VISIBILITY
Determines if a drawing annotation is visible.
Syntax
GET_DRW_ANNOTATION_VISIBILITY refDrawing<:in> refAnnotation<:in>
visibility<:out>
Arguments

drawing
Reference to an existing drawing.

refAnnotation
Reference to an existing drawing annotation.

visibility
Name of the boolean parameter which receives the visibility state.
Error handling
The program execution will be canceled if the reference to the
drawing or to the annotation do not exist, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
! determine visible dimensions for a drawing view
USER_SELECT DRAWING_VIEW view
SEARCH_DRW_VIEW_DIMS view "*" arrayDims
FOR dim REF ARRAY arrayDims
GET_DRW_ANNOTATION_VISIBILITY THIS dim visible

IF visible == TRUE
PRINT "%" dim
END_IF
END_FOR
§
SHOW_DRW_ANNOTATION
Shows a drawing annotation.
Syntax
SHOW_DRW_ANNOTATION refDrwView<:in> refAnnotation<:in>
Arguments

refDrwView
Reference to an existing drawing view.

refAnnotation
Reference to an existing drawing annotation.
Error handling
The program execution will be canceled if the reference to the
drawing view or to the annotation do not exist or the annotation
could not be shown, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION annotation
USER_SELECT DRAWING_VIEW view
SHOW_DRW_ANNOTATION view annotation
§
ERASE_DRW_ANNOTATION
Erases a drawing annotation.
Syntax
ERASE_DRW_ANNOTATION refDrawing<:in> refAnnotation<:in>
Arguments

refDrawing
Reference to an existing drawing which contains the annotation.

refAnnotation
Reference to an existing drawing annotation.
Error handling
The program execution will be canceled if the reference to the
annotation does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT DIMENSION dimension
ERASE_DRW_ANNOTATION THIS dimension
§
UNERASE_DRW_ANNOTATION
Shows an erased drawing annotation again.
Syntax
UNERASE_DRW_ANNOTATION refDrawing<:in> refAnnotation<:in>
Arguments

refDrawing
Reference to an existing drawing which contains the annotation.

refAnnotation
Reference to an existing erased drawing annotation.
Error handling
The program execution will be canceled if the reference to the
annotation does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW_DIMS INCLUDE_ERASED TRUE view "*" arrayDims
FOR dim REF ARRAY arrayDims
GET_DRW_ANNOTATION_VISIBILITY THIS dim visible
IF visible == FALSE
UNERASE_DRW_ANNOTATION THIS dim
END_IF
END_FOR
§
GET_DRW_ANNOTATION_TEXT_STYLE
Retrieves the text style of a drawing annotation.
Syntax
GET_DRW_ANNOTATION_TEXT_STYLE [options] refDrawing<:in>
refAnnotation<:in> text_syle<:out>
Arguments

options
the following options are supported:
EXPAND_DEFAULT valueBOOL — to expand the default values which are
encoded by -1.0 to their real values. Default is FALSE.

refDrawing
Reference to the drawing which contains the annotation.

refAnnotation
Reference to an annotation.

text_style
Structure variable of type TEXT_STYLE which receives the text style
definition.
Error handling
The program execution will be canceled if the drawing reference or
the annotation reference do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION annotation
GET_DRW_ANNOTATION_TEXT_STYLE EXPAND_DEFAULT TRUE THIS annotation
style
PRINT "height: %" style.height
PRINT "thickness: %" style.thickness
PRINT "width_factor: %" style.width_factor
PRINT "slant_angle: %" style.slant_angle
PRINT "underline: %" style.underline
PRINT "horz_justification : %" style.horz_justification
PRINT "angle : %" style.angle
IF style.color.by_name == TRUE
PRINT "color: %" style.color.color_name
ELSE
PRINT "color: %/%/%" style.color.color_rgb.red
style.color.color_rgb.green style.color.color_rgb.blue
END_IF
PRINT "mirror : %" style.mirror
§
SET_DRW_ANNOTATION_TEXT_STYLE
Sets the text style for a drawing annotation.
Syntax
SET_DRW_ANNOTATION_TEXT_STYLE refDrawing<:in> refAnnotation<:in>
text_syle<:in>
Arguments

refDrawing
Reference to the drawing which contains the annotation.

refAnnotation
Reference to an annotation.

text_style
Structure variable of type TEXT_STYLE which contains the text style
definition.
Error handling
The program execution will be canceled if the drawing reference or
the annotation reference do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT ANNOTATION annotation
GET_DRW_ANNOTATION_TEXT_STYLE THIS annotation style
style.height = 5.0
SET_DRW_ANNOTATION_TEXT_STYLE THIS annotation style
§
GET_DRW_ANNOTATION_POS
Retrieves the position of an annotation on a drawing.
Syntax
GET_DRW_ANNOTATION_POS refAnnotation<:in> pos<:out>
Arguments

refAnnotation
Reference to an annotation.

pos
Structure variable of type POINT will receive the result.
Error handling
The program execution will be canceled if the annotation reference
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The reference to the annotation requires to have the information
about its position on the drawing. This is the case if the annotation
is selected on the drawing by a USER_SELECT or searched by a
SEARCH_DRW_ITEM command.
Example
SEARCH_DRW_ITEMS THIS NULL 1 DRAWING_GTOL "*" arrayGtols
FOR gtol REF ARRAY arrayGtols
GET_DRW_ANNOTATION_POS gtol pos
PRINT "gtol position: % % %" pos.x pos.y pos.z
END_FOR
About Commands for Drawing Models
Commands related to drawing models.
The following commands are available:
ADD_DRW_MDL — to add a model to a drawing.
SET_DRW_MDL — to set the active model of a drawing.
GET_DRW_MDL — to get the active model of a drawing.
GET_DRW_MDLS — to get an array of all drawing models.
DELETE_DRW_MDL — to delete a model from a drawing.
DELETE_RRW_MDL_SIMPREP — to deletes a simplified representation
from a drawing.
§
ADD_DRW_MDL
Adds a model to a drawing.
Syntax
ADD_DRW_MDL refDrawing<:in> model
Arguments

refDrawing
Reference to an existing drawing.

model
Model which should be added according the model specification.
Error handling
The program execution will be canceled if drawing or model are not
exiting, unless errors are handled by BEGIN_CATCH_ERROR.
Example
ADD_DRW_MDL refDrawing mdl
§
SET_DRW_MDL
Sets the active model of a drawing.
Syntax
SET_DRW_MDL refDrawing<:in> model
Arguments

refDrawing
Reference to an existing drawing.

model
Model which should be deleted according the model specification.
Note
If models the model does not already belong to the drawing it will be
added.
Error handling
The program execution will be canceled if drawing or model are not
exiting, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_DRW_MDL refDrawing mdl
§
GET_DRW_MDL
Retrieves the active model of a drawing.
Syntax
GET_DRW_MDL refDrawing<:in> mdl<:out>
Arguments

refDrawing
Reference to an existing drawing.

mdl
Name of the reference variable which will receive the active models.
Note
If models the model does not already belong to the drawing it will be
added.
Error handling
The program execution will be canceled if drawing does not exist or
if it does not contains a model, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_DRW_MDL THIS mdl
PRINT "%" mdl
§
GET_DRW_MDLS
Retrieves an array of all models from a drawing.
Syntax
GET_DRW_MDLS refDrawing<:in> arrayModels<:out>
Arguments

refDrawing
Reference to an existing drawing.

arrayModels
Name of the array which will receive the models.
Note
If models the model does not already belong to the drawing it will be
added.
Error handling
The program execution will be canceled if drawing does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_DRW_MDLS THIS arrayMdls
FOR mdl REF ARRAY arrayMdls
PRINT "%" mdl
END_FOR
§
DELETE_DRW_MDL
Deletes a model from a drawing.
Syntax
DELETE_DRW_MDL refDrawing<:in> model
Arguments

refDrawing
Reference to an existing drawing.

model
Model which should be deleted according the model specification.
Note
If models are used by drawing views, these views will be removed.
Error handling
The program execution will be canceled if drawing or model are not
exiting or if the model cannot be deleted, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
DELETE_DRW_MDL refDrawing mdl
§
DELETE_DRW_MDL_SIMPREP
Deletes a simplified representation from a drawing. This commend work
identical to File > Properties > Drawing Models > Remove Rep in the
drawing mode.
Syntax
DELETE_DRW_MDL_SIMPREP refDrawing<:in> refMdlSimprep<:in> "simprep"
Arguments

refDrawing
Reference to an existing drawing.

refMdlSimprep
Model whose simplified representation is to be deleted according the
model specification.

simprep
Simplified representation which is to be deleted.
Error handling
The program execution will be canceled if drawing, model or
simplified representation are not existing or if the simplified
representations cannot be deleted, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW THIS "MAIN" 1 refView
GET_DRW_VIEW_MDL refView refMdl
DELETE_DRW_MDL_SIMPREP THIS refMdl "MASTER"
About Commands for General Drawing Operations
Further commands related to drawings.
The following commands are available:
CREATE_DRW — to create a new drawing from a drawing template.
MERGE_DRWS — to merge a drawing to an existing one.
GET_DRW_SCALE — to retrieve the scale of a drawing view or of the
drawing.
SET_DRW_SCALE — to set the scale of a drawing view of of the
drawing.
SET_ON_DRW_LAYER — to place geometry elements, features or models
on a drawing layer.
GET_DRW_SIZE — to retrieve the size of a drawing sheet by name,
with and height.
SET_DRW_SIZE — to set the size of a drawing sheet by name or by
width and height.
GET_DRW_FORMAT — to retrieve the name of a drawing format.
SHOW_DRW_FORMAT — to show or hide the format of a drawing sheet.
GET_DRW_TOL_STANDARD — to read the tolerance standard of a drawing.
SET_DRW_TOL_STANDARD — to set the tolerance standard of a drawing.
GET_DRW_CUR_SHEET — to retrieve the number of the current drawing
format.
SET_DRW_CUR_SHEET — to activate a specific sheet of a drawing.
INSERT_DRW_SHEET — to insert a new sheet to a drawing.
REMOVE_DRW_SHEET — to remove an existing sheet from a drawing.
GET_DRW_SHEET_NAME — to retrieve the name of a sheet from a
drawing.
REORDER_DRW_SHEET — to reorder a sheet on a drawing.
GET_DRW_SHEET_NUM — to retrieve the number of sheets in a drawing.
EXPORT_DRW_PDF — to export a drawing sheet to a PDF file.
GET_DRW_OPTIONS — to read the current options of a drawing.
SET_DRW_OPTIONS — to set the options of a drawing.
LOAD_DRW_OPTIONS — to apply the drawing options to a dtl file.
SWITCH_TO_MAIN_MDL — to switch back to the mail model.
§
CREATE_DRW
Creates a new drawing from a drawing template
Syntax
CREATE_DRW [option] model<:in> "drawing_template" refDrawing<:out>
Arguments

option
The following options are supported:
DRW_NAME "name" — defines the name of the drawing which should be
created. Default is the same name as the model.

model
Solid model of the drawing.

drawing_template
Name and path of the drawing template. According to the path
specification it could be in library or in working directory.

refDrawing
Retrieves reference of the created drawing.
Error handling
The program execution will be canceled if the reference to the solid
model does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
CREATE_DRW THIS "a4_template.drw" refDrawing
§
MERGE_DRWS
Merges a drawing to an existing one. This function requires
Pro/ENGINEER Wildfire 5 / Creo Elements/Pro 5 or above.
Syntax
MERGE_DRWS refDrawing1<:in> refDrawing2<:in>
Arguments

refDrawing1
Existing reference to the drawing which should receive the content of
the second drawing.

refDrawing2
Existing reference to the drawing which should be merged to the first
drawing.
Error handling
The program execution will be canceled if the reference to one of the
drawings does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.

Note
The refDrawing2 reference will be invalidated in case it could not be
retrieved again.
Example
MERGE_DRWS refDrawing1 refDrawing2
§
GET_DRW_SCALE
Retrieves the scale of drawing view or of drawing.
Syntax
GET_DRW_SCALE refDrawing<:in> sheet INT refDrwView<:in> scale<:out>
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has the number 1.

refDrwView
Reference to an existing drawing view or NULL. In case of NULL the
scale is applied to the drawing.

scale
Name of the double variable which receives the scale.
Error handling
The program execution will be canceled if the reference to the
drawing or to the drawing view do not exist, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrawing
SEARCH_DRW_VIEW refDrawing "main" 1 refDrwView
GET_DRW_SCALE refDrawing 1 refDrwView scaleView
PRINT "Drawing view scale: %" scaleView
GET_DRW_SCALE refDrawing 1 NULL scaleDrw
PRINT "Drawing scale: %" scaleDrw
§
SET_DRW_SCALE
Sets scale of drawing view or of drawing.
Syntax
SET_DRW_SCALE refDrawing<:in> sheet INT refDrwView<:in> scale DOUBLE
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has the number 1.

refDrwView
Reference to an existing drawing view or NULL. In case of NULL the
scale is applied to the drawing.

scale
Double value for the view scale.
Error handling
The program execution will be canceled if the reference to the
drawing or to the drawing view do not exist or the scale can not be
changed, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case a view is specified, but its scale is driven by the sheet,
the sheets scale will be changed.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrawing
SEARCH_DRW_VIEW refDrawing "main" 1 refDrwView
SET_DRW_SCALE refDrawing 1 refDrwView 0.5
§
SET_ON_DRW_LAYER
Places geometry elements, features, parts or sub-assemblies on a
drawing layer. The layer will be created if it does not exist yet.
Syntax
SET_ON_DRW_LAYER refDrawing<:in> selFeature<:in> "layer_name"
Arguments

refDrawing
Reference to an existing drawing.

refFeature
Reference to an existing feature.

layer_name
Name of existing drawing layer. Any string expression is allowed.
Error handling
The program execution will be canceled if the references to the
drawing or to the feature do not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
! Select a feature which should be placed on a layer
USER_SELECT FEATURE feat
! Search drawing for a specific model.
SEARCH_MDL_REF THIS DRAWING dwg refDrawing
! Set feature on drawing layer 00_SAMPLE_LAYER
SET_ON_DRW_LAYER refDrawing feat 00_SAMPLE_LAYER
§
GET_DRW_SIZE
Retrieves the size of a drawing sheet by name, width and height.
Syntax
GET_DRW_SIZE refDrawing<:in> sheet INT paper_size<:out> width<:out>
height<:out>
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has the number 1.

paper_size
Variable of type string which will receive the paper size.

width
Variable of type double which will receive the width of the drawing.

height
Variable of type double which will receive the height of the drawing.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrawing
GET_DRW_SIZE refDrawing 1 name width height
PRINT "Size: %, width: %, height: %" name width height
§
SET_DRW_SIZE
Sets the size of a drawing sheet by name or by width and height.
Syntax
SET_DRW_SIZE refDrawing<:in> sheetINT "paper_size" widthDOUBLE
heightDOUBLE
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has the number 1.

paper_size
Specifies the paper size.

width
Value for the width. This is only used for paper_size VARIABLE_SIZE.

height
Value for the height. This is only used for paper_size VARIABLE_SIZE.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrawing
SET_DRW_SIZE refDrawing 1 "VARIABLE_SIZE" 20 40
SET_DRW_SIZE refDrawing 1 "A4" 0 0
§
GET_DRW_FORMAT
Retrieves the name of drawing format.
Syntax
GET_DRW_FORMAT refDrawing<:in> sheet INT paramName<:out>
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has the number 1.

paramName
Parameter which will receive the name of the format.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
If no format is applied the parameter will contain an empty value.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrawing
GET_DRW_FORMAT refDrawing 1 format
PRINT "Format: %" format
§
SET_DRW_FORMAT
Sets the format of a drawing. Tables from older formats will be
removed.
Syntax
SET_DRW_FORMAT [options] refDrawing<:in> sheetINT "drawing_format"
Arguments

options
The following options are supported:
REMOVE_TABLES valueBOOL — to determine if the tables of the
existing drawing format should be removed. Default is TRUE.

FORMAT_SHEET valueINT — to determine which sheet of the format


should be used. Default is 1 for the first sheet.

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has the number 1. Any math
expression is allowed.

drawing_format
Name and path of the drawing format. According to the path
specification it could be in library or in working directory.
Error handling
The program execution will be canceled if the reference to the
drawing not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_DRW_FORMAT refDrawing 1 "a4.frm"
§
SHOW_DRW_FORMAT
Shows or hides the format of a drawing sheet. This command is only
available for Creo 2.0 and above.
Syntax
SHOW_DRW_FORMAT refDrawing<:in> sheetINT showFormatBOOL
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number of the drawing. First sheet has the number 1. Any math
expression is allowed.

showFormat
Boolean variable which determines if the format will be shown or
hidden on the drawing sheet.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SHOW_DRW_FORMAT refDrawing 1 FALSE
§
GET_DRW_TOL_STANDARD
Reads the tolerance standard of a drawing.
Syntax
GET_DRW_TOL_STANDARD refDrawing<:in> tol_standard<:out>
Arguments

refDrawing
Reference to an existing drawing.

tol_standard
Name of the variable which receives the tolerance standard. Valid
standards are:
ANSI — for the ANSI standard.
ISO — for the ISO standard.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART DRAWING "*" refDrawing
GET_DRW_TOL_STANDARD refDrawing standard
PRINT "%" standard
§
SET_DRW_TOL_STANDARD
Sets the tolerance standard of a drawing.
Syntax
SET_DRW_TOL_STANDARD refDrawing<:in> "tol_standard"
Arguments

refDrawing
Reference to an existing drawing.

tol_standard
Model tolerance standard. Any string expression is allowed. The
following tolerance standards are supported:
ANSI — for the ANSI standard.
ISO — for the ISO standard.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF PART DRAWING "*" refDrawing
SET_DRW_TOL_STANDARD refDrawing "ISO"
§
GET_DRW_CUR_SHEET
Retrieves the number of the current drawing sheet.
Syntax
GET_DRW_CUR_SHEET refDrawing<:in> paramSheetNr<:out>
Arguments

refDrawing
Reference to an existing drawing.

paramSheetNr
Parameter which will receive the current sheet number of the drawing
as integer value. The first sheet has the number 1.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrawing
GET_DRW_CUR_SHEET refDrawing sheetNr
PRINT "sheetNr: %" sheetNr
§
SET_DRW_CUR_SHEET
Activates a specific sheet of a drawing.
Syntax
SET_DRW_CUR_SHEET refDrawing<:in> sheet INT
Arguments

refDrawing
Reference to an existing drawing.

sheet
Sheet number that should be set active. First sheet has the number 1.
Error handling
The program execution will be canceled if the reference to the
drawing or the sheet does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrawing
SET_DRW_CUR_SHEET refDrawing 2
EXPORT_FILE DXF drawing_dxf
§
INSERT_DRW_SHEET
Inserts a new sheet to a drawing.
Syntax
INSERT_DRW_SHEET refDrawing<:in> sheetNrINT
Arguments

refDrawing
Reference to an existing drawing.

sheetNr
Sheet number to which the sheet should be inserted. Use 1 to insert
on the first sheet.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
INSERT_DRW_SHEET refDrawing 999
§
REMOVE_DRW_SHEET
Removes an existing sheet from a drawing.
Syntax
REMOVE_DRW_SHEET refDrawing<:in> sheetNrINT
Arguments

refDrawing
Reference to an existing drawing.

sheetNr
Number of sheet which should be removed. First sheet has number 1.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
REMOVE_DRW_SHEET refDrawing 1
§
GET_DRW_SHEET_NAME
Retrieves the name of a sheet from a drawing.
Syntax
GET_DRW_SHEET_NAME refDrawing<:in> sheetNrINT name<:out>
Arguments

refDrawing
Reference to an existing drawing.

sheetNr
Number of sheet. First sheet has number 1.
name
Name of the variable which receives the sheet name.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_DRW_SHEET_NAME refDrawing 1 name
PRINT "Name: %" name
§
REORDER_DRW_SHEET
Reorder a sheet on a drawing.
Syntax
REORDER_DRW_SHEET refDrawing<:in> sheetNrINT sheetPosINT
Arguments

refDrawing
Reference to an existing drawing.

sheetNr
Number of sheet which should be reordered. First sheet has number 1.

sheetPos
Number of the new position.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
REORDER_DRW_SHEET refDrawing 1 2
§
GET_DRW_SHEET_NUM
Retrieves the number of sheets in a drawing.
Syntax
GET_DRW_SHEET_NUM refDrawing<:in> paramNumberSheets<:out>
Arguments

refDrawing
Reference to an existing drawing.

paramNumberSheets
Parameter which will receive the number of sheets of a drawing.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS DRAWING drw refDrawing
GET_DRW_SHEET_NUM refDrawing numberSheets
PRINT "Number of sheets: %" numberSheets
§
EXPORT_DRW_PDF
Exports a drawing sheet to a PDF file. This command is available for
Wildfire 3 and above.
Syntax
EXPORT_DRW_PDF refDrawing<:in> pdf_options "file_name"
Arguments

refDrawing
Reference to an existing drawing.

pdf_options
Existing structure variable of type PDF_OPTION.

file name
Name and path for the PDF file. See path specification for details.
Error handling
The program execution will be canceled if the reference to the
drawing does not exist, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
This command requires a special dll compiled for Wildfire 3 or above.
Example
RETRIEVE_MDL sample.prt refPart
SEARCH_MDL_REF refPart DRAWING DRW refDrawing
DECLARE_STRUCT PDF_OPTION option
option.title = "sample drawing"
option.author = "Achim Schön"
option.subject = "detail"
option.keywords = "SmartAssembly example"
option.launch_viewer = "TRUE"
EXPORT_DRW_PDF refDrawing option page1
§
GET_DRW_OPTIONS
Reads the current options of a drawing.
Syntax
GET_DRW_OPTIONS refDrawing<:in> drawing_options<:out>
Arguments

refDrawing
Reference to an existing drawing.

drawing_options
Structure variable of type DRAWING_OPTIONS which receives the drawing
options.
Error handling
The program execution will be canceled if the reference to the
drawing not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_DRW_OPTIONS refDrawing options
PRINT "%" options.drawing_text_height
PRINT "%" options.text_thickness
PRINT "%" options.text_width_factor
§
SET_DRW_OPTIONS
Sets the options of a drawing.
Syntax
SET_DRW_OPTIONS refDrawing<:in> drawing_options<:in>
Arguments

refDrawing
Reference to an existing drawing.

drawing_options
Existing structure variable of type DRAWING_OPTIONS.
Error handling
The program execution will be canceled if the reference to the
drawing not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_DRW_OPTIONS refDrawing options
options.drawing_text_height = 10
SET_DRW_OPTIONS refDrawing options
§
LOAD_DRW_OPTIONS
Applies the drawing options of a dtl file.
Syntax
LOAD_DRW_OPTIONS refDrawing<:in> "dtl_file"
Arguments

refDrawing
Reference to an existing drawing.

dtl_file
Path and name of the dtl file. Any string expression is allowed.
Error handling
The program execution will be canceled if the reference to the
drawing not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
LOAD_DRW_OPTIONS refDrawing "c:\\preo\\text\\iso.dtl"
§
SWITCH_TO_MAIN_MDL
Drawing operations require to switch automatically the current model
to the drawing. Use this command to switch back to the main model.
Syntax
SWITCH_TO_MAIN_MDL
About Commands for Control Structures
Commands for applying conditional elements of a program, launching
the graphical user interface, debug support and error handling. The
following commands are available:
IF — to execute a block of commands based on the evaluation of a
condition term.
FOR — to loop over all instances of a sequence of references.
WHILE — to execute a loop as long as the evaluation of a condition
term is true.
CONFIG_ELEM — to start the graphical user interface and table
description to configure the component.
CONFIG_HTML — to start the default browser with a prepared web page
as an user interface implemented with JavaScript.
GET_CONFIG_HTML_DATA — to retrieve the data submitted by the web
page called from CONFIG_HTML.
SET_CONFIG_HTML_DATA — to set the data to return to the web page
called from CONFIG_HTML.
BEGIN_CATCH_ERROR — to start the error handling mode.
END_CATCH_ERROR — to terminate the error handling mode.
CLEAR_CATCH_ERROR — to clear a flagged runtime error.
CLEAR_GUI_CANCELLED — to clear a flagged cancellation of the
graphical user interface.
BEGIN_DEBUG — to start the debug mode.
END_DEBUG — to terminate the debug mode.
CALL — to execute another script file.
CALL_EX — to execute another script file and define the variable
passing.
INCLUDE — to include another script file.
WAIT — to start a dialog box and stop the script file execution
until the user clicks on the dialog.
STOP — to show a string menu and stop the script file execution
until the user commits the menu.
STOP_EX — to show a STOP dialog and waits until the user
interactively presses the Continue button.
SLEEP — to suspend the execution for a specific number of seconds.
CRASH — to crash SmartAssembly and Creo Elements/Pro for stability
tests of the SmartDesignServer.
TERMINTE_PROE — to terminate the active Pro/ENGINEER / Creo
session.
EXIT — to stop the execution of the script file without causing an
error.
SET_RETURN_VALUE — to define a return value for a tab file and go
on executing it. This is currently only in use for the notification
MDL_RENAME_PRE and MDL_SAVE_PRE.
RETURN — to return immediately with the specified value from a tab
file. This is currently only in use for the notification
MDL_RENAME_PRE and MDL_SAVE_PRE.
MODIFY_COMPONENT — to execute the modification functionality on a
former created component.
COPY_COMPONENT — to execute the copy functionality on a former
created component.
DELETE_COMPONENT — to execute the delete functionality on a former
created component.
IF
Determines if a block of code is computed or not through evaluating a
condition term.
Syntax
IF condition term
Program code
Program code
...
ELSE_IF condition term
Program code
Program code
...
ELSE
Program code
Program code
...
END_IF
Arguments

IF condition term
If the condition term is evaluated as valid, the code in the
following lines will be executed up to the next ELSE_IF, ELSE or
END_IF statement.

ELSE_IF condition term


If the condition term is evaluated as valid and no previous condition
term in the same IF ... END_IF block was valid, the code in the
following lines will be executed up to the next ELSE_IF, ELSE or
END_IF statement.

ELSE
If no previous condition term in the same IF ... END_IF block was
valid, the code in the following lines will be executed up to the
END_IF statement.

END_IF
End of the IF block.
Example
IF a > 10 AND A < 20
PRINT "10 < a < 20"
ELSE_IF a < 30
PRINT "a < 30"
ELSE
PRINT "a invalid"
END_IF
FOR
Processes a loop over a code sequence for several references which
are detected because of the specified option.
Syntax:
FOR reference<:out> REF OPTION
[ EXCLUDE model1 [model2 model3 ...] ]
Program code
...
[ BREAK ]
Program code
...
[ CONTINUE ]
Program code
Program code
...
END_FOR
Arguments

reference
This reference changes for each loop iteration. It is always one of
the references which where detected because of the option.

option
INTERF_MDL model [SOLID_ONLY]
Iterates over all models which interfere with the specified model.
By using the option SOLID_ONLY, interferences only caused by
surface intersection are not regarded.
Components can be excluded from collision detection by use of the
parameters BUW_INTERF_CHECK and BUW_INTERF_LEVEL.
Note: Intersections are only determined between visible elements
which are interfering. In case one model contains the other without
any interfering surfaces, it will not be considered as interfering.
INTERF_BODY refBody<:in> [SOLID_ONLY]
Iterates over all models which interfere with the specified body.
By using the option SOLID_ONLY, interferences only caused by
surface intersection are not regarded.
Components can be excluded from collision detection by use of the
parameters BUW_INTERF_CHECK and BUW_INTERF_LEVEL.
Note: Intersections are only determined between visible elements
which are interfering. In case one model contains the other without
any interfering surfaces, it will not be considered as interfering.
INTERF_SURF refSurface<:in>
Iterates over all models with interfere with the specified surface.
Components can be excluded from collision detection by use of the
parameters BUW_INTERF_CHECK and BUW_INTERF_LEVEL.
INTERF_QUILT refQuilt<:in>
Iterates over all models with interfere with the specified quilt.
The quit interference check consists of a check of all of its
single surfaces. Therefor situations where the quilt is completely
enclosed or is just touching the solid is not regarded as an
intersection. Components can be excluded from collision detection
by use of the parameters BUW_INTERF_CHECK and BUW_INTERF_LEVEL.
INTERF_QUILT_SOLID refQuilt<:in>
Iterates over all models with interfere with a temporary solid
model which contains all of the surfaces of a quilt. This works
also for non closed quilts. Components can be excluded from
collision detection by use of the parameters BUW_INTERF_CHECK and
BUW_INTERF_LEVEL.
OTHER_REFS_IN_FEAT reference<:in> [ASK_USER]
Iterates over all instances of geometry elements in the feature
except the specified reference, such as a pattern or a feature that
consists of several geometrical instances (for example, a datum
point with several points). If the optional argument ASK_USER is
appended, the user will be asked if the for loop should be
processed.
ALL_REFS_IN_FEAT reference<:in>
Same functionality as OTHER_REFS_IN_FEAT with the difference that
the iteration includes the specified reference.
OTHER_INSTANCES reference<:in>
Iterates over all instances of a model except for the specified
instance, if it is assembled multiple times.
ALL_INSTANCES reference<:in>
Same functionality as OTHER_INSTANCES with the difference that the
iteration includes the specified instance.
ARRAY refArray<:in>
Iterates over all elements of an array.
REVERSE_ARRAY refArray<:in>
Iterates over all elements of an array in reversed order.
MAP refMap<:in>
Iterates over all elements of a map in sort order. A map element is
a structure MAP_ELEM.
REVERSE_MAP refMap<:in>
Iterates over all elements of a map in reversed order. A map
element is a structure MAP_ELEM.
FAMINSTANCES refGeneric<:in>
Iterates over all family table instances of a generic model which
was specified by refGeneric.
LIST reference1<:in> reference2<:in> ...
Arbitrary number of references specified are iterated.

EXCLUDE
Excludes several models from processing. These models can be
specified by references or by arrays of references. This line is only
regarded for the option INTERF_MDL ,INTERF_SURF and INTERF_QUILT. It
must be the first code line in the block.

BREAK
Terminates the loop.

CONTINUE
Start next iteration of the loop immediately without traversing the
lines until END_FOR.

END_FOR
End of the for loop.
Example
FOR CUTTED_PLATE REF INTERF_MDL THIS
CREATE_UDF QUILT_CUT CUTTED_PLATE
UDF_REF REF_QUILT CUT_QUILT
END_CREATE_UDF
END_FOR
This example shows how a library component is cut free from
interfering models by use of a quilt cut UDF.
WHILE
Processes a loop over a code sequence as long as a condition is true.
Syntax
WHILE condition term
Program code
...
[ BREAK ]
Program code
...
[ CONTINUE ]
Program code
Program code
...
END_WHILE
Arguments

WHILE condition term


As long as the condition term is evaluated as valid, the code in the
following lines, will be executed up to the closing END_WHILE
statement.

BREAK
Terminates the while loop. Typically this commend is used in
conjunction with an IF statement.

CONTINUE
Start next iteration of the loop immediately without traversing the
lines until END_WHILE.

END_WHILE
End of the while loop.
Example
USER_INPUT_PARAM INTEGER number
WHILE number <> 0
! skip if number is 1
IF number == 1
CONTINUE
END_IF
! break if number is 2
IF number == 2
BREAK
END_IF
PRINT "Number: %" number
USER_INPUT_PARAM INTEGER number
END_WHILE
CONFIG_ELEM
Starts graphical user interface and table processing. After the
dialog box closes, the program continues with the next line.
Syntax
CONFIG_ELEM options [ width DOUBLE [height DOUBLE]]
Arguments

options
The following options are available:
NO_TABLES — does not process the tables of the graphical user
interface.
NO_GUI — does not process the elements of the graphical user
interface as input parameters, selection buttons, etc.
AUTO_COMMIT — immediately commits the GUI dialog as soon as the OK
button becomes active.
AUTO_CLOSE — commits the GUI dialog in case it can be completely
evaluated without any user input.
SHOW_GUI_FOR_EXISTING — For SmartAssembly > Component Engine >
Create existing Component and ... Copy existing Component the
graphical user interface does not show up. Setting this option
changes this behaviour.
NO_AUTO_UPDATE — avoids the automatic updating of associated
parameters and dimensions.
CONTINUE_ON_CANCEL — avoids the termination of the program in case
the user hits the cancel button.
SCREEN_LOCATION location option — use one of the location option to
define where the dialog should appear. If not defined the dialog
with appear in the center of the screen.

width
Optional specification of dialog width for graphical user interface.
In case values between 0 and 1 are specified, these will be used as
perceptual values. Values greater than 1 are used as absolute values.

height
Optional specification of dialog height for graphical user interface.
In case values between 0 and 1 are specified, these will be used as
perceptual values. Values greater than 1 are used as absolute values.
Note
Pro/ENGINEER / Creo parameters and dimensions which are associated to
a variable are updated automatically after committing the OK button.
A parameter or dimension is associated if it was searched via
SEARCH_MDL_PARAM / SEARCH_FEAT_PARAM. Also if parameters or
dimensions of the current component have the same name as a variable
they are considered to be associated.
Example
! display the dialog box in required size
CONFIG_ELEM
! display dialog box in fixed size (50% of the screen)
CONFIG_ELEM 0.5 0.5
! display dialog box in fixed size (1024x768)
CONFIG_ELEM NO_TABLES AUTO_COMMIT 1024 768
§
CONFIG_HTML
Starts the default browser with a prepared web page as an user
interface implemented with JavaScript. SmartAssembly implements an
internal HTTP server for this command.
Syntax
CONFIG_HTML [options] "document_root" "start_page"
Arguments

options
The following options are available:
USE_INTERNAL_BROWSER internal_browserBOOL — uses the Creo internal
browser to show the web page. Default is FALSE.

document_root
Name and location of the directory which contains the start page.
Any string expression is allowed.

start_page
Name of the start page. Any string expression is allowed. In case the
start page is an empty string, index.html and index.htm will be
tested.
Note
The start page should include the following two lines at the end of
the HTML body.
<script src="sas/jquery/jquery.min.js"></script>
<script src="sas/SmartAssembly/SmartAssembly.js"></script>
After this the java script code for the start page should follow. For
example:
<script src="sample.js"></script>
See Using CONFIG_HTML for more details about this command.
Example
CONFIG_HTML "lib:" "index.html"
§
GET_CONFIG_HTML_DATA
Retrieves the data submitted by the web page called from CONFIG_HTML
as a XML document. The data is stored in the node /CONFIG_HTML_DATA.
Syntax
GET_CONFIG_HTML_DATA XMLDocument<:out>
Arguments

XMLDocument
Name of the variable for the XMLDocument descriptor.
Note
See Using CONFIG_HTML for more details about this command.
Example
GET_CONFIG_HTML_DATA xmlData
XML_GET_NODE xmlData "/CONFIG_HTML_DATA/math" "" nodeMath
XML_GET_NODE_VALUE nodeMath valueMath
CALC_FORMULA valueMath result
PRINT "%" result
XML_SET_NODE_VALUE nodeMath ftos(result)
SET_CONFIG_HTML_DATA xmlData
§
SET_CONFIG_HTML_DATA
Sets the data to return to the web page called from CONFIG_HTML as a
XML document. The data is to be stored in the node /CONFIG_HTML_DATA.
Syntax
SET_CONFIG_HTML_DATA XMLDocument<:in>
Arguments

XMLDocument
Name of an existing XML document descriptor which contains the data
in the node /CONFIG_HTML_DATA.
Error Handling
The program execution will be canceled if the XML document is not
found or not valid, unless errors are handled by BEGIN_CATCH_ERROR.
Note
See Using CONFIG_HTML for more details about this command.
Example
GET_CONFIG_HTML_DATA xmlData
XML_GET_NODE xmlData "/CONFIG_HTML_DATA/math" "" nodeMath
XML_GET_NODE_VALUE nodeMath valueMath
CALC_FORMULA valueMath result
PRINT "%" result
XML_SET_NODE_VALUE nodeMath ftos(result)
SET_CONFIG_HTML_DATA xmlData
BEGIN_CATCH_ERROR
Runtime errors like invalid references are causing the program to
stop with an error message. This command disables the runtime error
checking and continues to proceed with the next valid statements. For
syntax errors the program will stop in any case.
Syntax
BEGIN_CATCH_ERROR options
Arguments

options
The following options are available to specify the behaviour of error
catching.
FIX_FAIL_UDF
In case a CREATE_UDF command fails, the user can fix the UDF.
FIX_FAIL_COMPONENT
In case a ASSEMBLE command fails due to invalid constraints all
constraints are disabled and the user can fix the constraint
scheme.
Note
With the option ERROR for if statements, a conditional program code
could be processed in case of a caught error. For turning back to the
normal error mode END_CATCH_ERROR could be used.
END_CATCH_ERROR
This command terminates an BEGIN_CATCH_ERROR mode and switches back
to normal runtime error handling.
Syntax
END_CATCH_ERROR
CLEAR_CATCH_ERROR
Clears a flagged runtime error.
Syntax
CLEAR_CATCH_ERROR
CLEAR_GUI_CANCELLED
Clears a flagged cancellation of the graphical user interface.
Syntax
CLEAR_GUI_CANCELLED
BEGIN_DEBUG
Starts debug mode when processing a tab file. After every line the
user has to confirm to go on in a Creo Elements/Pro string menu via
Done select or Quit select.
Syntax
BEGIN_DEBUG
Note
This is the same procedure as the STOP command, but the string menu
occurs after every step of the tab file processing. For leaving the
debug mode, but the command END_DEBUG.
END_DEBUG
Terminates the debug mode started with BEGIN_DEBUG.
Syntax
END_DEBUG
§
CALL
Executes another script file by specifying the file name. The script
file execution starts in the assembly description block.
Syntax
CALL "filename"[options]
Arguments

filename
File name of the tab file which should be processed. Any string
expression is allowed. In case no extension is specified ".tab" will
be appended automatically.

options
The following options are supported:
MODEL model<:in> — specifies the model on which the called tab file
should work on. This is required in case of drawing programs called
from a PART, PART_COPY, ASSEMBLY, ASSEMBLY_COPY program.

EXPORT_CONFIG_PARAMS valueBOOL — specifies if configuration


parameters of the UI definition in the current program file should
also be written in the called one. Default is FALSE.

IMPORT_CONFIG_PARAMS valueBOOL — specified if configuration


parameters of the UI definition of the called program file should
also be written in the current one. Default is FALSE.
Error handling
The program execution will be canceled if any command in the called
program fails, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The script file which should be called, must also be declared in the
corresponding sel_list.txt. When calling a program B from program A,
all variables were passed from A to B. After the execution of program
B has finished, only the modification of references are propagated
back to program A. Parameters and arrays will not be adjusted. Use
CALL_EX for more control on the variable passing.
If the called tab file should not appear as standalone program for
the user it could be flagged by the option hide.
Example
WHILE I <= NUMBER
INVALIDATE_REF refPOINT
CALL tab_file.tab
I =I+1
END_WHILE
§
CALL_EX
Executes another script file by specifying the file name. The script
file execution starts in the assembly description block.
Syntax
CALL_EX "filename" [options]
VARIABLE_PASSING1
VARIABLE_PASSING2
END_CALL_EX
Arguments

filename
File name of the tab file which should be processed. Any string
expression is allowed. In case no extension is specified ".tab" will
be appended automatically.

options
The following options are supported:
MODEL model<:in> — specifies the model on which the called tab file
should work on. This is required in case of drawing programs called
from a PART, PART_COPY, ASSEMBLY, ASSEMBLY_COPY program.

EXPORT_CONFIG_PARAMS valueBOOL — specifies if configuration


parameters of the UI definition in the current program file should
also be written in the called one. Default is FALSE.

IMPORT_CONFIG_PARAMS valueBOOL — specified if configuration


parameters of the UI definition of the called program file should
also be written in the current one. Default is FALSE.

Variable passings
Multiple variables passings can be defined by the following syntax:
TYPE variable_main_program variable_called_program
The following passing types are available:
VAR_IN — passes the content of the variable in the main program to
the variable of the sub program before the sub program is executed.
VAR_OUT — passes the content of the variable of the sub program to
the variable of the main program after the sub program was
executed.
VAR_INOUT — passes the content of the variable in the main program
to the variable of the sub program before the sub program is
executed and updates the variable in the main program after the sub
program was executed.
All passed variables must be defined in the calling program file
before the CALL_EX statement. This prerequisite is gone since 2013-
02-06-01.
Error handling
The program execution will be canceled if any command in the called
program fails, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The script file which should be called, must also be declared in the
corresponding sel_list.txt.
If the called tab file should not appear as standalone program for
the user it could be flagged by the option hide.
Example
CALL_EX tab_file.tab
VAR_IN SCREW_DIAMETER DM
VAR_OUT SCREW_LENGTH SL
END_CALL_EX
§
INCLUDE
Includes another script file by specifying the file name. The script
file execution starts in the assembly description block.
Syntax
INCLUDE "filename"
Arguments

filename
File name of the tab file which should be processed. Any string
expression is allowed. In case no extension is specified ".tab" will
be appended automatically.
Note
The script file which should be included, needs not to be declared in
the corresponding sel_list.txt. All variables from the main program
could be accessed and modified. All new created variables will be
accessible in the main program afterwards.
Error handling
The program execution will be canceled if any command in the included
program fails, unless errors are handled by BEGIN_CATCH_ERROR.
Example
INCLUDE sub.tab
WAIT
Shows a window with a button and waits until the user has clicked on
it.
Syntax
WAIT
Note
This command is useful in cases there the user should enter some
information before the processing of the script files is going on.
STOP
Shows a string menu in Creo Elements/Pro. Creo Elements/Pro becomes
active until Done select or Quit select is pressed in the string
menu.
Syntax
STOP
Note
This command is a useful debugging technique to hold the command
processing and check which features have been created. Use
BEGIN_DEBUG to stop the tab file processing after every line of code.
§
STOP_EX
Shows a STOP dialog. Creo becomes active until Continue is pressed.
Syntax
STOP_EX
Note
This command is more robust than the STOP command since it only
continues when the user interactively selects the Continue button.
This could not be caused when the default action or OK is invoked by
Creo. Especially in the SmartDesignServer environment this is more
robust.
SLEEP
Suspends the execution for a specified number of seconds.
Syntax
SLEEP seconds DOUBLE
Arguments

seconds
Number of seconds the execution should be suspended.
Example
! Suspend for 10 seconds
SLEEP 10
CRASH
Crashes the current SmartAssembly session and Creo Elements/Pro. Note
this command makes only sense for stability tests of the
SmartDesignServer and should not be used for productive code.
Syntax
CRASH
TERMINATE_PROE
Terminates the active Pro/ENGINEER / Creo session.
Syntax
TERMINATE_PROE
EXIT
Exist stops the execution of the current script file without causing
an error. This option could be used for debugging techniques.
Syntax
EXIT [options]

options
Valid options are
RECURSIVE — Optional argument to exit completely.
NO_POST_PROCESSING — disables the post processing after the tab
file is executed.
Note
In case of nested programs via a CALL statement the EXIT command only
terminates the current level. To exit all levels use the RECURSIVE
option.
In SmartAssembly dlls prior to 2010-05-12-01 the EXIT command
disabled the post processing after the program was executed. Via the
NO_POST_PROCESSING option the old behaviour is established. This can
also be established by setting the configuration option
COMPENGINE_POST_PROCESSING_ON_EXIT to NO.
§
SET_RETURN_VALUE
Sets the return value for a program file. This is currently only used
for the notifications FEATURE_CREATE_PRE, FEATURE_DELETE_PRE,
FEATURE_REDEFINE_PRE, FEATURE_REGEN_PRE, MDL_CREATE_PRE,
MDL_RENAME_PRE,and MDL_SAVE_PRE to prevent the feature or model
related operations. It is also in use for bracket functions which are
executed before the Creo Parametric command.
Syntax
SET_RETURN_VALUE valueBOOL
Arguments

value
Boolean value which sets the return value.
Note
This command presets the return value, but remains executing the
program file. The return value is used even if the tab file execution
will fail.
Example
SET_RETURN_VALUE FALSE
§
RETURN
Returns from the program file with the specified value. This is
currently only used for the notification MDL_RENAME_PRE and
MDL_SAVE_PRE to avoid renaming or saving of a model.
Syntax
RETURN valueBOOL
Arguments

value
Boolean value which sets the return value.
Example
RETURN FALSE
§
MODIFY_COMPONENT
Executes the modify functionality of a former created component.
Syntax
MODIFY_COMPONENT refComponent<:in>
Arguments

refComponent
Existing reference to a component
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT comp
MODIFY_COMPONENT comp
§
COPY_COMPONENT
Executes the copy functionality of a former created component.
Syntax
COPY_COMPONENT refComponent<:in>
Arguments

refComponent
Existing reference to a component
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT comp
COPY_COMPONENT comp
§
DELETE_COMPONENT
Executes the delete functionality of a former created component.
Syntax
DELETE_COMPONENT refComponent<:in>
Arguments

refComponent
Existing reference to a component
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
This functionality works exactly like SmartAssembly > Component
Engine > Remove Component. Therefor only UDFs / components assembled
with SmartAssembly belonging to the selected SmartComponent will be
removed. Use REMOVE_COMPONENT to remove a normal component.
Example
USER_SELECT COMPONENT comp
DELETE_COMPONENT comp
§
About Commands for Runtime Information.
Commands for retrieving runtime information of the current program
file.
GET_TAB_NAME — to retrieves the name of the current program file
which is processed.
GET_TAB_LINE_NUM — to retrieve the current line number of the
program file which is processed.
GET_TAB_STACK — to retrieves the call stack for the current program
file.
GET_TAB_STACK_DEPTH — to retrieves the depth of the current call
stack.
§
GET_TAB_NAME
Retrieves the name of the current program file which is processed.
Syntax
GET_TAB_NAME [options] file_name<:out>
Arguments

options
The following options are supported:
INCLUDE_PATH valueBOOL — to specify if the path to the file should
be included. Default is FALSE.

INCLUDE_LINE valueBOOL — to specify if the file line number should


be included. Default is FALSE.

file_name
Name of the string variable which receives the file name and
eventually the path. The file extension is not included to avoid that
programs are none longer working correctly in upcoming encrypted or
binary program files.
Example
GET_TAB_NAME INCLUDE_PATH TRUE file_name
PRINT "Program file: %" file_name
§
GET_TAB_LINE_NUM
Retrieves the current line number of the program file which is
processed.
Syntax
GET_TAB_LIN_NUM line_num<:out>
Arguments

line_num
Name of the integer variable which receives the line number.
Example
GET_TAB_LINE_NUM line
PRINT "Current program line: %" line
§
GET_TAB_STACK
Retrieves the call stack for the current program file.
Syntax
GET_TAB_STACK [options] array_file_names<:out>
Arguments

options
The following options are supported:
INCLUDE_PATH valueBOOL — to specify if the path to the file should
be included. Default is FALSE.

INCLUDE_LINE valueBOOL — to specify if the file line number should


be included. Default is FALSE.

array_file_names
Name of array variable which receives the call stack. The file
extension is not included to avoid that programs are none longer
working correctly in upcoming encrypted or binary program files.
Example
GET_TAB_STACK INCLUDE_PATH TRUE arrayTabFiles
FOR tab_file REF ARRAY arrayTabFiles
PRINT "Program file: %" tab_file
END_FOR
§
GET_TAB_STACK_DEPTH
Retrieves the depth of the current call stack.
Syntax
GET_TAB_STACK_DEPTH depth<:out>
Arguments

depth
Name of the integer variable which receives the depth of the current
call stack.
Example
GET_TAB_STACK_DEPTH depth
PRINT "Depth of the call stack: %" depth
§
About Commands for Pro/NC
Commands for retrieving and setting information from and to Pro/NC
models. The following commands are available:
GET_NC_WORKCELL_PARAM — to receive the value of a NC workcell
parameter.
SET_NC_WORKCELL_PARAM — to set the value of a NC workcell
parameter.
GET_NUM_NC_HEADS — to get the number of heads in a NC workcell.
ADD_NC_HEAD — to add a NC head to an existing workcell.
GET_NC_HEAD_TOOL_SETUPS — to get the array of tool setups in a
workcell head.
GET_NC_TOOL_TIPS — to get the array of tool tips which are
associated to a tool setup.
IMPORT_NC_TOOL_XML — to import a NC tool definition from a XML
file.
EXPORT_NC_TOOL_XML — to export a NC tool definition to a XML file.
REMOVE_NC_TOOL_FROM_HEAD — to remove a tool from a NC workcell
head.
GET_ACTIVE_NC_OPERATION — to get the currently active NC operation
from a NC assembly.
GET_NC_OPERATION_PARAM — to receive the value of a NC operation
parameter.
SET_NC_OPERATION_PARAM — to set the value of a NC operation
parameter.
GET_NC_OPERATION_CSYS — to get the zero point coordinate system for
the operation program.
GET_NC_OPERATION_WORKCELL — to get the workcell for which a given
operation is defined.
GET_NC_OPERATION_STEPS — to get the steps of a NC operation.
GET_NC_OPERATION_RETRACT_SURFACE — to get the retract surface of a
NC operation.
GET_NC_STEP_PARAM — to gets the value of a NC step parameter.
SET_NC_STEP_PARAM — to set the value of a NC step parameter.
GET_NC_STEP_TOOL_SETUP — to get the tool setup assigned to a NC
step feature.
SET_NC_STEP_TOOL — to assign a tool to a NC step feature.
READ_NC_STEP — to get the description of an NC step feature.
MODIFY_NC_STEP — to redefine an NC step feature with the data from
a given NC_STEP structure.
GET_NC_STEP_LEGACY_STATE — to detect if a NC step was created in
Wildfire 5.0 or before.
EXPORT_NC_CL_FILE — to export a CL data file for a NC sequence or
an operation.
§
GET_NC_WORKCELL_PARAM
Gets the value of a NC workcell parameter.
Syntax
GET_NC_WORKCELL_PARAM feat_workcell<:in> "param_name"<:in>
param_value<:out>
Arguments

feat_workcell
A reference to a NC workcell feature.

param_name
A string expression specifying the desired parameter name.

param_value
The name of the variable, which will receive the parameter value.
Error handling
The program execution will be canceled if the feature could not be
found or the parameter not read, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_NC_WORKCELL_PARAM workcell "MACH_ID" mach_id
PRINT "%" mach_id
§
SET_NC_WORKCELL_PARAM
Sets the value of a NC workcell parameter.
Syntax
SET_NC_WORKCELL_PARAM feat_workcell<:in> "param_name"<:in>
param_value<:in>
Arguments

feat_workcell
Reference to the workcell feature, which contains the parameter.

param_name
A string expression specifying the name of the parameter.

param_value
The new value for the parameter. This can either be a math expression
or a string expression.
Error handling
The program execution will be canceled if the feature could not be
found or the parameter not set, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_NC_WORKELL_PARAM workcell "MACH_ID" 3
§
GET_NUM_NC_HEADS
Gets the number of heads in a NC workcell.
Syntax
GET_NUM_NC_HEADS feat_workcell<:in> num_heads<:out>
Arguments

feat_workcell
The workcell feature from which to retrieve the number of heads.

num_heads
The name of the output variable, which will receive the number of
heads in the workcell.
Error handling
The program execution will be canceled if the feature could not be
found or the number of heads not read, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_NUM_NC_HEADS workcell num_heads
PRINT "%" num_heads
§
ADD_NC_HEAD
Adds a NC head to an existing workcell.
Syntax
ADD_NC_HEAD feat_workcell<:in> [AT_INDEX indexINT]
Arguments

feat_workcell
The workcell feature to which the head should be added.

index
The zero-based position in the workcell at which the head should be
added. If the AT_INDEX option is not specified, the head will be
appended to the list of heads.
Error handling
The program execution will be canceled if the feature could not be
found or the new head not be added, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
ADD_NC_HEAD workcell AT_INDEX 0
§
GET_NC_HEAD_TOOL_SETUPS
Gets the list of tool setups in a workcell head.
Syntax
GET_NC_HEAD_TOOL_SETUPS feat_workcell<:in> head_numberINT
array_setups<:out>
Arguments

feat_workcell
A reference to the workcell feature, which contains the head.

head_number
The number of the head, starting at 1.

array_setups
The name of the output variable, which will receive an array holding
all the tool setups in the head. The array items are structures of
type NC_TOOL_SETUP.
Error handling
The program execution will be canceled if the feature could not be
found or the tool setups not be read, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_NC_HEAD_TOOL_SETUPS workcell 2 head_2_tool_setups
FOR setup REF ARRAY head_2_tool_setups
PRINT "%: %" setup.tool_position setup.tool_name
END_FOR
§
GET_NC_TOOL_TIPS
Gets the array of the tool tips which are associated to a tool setup.
Syntax
GET_NC_TOOL_TIPS tool_setup<:in> array_tool_tips<:out>
Arguments

tool_setup.
Structure variable of type NC_TOOL_SETUP for which the array of tool
tips should be retrieved.

array_setups
The name of the output variable, which will receive an array of the
tool tips. The array items are structures of type NC_TOOL_TIP.
Error handling
The program execution will be canceled if the tool tips could not be
read, unless errors are handled by BEGIN_CATCH_ERROR.
Example
READ_NC_STEP feature_step step
GET_NC_TOOL_TIPS step.tool_setup array_tips

FOR tip REF ARRAY array_tips


PRINT "comment: %" tip.comment
PRINT "offset_z: %" tip.offset_z
PRINT "offset_x: %" tip.offset.x
PRINT "angle: %" tip.angle
END_FOR
§
IMPORT_NC_TOOL_XML
Imports a NC tool definition from a XML file and assigns it to the
active workcell.
Syntax
IMPORT_NC_TOOL_XML [options] xml_path<:in> mfg_asm<:in>
head_numberINT tool_name<:out>
Arguments

options
Valid options are:
POCKET_NR valueINT — to specify the pocket number (tool number) for
the imported tool.

xml_path
Path to the XML file from which to import the tool definition.

mfg_asm
A reference to a manufacturing assembly in which the tool should be
created.

head_number
The number of the head, starting at 1.

tool_name
Variable which receives the name of the imported tool.
Error handling
The program execution will be canceled if the manufacturing assembly
could not be found or the XML file not be imported, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
RETRIEVE_MDL "some_mfg_assembly.asm" mfg_asm
IMPORT_NC_TOOL_XML "t0008.xml" mfg_asm 1 tool_name
PRINT "%" tool_name
§
EXPORT_NC_TOOL_XML
Exports a NC tool definition to a XML file.
Syntax
EXPORT_NC_TOOL_XML model<:in> "tool_name" out_file<:out>
Arguments

model
Reference to the model which contains the tool.

tool_name
Name of the tool.

out_file
Path where the exported XML file will be saved.
Error handling
The program execution will be canceled if the model could not be
found or the XML file not exported, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
RETRIEVE_MDL "some_mfg_model.asm" mfg_asm
EXPORT_NC_TOOL_XML mfg_asm "T0008" "t0008.xml"
§
REMOVE_NC_TOOL_FROM_HEAD
Removes a tool from a NC workcell head.
Syntax
REMOVE_NC_TOOL workcell<:in> head_number<:in> tool_position<:in>
"tool_name"
Arguments

workspace
A reference to the workcell feature, which contains the head from
which to remove the tool.

head_number
The number of the head within the workcell (starting at 1).out_file

tool_position
The position of the tool within the head.

tool_name
The name of the tool to be removed.
Error handling
The program execution will be canceled if the feature could not be
found or the tool not removed, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REF THIS FEATURE "some_workcell" workcell
REMOVE_NC_TOOL_FROM_HEAD workcell 1 2 "T0008"
§
GET_ACTIVE_NC_OPERATION
Gets the currently active NC operation from a NC assembly.
Syntax
GET_ACTIVE_NC_OPERATION assembly<:in> operation<:out>
Arguments

assembly
A reference to the assembly from which the active operation should be
retrieved. Can be THIS, ASSEMBLY etc. just like with SEARCH_MDL_REF
etc.

operation
The name of the output variable, which should receive the reference
to the operation.
Error handling
The program execution will be canceled if assembly the could not be
found or not active operation is available, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
GET_ACTIVE_NC_OPERATION THIS operation
PRINT "%" operation
§
GET_NC_OPERATION_PARAM
Gets the value of a NC operation parameter.
Syntax
GET_NC_OPERATION_PARAM feat_operation<:in> "param_name"<:in>
param_value<:out>
Arguments

feat_operation
A reference to a NC operation feature.

param_name
A string expression specifying the desired parameter name.

param_value
The name of the variable, which will receive the parameter value.
Error handling
The program execution will be canceled if the feature could not be
found or the parameter not read, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_NC_OPERATION_PARAM operation "ROTARY_X" rotary_x
PRINT "%" rotary_x
§
SET_NC_OPERATION_PARAM
Sets the value of a NC operation parameter.
Syntax
SET_NC_OPERATION_PARAM feat_operation<:in> "param_name"<:in>
param_value<:in>
Arguments

feat_operation
Reference to the operation feature, which contains the parameter.

param_name
A string expression specifying the name of the parameter.

param_value
The new value for the parameter. This can either be a math expression
or a string expression.
Error handling
The program execution will be canceled if the feature could not be
found or the parameter not set, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_NC_OPERATION_PARAM operation "ROTARY_X" 15.0
§
GET_NC_OPERATION_CSYS
Gets the zero point coordinate system for the operation program.
Syntax
GET_NC_OPERATION_CSYS feat_operation<:in> op_csys<:out>
Arguments

feat_operation
Reference to the operation feature for which to get the coordinate
system.

op_csys
Name of the output variable, which should receive the reference to
the operation coordinate system.
Error handling
The program execution will be canceled if the feature could not be
found or the csys not determined, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_NC_OPERATION_CSYS operation op_csys
§
GET_NC_OPERATION_WORKCELL
Gets the workcell for which a given operation is defined.
Syntax
GET_NC_OPERATION_WORKCELL feat_operation<:in> workcell<:out>
Arguments

feat_operation
Reference to the operation feature for which to get the related
workcell.

workcell
Name of the output variable, which should receive the resulting
workcell reference.
Error handling
The program execution will be canceled if the feature could not be
found or the workcell not determined, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_NC_OPERATION_WORKCELL operation workcell
GET_FEATURE_TYPE workcell feat_type
PRINT "Type: %" feat_type
§
GET_NC_OPERATION_STEPS
Gets the steps of a NC operation.
Syntax
GET_NC_OPERATION_STEPS feat_operation<:in> steps<:out>
Arguments

feat_operation
Reference to the operation feature.

steps
The name of the output array variable in which the references to the
step features will be stored.
Error handling
The program execution will be canceled if the feature could not be
found or the steps not read, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_NC_OPERATION_STEPS operation steps
FOR step REF ARRAY steps
PRINT "%" step
END_FOR
§
GET_NC_OPERATION_RETRACT_SURFACE
Gets the retract surface of a NC operation.
Syntax
GET_NC_OPERATION_RETRACT_SURFACE feat_operation<:in>
retract_surface_struct<:out>
Arguments

feat_operation
Reference to the operation feature.

retract_surface_struct
The name of the output variable, which should receive the
NC_RETRACT_SURFACE structure.
Error handling
The program execution will be canceled if the operation feature could
not be found or the retract surface not read, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
GET_NC_OPERATION_RETRACT_SURFACE feature_operation retract_surface
PRINT "type: %" retract_surface.type
PRINT "surface: %" retract_surface.surface
PRINT "orient: %" retract_surface.orient
PRINT "value: %" retract_surface.value
§
GET_NC_STEP_PARAM
Gets the value of a NC step parameter.
Syntax
GET_NC_STEP_PARAM feat_step<:in> "param_name"<:in> value<:out>
Arguments

feat_step
The step feature from which the parameter value should be retrieved.

param_name
A string expression specifying the parameter’s name.

value
The name of the output variable, which will receive the parameter’s
value
Error handling
The program execution will be canceled if the feature could not be
found or the parameter not read, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_NC_STEP_PARAM step "CUT_FEED" cut_feed_value
PRINT "%" cut_feed_value
§
SET_NC_STEP_PARAM
Sets the value of a NC step parameter.
Syntax
SET_NC_STEP_PARAM feat_step<:in> "param_name"<:in> value<:in>
Arguments

feat_step
A reference to the step feature, which contains the parameter.

param_name
A string expression specifying the name of the parameter.

value
The new value. This can be a math or a string expression.
Error handling
The program execution will be canceled if the feature could not be
found or the parameter not set, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_NC_STEP_PARAM step "CUT_FEED" 5
§
GET_NC_STEP_TOOL_SETUP
Gets the tool setup assigned to a NC step feature.
Syntax
GET_NC_STEP_TOOL_SETUP feat_step<:in> tool_setup<:out>
Arguments

feat_step
Reference to the step feature for which to get the tool setup.

tool_setup
Name of the output variable, which should receive the NC_TOOL_SETUP
structure.
Error handling
The program execution will be canceled if the feature could not be
found or the tool setup not read, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_NC_STEP_TOOL_SETUP step tool_setup
PRINT "Tool Name: %" tool_setup.tool_name
PRINT "Workcell: %" tool_setup.workcell
PRINT "Head number: %" tool_setup.head_number
PRINT "Position in head: %" tool_setup.position
§
SET_NC_STEP_TOOL
Assigns a tool to a NC step feature.
Syntax
SET_NC_STEP_TOOL feat_step<:in> head_number<:in> tool_position<:in>
tool_name<:in>
Arguments

feat_step
Reference to the step feature, to which the tool should be assigned.

head_number
Number of the head (belonging to the step's workcell) which contains
the tool to set. Counting of heads starts at 1.

tool_position
Position of the tool within the head.

tool_name
Name of the tool
Error handling
The program execution will be canceled if the feature could not be
found or the step tool not assigned, unless errors are handled by
BEGIN_CATCH_ERROR.
There are various reasons why assigning the step tool could fail. One
is a combination of different manufacturing processes (e.g. assign a
milling tool to a turning step). Due to a limitation in Creo, the
tool can only be assigned to the step, if all other mandatory
attributes of the step (parameters, machining references etc.) are
set.
Example
SET_NC_STEP_TOOL step 1 2 "T0008"
§
READ_NC_STEP
Gets the description of an NC step feature.
Syntax
READ_NC_STEP [options] feat_step<:in> step_struct<:out>
Arguments

options
The following options are supported:
INCLUDE_DEFAULT_PARAMS include BOOL — determines if also parameters
with default values should be included. Default is FALSE.

feat_step
Reference to the step feature for which to receive the NC step
information.

step_struct
Name of the output variable, which should receive the NC_STEP
structure.
Error handling
The program execution will be canceled if the feature could not be
found or the information not read, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
READ_NC_STEP step step_struct
PRINT "Tool Name: %" step_struct.tool_setup.tool_name
§
MODIFY_NC_STEP
Redefines an NC step feature with the data from a given NC_STEP
structure.
Syntax
MODIFY_NC_STEP feat_step<:in> step_struct<:out>
Arguments

feat_step
Reference to the step feature, which should be modified.

step_struct
NC_STEP structure with the step data.
Error handling
The program execution will be canceled if the feature could not be
found or the step not modified, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Creo uses a legacy internal representation for some steps (those,
which use the menu manager). For those steps, a possible double
parameter value of -1.0 or a string parameter value of “-“ can not be
distinguished from the internal representation of an unset value
(which happens to be -1.0 for double or “-“ for string parameters).
To avoid unwanted side-effects, the MODIFY_NC_STEP command does not
support setting parameters to those values, if the step uses said
internal representation.
Example
READ_NC_STEP step step_data
ADD_MAP_ELEM step_data.parameters "NCL_FILE" "file.ncl"
MODIFY_NC_STEP step step_data
§
GET_NC_STEP_LEGACY_STATE
Detects if a NC step feature was created in Wildfire 5.0 or before.
In this case some information could not be retrieved or modified.
Syntax
GET_NC_STEP_LEGACY_STATE feat_step<:in> legacy_state<:out>
Arguments

feat_step
Reference to a step feature.

legacy_state
Name of the boolean variable which should receive the legacy state.
Error handling
The program execution will be canceled if the feature could not be
found or the legacy state not detected, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_NC_STEP_LEGACY_STATE feature_step state
PRINT "state: %" state
§
EXPORT_NC_CL_FILE
Exports a CL data file for NC sequences or operations.
Syntax
EXPORT_NC_CL_FILE feat_step_or_operation<:in> export_operationBOOL
"file_name"
Arguments

feat_step_or_operation
Reference to the NC sequence or operation feature to export.

export_operation
Boolean variable to determine if the operation or the sequence
feature should be exported.

file_name
Name and path for the file which should be exported. See path
specifications for details.
Error handling
The program execution will be canceled if the feature could not be
found or the export fails, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
In case the variable feature contains a sequence and the variable
export_operation is set to FALSE, the operation for the sequence is
used as output.
Example
USER_SELECT FEATURE featSequence
EXPORT_NC_CL_FILE featSequence TRUE "operation.ncl"
EXPORT_NC_CL_FILE featSequence FALSE "sequence.ncl"
§
About Commands for Pro/PIPING
Commands for retrieving information from Pro/PIPING models. The
following commands are available:
GET_PIPELINE — to retrieve the pipeline feature of a model.
SEARCH_LINESTOCK_PARAM — to read single value linestock parameters
from a pipeline feature.
SEARCH_LINESTOCK_PARAM_EX — to read multi value linestock
parameters from a pipeline feature.
SET_LINESTOCK_PARAM — to set single value linestock parameters of a
pipeline feature.
SET_LINESTOCK_PARAM_EX — to set multi value linestock parameters of
a pipeline feature.
Also the option PIPELINE_MEMBER for a for loop can be used to iterate
all instances of a family table.
§
GET_PIPELINE
Retrieves the pipeline feature of a model.
Syntax
GET_PIPELINE refMdl<:in> refFeaturePipeline<:out>
Arguments

refMdl
Reference to an existing model.

refFeaturePipeline
Reference which will receive the pipeline feature.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS RECURSIVE ASSEMBLY MODEL * allComps
FOR comp REF ARRAY allComps
IF PIPELINE_MEMBER comp
GET_MDL_NAME comp name
GET_PIPELINE comp pipeline
SEARCH_LINESTOCK_PARAM pipeline STOCKNO stock_numer
SEARCH_LINESTOCK_PARAM pipeline MATERIAL material
SEARCH_LINESTOCK_PARAM pipeline od outer_diameter
PRINT "pipeline member: % No: % mat: % dia: %" name
stock_number material outer_diameter
END_IF
END_FOR
§
SEARCH_LINESTOCK_PARAM
Searches for single value linestock parameters of in a pipeline
feature. In case of a multi value parameter, only the first value is
returned.
Syntax
SEARCH_LINESTOCK_PARAM refFeaturePipeline<:in> "name" parameter<:out>
Arguments

refFeaturePipeline
Reference to a pipeline feature.

name
Name of the linestock parameter. Any string expression is allowed.

parameter
Parameter which will receive the content of the linestock parameter.
Error handling
The program execution will be canceled if the reference to the
pipeline feature is not valid or the linestock parameter could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS RECURSIVE ASSEMBLY MODEL * allComps
FOR comp REF ARRAY allComps
IF PIPELINE_MEMBER comp
GET_MDL_NAME comp name
GET_PIPELINE comp pipeline
SEARCH_LINESTOCK_PARAM pipeline "STOCKNO" stock_numer
SEARCH_LINESTOCK_PARAM pipeline "MATERIAL" material
SEARCH_LINESTOCK_PARAM pipeline "od" outer_diameter
PRINT "pipeline member: % No: % mat: % dia: %" name
stock_number material outer_diameter
END_IF
END_FOR
§
SEARCH_LINESTOCK_PARAM_EX
Searches for a linestock parameter of in a pipeline feature and
return all values in an array.
Syntax
SEARCH_LINESTOCK_PARAM_EX refFeaturePipeline<:in> "name"
array_values<:out>
Arguments

refFeaturePipeline
Reference to a pipeline feature.

name
Name of the linestock parameter. Any string expression is allowed.

array_values
Array which will receives all values of the linestock parameter.
Error handling
The program execution will be canceled if the reference to the
pipeline feature is not valid or the linestock parameter could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS RECURSIVE ASSEMBLY MODEL * allComps
FOR comp REF ARRAY allComps
IF PIPELINE_MEMBER comp
GET_MDL_NAME comp name
GET_PIPELINE comp pipeline
SEARCH_LINESTOCK_PARAM_EX pipeline "BEND_ANGLE" arrayAngles
FOR angle REF ARRAY arrayAngles
PRINT "Bend Angle: %" angle
END_FOR
END_IF
END_FOR
§
SET_LINESTOCK_PARAM
Sets the value for single value linestock parameters. In case of a
multi value linestock parameter only the first value will be set.
Syntax
SET_LINESTOCK_PARAM refFeaturePipeline<:in> "name" valueSTRNUM
Arguments

refFeaturePipeline
Reference to a pipeline feature.

name
Name of the linestock parameter. Any string expression is allowed.

value
Value which should be set to the linestock parameter. Any string
expression or math expression is allowed.
Error handling
The program execution will be canceled if the reference to the
pipeline feature is not valid or the linestock parameter could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS RECURSIVE ASSEMBLY MODEL * allComps
FOR comp REF ARRAY allComps
IF PIPELINE_MEMBER comp
GET_MDL_NAME comp name
GET_PIPELINE comp pipeline
SET_LINESTOCK_PARAM pipeline "OD" 100
END_IF
END_FOR
§
SET_LINESTOCK_PARAM_EX
Sets multi values for a linestock parameter.
Syntax
SET_LINESTOCK_PARAM_EX refFeaturePipeline<:in> "name"
array_values<:in>
Arguments

refFeaturePipeline
Reference to a pipeline feature.

name
Name of the linestock parameter. Any string expression is allowed.

array_values
Array of values which should be set to the linestock parameter.
Error handling
The program execution will be canceled if the reference to the
pipeline feature is not valid or the linestock parameter could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_ARRAY arrayAngles
SET_ARRAY_ELEM arrayAngles 15
SET_ARRAY_ELEM arrayAngles 30
SET_ARRAY_ELEM arrayAngles 45

SEARCH_MDL_REFS RECURSIVE ASSEMBLY MODEL * allComps


FOR comp REF ARRAY allComps
IF PIPELINE_MEMBER comp
GET_MDL_NAME comp name
GET_PIPELINE comp pipeline
SET_LINESTOCK_PARAM pipeline "BEND_ANGLE" arrayAngles
END_IF
END_FOR
§
About Commands for Pro/SHEETMETAL
Commands for Pro/SHEETMETAL models. The following commands are
available:
SET_SMT_MDL_BENDTABLE — to apply a bend table to a sheet metal
model.
SET_SMT_FEAT_BENTABLE — to apply a bend table to a sheet metal
feature.
GET_SMT_SURFACE_TYPE — to determine the type of a sheet metal
surface.
GET_SMT_SURFACE_OPPOSITE — to determine the opposite surface of a
sheet metal surface.
GET_SMT_BEND_SURFACE_PROPS — to determine the properties of a bend
surface.
GET_SMT_BEND_SURFACE_PARENT — to determine the most recent parent
surface of the specified bend / unbend surface.
GET_SMT_BEND_SURFACE_CHILD — to determine the most recent child
surface of the specified bend / unbend surface.
GET_SMT_EDGE_OPPOSITE — to determine the opposite edge of a sheet
metal model.
GET_SMT_BEND_EDGE_PARENT — to determine the most recent parent edge
of the specified bend / unbend operation.
GET_SMT_BEND_EDGE_CHILD — to determine the most recent child
surface of the specified bend / unbend operation.
GET_SMT_UNBEND_FIXED_REF — to determine the fixed geometry
reference of an unbend or flat pattern feature.
CONVERT_TO_SMT — to convert a solid part to a sheetmetal part.
SUGGEST_SMT_FIXED_SURFACE — to get a suggestion for a fixed surface
candidate.
CREATE_SMT_FLAT_PATTERN — to create a flat pattern feature.
CREATE_SMT_FORM — to create a punch or die form feature.
READ_SMT_FORM — read the definition of a punch or die form feature.
§
SET_SMT_MDL_BENDTABLE
Applies a bend table to a Pro/SHEETMETAL part. The Pro/ENGINEER bend
table must not include periods after the file extension (sample.bnd
intead of sample.bnd.1).
Syntax
SET_SMT_MDL_BENDTABLE model "bendtable" [option]
Arguments

model
Model for which the bend table should be applied according to model
specification.

bendtable
Specifies the bend table which should be applied. According to the
path specification it could be either in library or in working
directory. Any string expression is allowed.

option
The following options are available:
TABLE_FROM_PART — the table is read from the part instead from hard
disk.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_SMT_MDL_BENDTABLE THIS "lib:sample.bnd"
§
SET_SMT_FEAT_BENDTABLE
Applies a bend table to a Pro/SHEETMETAL bend or wall feature. The
Pro/ENGINEER bend table must not include periods after the file
extension (sample.bnd intead of sample.bnd.1).
Syntax
SET_SMT_FEAT_BENDTABLE refFeature<:in> "bendtable" [option]
Arguments

feature
Reference to a feature for this the bend table should be applied.

bendtable
Specifies the bend table which should be applied. According to the
path specification it could be either in library or in working
directory. Any string expression is allowed.

option
The following options are available:
TABLE_FROM_PART — the table is read from the part instead from hard
disk.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
SET_SMT_FEAT_BENDTABLE feat"lib:sample.bnd"
§
GET_SMT_SURFACE_TYPE
Gets the type of a sheet metal surface.
Syntax
GET_SMT_SURFACE_TYPE reference<:in> paramType<:out>
Arguments

reference
Existing reference of a surface.

paramType
Name of the parameter which should receive the information. The
content will be one of the sheet metal surface types.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SEARCH_DRW_VIEW THIS "MAIN" 1 view
GET_DRW_VIEW_NORM_SURFACES view arrayNormSurfaces
FOR surface REF ARRAY arrayNormSurfaces
GET_SMT_SURFACE_TYPE surface type
PRINT "%" type
END_FOR
§
GET_SMT_SURFACE_OPPOSITE
Determines the opposite surface of a sheet metal surface. The
function provides the white side if the green was supplied and vice
versa. For any other references the function will fail.
Syntax
GET_SMT_SURFACE_OPPOSITE refSurface<:in> refSurfaceOpp<:out>
Arguments

refSurface
Existing reference of a surface.

refSurfaceOpp
Variable which receives the reference to the opposite surface.
Error handling
The program execution will be canceled if the reference does not
exist or the opposite surface could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE refSurface
GET_SMT_SURFACE_OPPOSITE refSurface refSurfaceOpposite
SET_COLOR refSurface 255 0 0
SET_COLOR refSurfaceOpposite 255 0 0
§
GET_SMT_BEND_SURFACE_PROPS
Determines the properties of a bend surface.
Syntax
GET_SMT_BEND_SURFACE_PROPS refBendSurface<:in> propsBendSurface<:out>
Arguments

refBendSurface
Existing reference of a bend surface.

propsBendSurface
Structure variable of type SMT_BEND_SURFACE_PROPS which receives the
properties of a bend surface.
Error handling
The program execution will be canceled if the reference does not
exist or the properties could not be determined, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE refSurface
GET_SMT_BEND_SURFACE_PROPS refSurface surface_props
PRINT "radius: %" surface_props.radius
PRINT "angle: %" surface_props.angle
PRINT "length: %" surface_props.length
§
GET_SMT_BEND_SURFACE_PARENT
Determines the most recent parent surface of the specified bend /
unbend surface.
Syntax
GET_SMT_BEND_SURFACE_PARENT refSurface<:in> refParentSurface<:out>
Arguments

refSurface
Existing reference of a bend / unbend surface.

refParentSurface
Variable which receives the parent surface.
Error handling
The program execution will be canceled if the reference does not
exist or if the parent could not be found, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE refSurface
GET_SMT_BEND_SURFACE_PARENT refSurface refSurfaceParent
PRINT "Parent is: %" refSurfaceParent
§
GET_SMT_BEND_SURFACE_CHILD
Determines the most recent child surface of the specified bend /
unbend surface.
Syntax
GET_SMT_BEND_SURFACE_CHILD refSurface<:in> refChildSurface<:out>
Arguments

refSurface
Existing reference of a bend / unbend surface.

refChildSurface
Variable which receives the child surface.
Error handling
The program execution will be canceled if the reference does not
exist or the child surface could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE refSurface
GET_SMT_BEND_SURFACE_CHILD refSurface refSurfaceChild
PRINT "Child is: %" refSurfaceChild
§
GET_SMT_EDGE_OPPOSITE
Determines the opposite edge of a sheet metal Model. The function
provides the white side if the green was supplied and vice versa. For
any other references the function will fail.
Syntax
GET_SMT_EDGE_OPPOSITE refEdge<:in> refEdgeOpp<:out>
Arguments

refEdge
Existing reference of an edge.

refEdgeOpp
Variable which receives the reference to the opposite edge.
Error handling
The program execution will be canceled if the reference does not
exist or the opposite edge could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT EDGE refEdge
GET_SMT_EDGE_OPPOSITE refEdge refEdgeOpposite
SET_COLOR refEdge 255 0 0
SET_COLOR refEdgeOpposite 255 0 0
§
GET_SMT_BEND_EDGE_PARENT
Determines the most recent parent edge of the specified bend / unbend
operation.
Syntax
GET_SMT_BEND_EDGE_PARENT refEdge<:in> refParentEdge<:out>
Arguments

refEdge
Existing reference of an bend / unbend edge.

refParentEdge
Variable which receives the parent edge.
Error handling
The program execution will be canceled if the reference does not
exist or if the parent could not be found, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT EDGE refEdge
GET_SMT_BEND_EDGE_PARENT refEdge refEdgeParent
PRINT "Parent is: %" refEdgeParent
§
GET_SMT_BEND_EDGE_CHILD
Determines the most recent child edge of the specified bend / unbend
operation.
Syntax
GET_SMT_BEND_EDGE_CHILD refEdge<:in> refChildEdge<:out>
Arguments

refEdge
Existing reference of an bend / unbend edge.

refChildEdge
Variable which receives the child edge.
Error handling
The program execution will be canceled if the reference does not
exist or the child could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT EDGE refEdge
GET_SMT_BEND_EDGE_CHILD refEdge refSurfaceEdge
PRINT "Child is: %" refEdgeChild
§
GET_SMT_UNBEND_FIXED_REF
Determines the fixed reference of an unbend or flat pattern feature.
Syntax
GET_SMT_UNBEND_FIXED_REF refUnbend<:in> is_flat_pattern<:out>
refFixedGeometry<:out>
Arguments

refUnbend
Existing reference of an unbend or flat pattern feature.

is_flat_pattern
Boolean variable which receives the information if the feature is a
flat pattern.

refFixedGeometry
Variable which receives the reference to the fixed geometry..
Error handling
The program execution will be canceled if the unbend feature does not
exist or the fixed reference could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SEARCH_MDL_REFS PART FEATURE_TYPE "UNBEND" allUnbends
SEARCH_MDL_REFS PART FEATURE_TYPE "FLAT_PAT" allUnbends

FOR unbend REF ARRAY allUnbends


GET_SMT_UNBEND_FIXED_REF unbend is_flat_pattern srf
PRINT "is_flat_pattern: %" is_flat_pattern
PRINT "fixed geom: %" srf
END_FOR
§
CONVERT_TO_SMT
Converts a solid part to a sheetmetal part by specifying its driving
surface and thickness.
Syntax
CONVERT_TO_SMT refDrvSurface<:in> thicknessDOUBLE
feature_first_wall<:out>
Arguments

refDrvSurface
Reference to the intended driving surface.

thickness
Value for the sheetmetal thickness. Any math expression is allowed.

feature_first_wall
Name of the variable which will receive the reference to the first
wall sheetmetal feature.
Error handling
The program execution will be canceled if the driving surface
reference does not exist or the conversion fails, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
If the owner of the driving surface is already a sheetmetal part, the
command just will deliver the reference to the first wall sheetmetal
feature. In case the specified value for thickness is less or equal
to zero, the thickness will be calculated.
Example
USER_SELECT SURFACE drvSurface
CONVERT_TO_SMT drvSurface 0 firstWall
PRINT "%" firstWall
§
SUGGEST_SMT_FIXED_SURFACE
Suggests a fixed surface candidate similar to the behavior when a
sheetmetal flat pattern is created manually.
Syntax
SUGGEST_SMT_FIXED_SURFACE model refFixedSurface<:out>
Arguments

model
Model for which a fixed surface candidate should be suggested
according to model specification.

refFixedSurface
Name of the variable which should received the reference to the
suggested fixed surface.
Error handling
The program execution will be canceled if the model does not exist or
a fixed surface candidate could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
SUGGEST_SMT_FIXED_SURFACE PART srf
CREATE_SMT_FLAT_PATTERN srf feat
§
CREATE_SMT_FLAT_PATTERN
Creates a sheetmetal flat pattern based on a reference to the fixed
surface.
Syntax
CREATE_SMT_FLAT_PATTERN refFixedSurface<:in> refFeature<:out>
Arguments

refFixedSurface
Existing reference to the fixed surface.

refFeature
Name of the variable which should receive the reference to the
created flat pattern feature.
Error handling
The program execution will be canceled if the fixed surface does not
exist or the flat pattern feature could not be created, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
SUGGEST_SMT_FIXED_SURFACE PART srf
CREATE_SMT_FLAT_PATTERN srf feat
§
CREATE_SMT_FORM
Creates a punch or die form feature.
Syntax
CREATE_SMT_FORM mdl_form<:in> target<:in> array_constraints<:in>
form_options<:in> refFormFeature<:out>
Arguments

mdl_form
The model which is used to create the punch or die form.

target
The sheetmetal model to which the form model is applied to.

array_constraints
Existing array with structure elements of type CONSTRAINT.

form_options
Structure variable of type SMT_FORM_OPTION to define the punch or die
form.

refFormFeature
Name of the variable which should receive the reference to the
created form feature.
Error handling
The program execution will be canceled if the form model, the target
or the constraints array are not existing or if the form feature
could not be created, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_STRUCT CONSTRAINT constraint
constraint.index = 0
constraint.type = CSYS
SEARCH_MDL_REF PART CSYS "*" constraint.assembly_ref
SEARCH_MDL_REF punch CSYS "PUNCH_FORM" constraint.component_ref

DECLARE_ARRAY arrayConstraints
ADD_ARRAY_ELEM arrayConstraints constraint

DECLARE_STRUCT SMT_FORM_OPTION options


options.punch = TRUE
options.side_offset = TRUE
options.merge = TRUE

CREATE_SMT_FORM punch PART arrayConstraints options feature


§
READ_SMT_FORM
Reads the definition of a punch or die form feature. This command
does not work for legacy form features which have originally been
created in Wildfire 4.0 or before.
Syntax
READ_SMT_FORM refFormFeature<:in> mdl_form<:out>
array_constraints<:out> form_options<:out>
Arguments

refFormFeature
Existing punch for die form feature.

mdl_form
Variable which will receive the reference to the model for which the
form feature was created.

array_constraints
Variable of type array which receives the placement constraints with
elements CONSTRAINT.

form_options
Structure variable of type SMT_FORM_OPTION to receive the punch or
die form definition.
Error handling
The program execution will be canceled if the form feature does not
exist or if the information could not be retrieved, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE feat
USER_SELECT CSYS csys

READ_SMT_FORM feat form constraints options

GET_ARRAY_ELEM constraints 0 constraint


constraint.assembly_ref = csys
SET_ARRAY_ELEM constraints 0 constraint

CREATE_SMT_FORM form ASSEMBLY constraints options feature


§
About Commands for Pro/PROGRAM
Commands for retrieving, adding and removing information from
Pro/PROGRAM models. The following commands are available:
EXPORT_PRO_PROGRAM — to export the Pro/PROGRAM information of a
model.
IMPORT_PRO_PROGRAM — to import the Pro/PROGRAM information to a
model.
GET_PRO_PROGRAM_INPUT — to retrieve the input section of a
Pro/Program from a model.
SET_PRO_PROGRAM_INPUT — to set the input section of a Pro/Program
to a model.
DELETE_PRO_PROGRAM_INPUT — to delete the complete input section of
a Pro/Program from a model.
§
EXPORT_PRO_PROGRAM
Exports the Pro/PROGRAM information of a model like Tools > Model
Intent > Program > Edit Design.
Syntax
EXPORT_PRO_PROGRAM refMdl<:in> "filename"
Arguments

refMdl
Reference to an existing model.

filename
Name and path for the file which should be exported. See path
specifications for details.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
EXPORT_PRO_PROGRAM PART "proprogram.txt"
§
IMPORT_PRO_PROGRAM
Import the Pro/PROGRAM information of a model like Tools > Model
Intent > Program > Edit Design.
Syntax
IMPORT_PRO_PROGRAM refMdl<:in> "filename"<:in>
Arguments

refMdl
Reference to an existing model.

filename
Name and path for the file which should be imported. See path
specifications for details.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
EXPORT_PRO_PROGRAM PART program.txt
STOP_EX
IMPORT_PRO_PROGRAM PART program.txt
§
GET_PRO_PROGRAM_INPUT
Retrieves the input section information of Pro/PROGRAM from a model.
Syntax
GET_PRO_PROGRAM_INPUT refMdl<:in> arrayInputLines<:out>
Arguments

refMdl
Reference to an existing model.

arrayInputLines
Name of the array which will receive the input lines from
Pro/PROGRAM.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_PRO_PROGRAM_INPUT PART arrayInputLines
FOR inputLine REF ARRAY arrayInputLines
PRINT "%" inputLine
END_FOR
§
SET_PRO_PROGRAM_INPUT
Sets the input section information of Pro/PROGRAM from a model.
Syntax
SET_PRO_PROGRAM_INPUT refMdl<:in> arrayInputLines<:in>
Arguments

refMdl
Reference to an existing model.

arrayInputLines
Existing array with strings which represent the input lines.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_ARRAY inputs
ADD_ARRAY_ELEM inputs "LENGTH NUMBER"
ADD_ARRAY_ELEM inputs "HEIGHT NUMBER"
SET_PRO_PROGRAM_INPUT PART inputs
§
DELETE_PRO_PROGRAM_INPUT
Delete the complete input section information of Pro/PROGRAM from a
model.
Syntax
DELETE_PRO_PROGRAM_INPUT refMdl<:in>
Arguments

refMdl
Reference to an existing model´.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DELETE_PRO_PROGRAM_INPUT PART
§
About Multi Body Support
Multi Body support starts in Creo 7.0, therefor all related commands
require Creo 7.0 and above.
Basic Multi Body Commands — to perform basic body operations.
Material Multi Body Commands — to inquire or assign material to a
body.
Interference control
Interference control for bodies is supported by the FOR loop option
INTERF_BODY. The logical conditions INTERF and INTERF_REC can be used
to test for collision between two bodies or between bodies and parts.
Body parameters
The following commands can be used to access body parameters if the
reference of type body:
SEARCH_REF_PARAM — to search for a parameter on a body.
SEARCH_REF_PARAM_NAME — to search for a body parameter of a
specific name.
SEARCH_REF_PARAM_NAMES — to search for body parameters of a
specific name.
SEARCH_ENUMERATED_REF_PARAM_NAME — to search for a restricted
enumerated body parameter of a specific name.
SEARCH_ENUMERATED_REF_PARAM_NAMES — to search for a restricted
enumerated body parameter of a specific name.
SET_REF_PARAM — to create or modify a parameter on a body.
DELETE_REF_PARAM — to delete a parameter from a body.
GET_REF_PARAM_LOCK_STATUS — to read the lock status of a body
parameter.
SET_REF_PARAM_LOCK_STATUS — to set the lock status of a body
parameter.
GET_REF_PARAM_DESCRIPTION — to read the description of a body
parameter.
SET_REF_PARAM_DESCRIPTION — to set the description of a body
parameter.
GET_ENUMERATED_REF_PARAM_VALUES — to retrieve all values for a
restricted enumerated body parameter.
§
About Basic Multi Body Commands
Commands for working with multi bodies in solid models for Creo 7.0
and above. The following commands are available:
CREATE_BODY — to create a new body in a solid model.
DELETE_BODY — to delete an existing body from a solid model.
GET_DEFAULT_BODY — to retrieve the default body of a solid model.
SET_DEFAULT_BODY — to set the default body in a solid model.
GET_CONSTRUCTION_BODY_FLAG — to retrieve the information if a body
is set as construction body.
SET_CONSTRUCTION_BODY — to set a body to construction body.
SEARCH_BODY_REF — to search for a reference in a specified body.
SEARCH_BODY_REFS — to search for references in a specified body.
GET_BODY_FROM_REF — to retrieve the body which is associated with a
reference.
BOOLEAN_BODY_OPERATION — to perform a boolean body operation to
merge, intersect or subtract existing bodies.
CONVERT_BODY_TO_SMT — to convert a solid body to sheetmetal.
§
CREATE_BODY
Creates a new body in the solid model. The command requires Creo 7.0
or above.
Syntax
CREATE_BODY model body<:out>
Arguments

model
Existing reference for a model.

body
Variable which receives the reference to the new body.
Error handling
The program execution will be canceled if the model does not exist or
if creating the body fails, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
CREATE_BODY PART body
SET_REF_NAME body "new_body"
§
DELETE_BODY
Deletes an existing empty body of the solid model. The command
requires Creo 7.0 or above.
Syntax
DELETE_BODY body<:in>
Arguments

body
Existing reference to a body.
Error handling
The program execution will be canceled if the body does not exist or
if it could not be delete, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT BODY body
DELETE_BODY body
§
GET_DEFAULT_BODY
Retrieves the default body of a solid model. The command requires
Creo 7.0 or above.
Syntax
GET_DEFAULT_BODY model body<:out>
Arguments

model
Existing reference for a model.

body
Variable which receives the reference to the default body.
Error handling
The program execution will be canceled if the model does not exist or
if the default body could not be retrieved, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
GET_DEFAULT_BODY PART body
SET_REF_NAME body "new_body"
§
SET_DEFAULT_BODY
Sets the default body of the solid model. The command requires Creo
7.0 or above.
Syntax
SET_DEFAULT_BODY body<:in>
Arguments

body
Existing reference to a body.
Error handling
The program execution will be canceled if the body does not exist or
if it could not be set as default, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT BODY body
SET_DEFAULT_BODY body
§
GET_CONSTRUCTION_BODY_FLAG
Retrieves the information if a body is set as construction body. The
command requires Creo 7.0 or above.
Syntax
GET_CONSTRUCTION_BODY_FLAG_BODY body<:in> flag<:out>
Arguments

body
Existing reference to a body.

flag
Boolean variable which receives the information whether the body is
set as construction or not.
Error handling
The program execution will be canceled if the body does not exist or
the flag could not be determined, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT BODY body
GET_CONSTRUCTION_BODY_FLAG body flag
PRINT "Is construction body: %" flag
§
SET_CONSTRUCTION_BODY
Sets a body to construction. The command requires Creo 7.0 or above.
Syntax
SET_CONSTRUCTION_BODY body<:in>
Arguments

body
Existing reference to a body.
Error handling
The program execution will be canceled if the body does not exist or
if it could not be set to construction, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT BODY body
SET_CONSTRUCTION_BODY body
§
SEARCH_BODY_REF
Searches for a named reference in a specified body. The command
requires Creo 7.0 or above.
Syntax:
SEARCH_BODY_REF [options] refBody<:in> type "search_string"
[WITH_CONTENT content_type "content_value"] reference<:out>
Arguments

options
Valid options are:
NO_UPDATE — avoids automatic updating of the reference in case its
model will be assembled.

refBody
Reference to an existing body.

type
The specified reference type.

search_string
This is the Creo name of the reference to search for. Any string
expression is allowed. The reference name could also be specified by
the use of wildcards.
Another technique is to identify a geometrical item by its id. This
could be done by GID:number as search string. For example GID:9.

WITH_CONTENT
An optional WITH_CONTENT / WITH_CONTENT_NOT clause can follow, to
filter for specific variable content.

reference
Name of the reference which should receive the information.
Error handling
The program execution will be canceled if the body could not be
detected or if no reference is found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SEARCH_BODY_REF body SURFACE_PARAM "SAMPLE" refSurface
SEARCH_BODY_REF body SURFACE_PARAM "SURFACE_NAME" WITH_CONTENT STRING
"SAMPLE_SURFACE" refSurface
§
SEARCH_BODY_REFS
Searches for all named references in a specified body. The command
requires Creo 7.0 or above.
Syntax
SEARCH_BODY_REFS [options] refBody<:in> type "search_string"
[WITH_CONTENT content_type "content_value"] array<:out>
Arguments

options
Valid options are:
NO_UPDATE — avoids automatic updating of the reference in case its
model will be assembled.

refBody
Reference to an existing body.

type
The specified reference type.

search_string
This is the Creo name of the reference to search for. Any string
expression is allowed. The reference name could also be specified by
the use of wildcards.
Another technique is to identify a geometrical item by its id. This
could be done by GID:number as search string. For example GID:9.

WITH_CONTENT
An optional WITH_CONTENT / WITH_CONTENT_NOT clause can follow, to
filter for specific variable content.

array
Name of the array of reference which should receive the information.
Error handling
The program execution will be canceled if the body could not be
detected or if no reference is found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
! find all surfaces with a parameter in a body
SEARCH_BODY_REFS body SURFACE_PARAM "*" allSurfacesWithParameter
§
GET_BODY_FROM_REF
Retrieves the body which is associated with a reference. In case no
body could be detected, the default body of the reference owner is
used. The command requires Creo 7.0 or above.
Syntax:
GET_BODY_FROM_REF reference<:in> refBody<:out>
Arguments

reference
Existing reference to a feature or geometry of the model.

refBody
Variable which receives the reference to the body.
Error handling
The program execution will be canceled if the reference does not
exist or the body could not be determined, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
USER_SELECT SURFACE surf
GET_BODY_FROM_REF surf body
§
BOOLEAN_BODY_OPERATION
Performs a boolean body operation to merge, intersect or subtract
existing bodies. The command requires Creo 7.0 or above.
Syntax
BOOLEAN_BODY_OPERATION [options] "operation" targetBodies<:in>
toolBodies<:in> refBoolBody<:out>
Arguments

options
The following options are supported:
KEEP_BODIES keepBOOL — to determine if the geometry of the tool
bodies should be preserved. Default is FALSE.

operation
The following operations are supported:
MERGE — to combine the geometry from multiple tool bodies with a
single target body.
INTERSECT — to intersect the geometry from multiple tool bodies
with a single target body.
SUBTRACT — to subtract the geometry or a single tool body from
multiple target bodies.

targetBodies
Reference or array of references which contain the target bodies.

toolBodies
Reference or array of references which contain the tool bodies.

body
Variable which receives the reference to the new body.
Error handling
The program execution will be canceled if the bodes do not exist of
if the boolean operation fails, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT BODY bodyTarget
USER_SELECT_MULTIPLE BODY -1 bodiesTool
BOOLEAN_BODY_OPERATION KEEP_BODIES TRUE INTERSECT bodyTarget
bodiesTool refBoolBody
§
CONVERT_BODY_TO_SMT
Converts a solid body to sheetmetal by specifying its driving surface
and thickness. The command requires Creo 7.0 or above.
Syntax
CONVERT_BODY_TO_SMT refBody<:in> refDrvSurface<:in> thicknessDOUBLE
feature_first_wall<:out>
Arguments

refBody
Reference to the body which should be converted to sheetmetal.

refDrvSurface
Reference to the intended driving surface. NULL or an invalid
reference can be used in case an empty solid should be converted to
sheetmetal.

thickness
Value for the sheetmetal thickness. Any math expression is allowed.

feature_first_wall
Name of the variable which will receive the reference to the first
wall sheetmetal feature.
Error handling
The program execution will be canceled if body or driving surface
reference do not exist or the conversion fails, unless errors are
handled by BEGIN_CATCH_ERROR.
Note
If the owner of the driving surface is already a sheetmetal part, the
command just will deliver the reference to the first wall sheetmetal
feature. In case the specified value for thickness is less or equal
to zero, the thickness will be calculated.
Example
USER_SELECT BODY body
USER_SELECT_OPTIONAL SURFACE drvSurface
CONVERT_BODY_TO_SMT body drvSurface 0.0 firstWall
PRINT "%" firstWall
§
About Commands for Multi Body Material
Commands for inquiring or setting material or material properties for
solid bodies for Creo 7.0 and above. The following commands are
available:
GET_BODY_MATERIAL — to read the name of the material which is
assigned to a body.
SET_BODY_MATERIAL — to assign a specific material to a body.
GET_BODY_MATERIAL_PROPERTIES — to retrieve the properties of the
material which is assigned to a body.
SET_BODY_MATERIAL_PROPERTIES — to set the properties of the
material which is assigned to a body.
GET_BODY_MATERIAL_PROPERTY — to read a specific property of the
material which is assigned to a body.
SET_BODY_MATERIAL_PROPERTY — to set a specific property of the
material which is assigned to a body.
GET_BODY_MASS_PROPERTIES — to retrieve the mass properties of a
body.
GET_BODY_DENSITY — to retrieve the density of a body.
SET_BODY_DENSITY — to set the density of a body.
§
GET_BODY_MATERIAL
Reads the assigned material of a body. The command requires Creo 7.0
or above.
Syntax
GET_BODY_MATERIAL body<:in> material<:out>
Arguments

body
Body from which the assigned material should be read.

material
Receives the assigned material as a string variable.
Error handling
The program execution will be canceled if the body does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_BODY_MATERIAL body material
PRINT "Material: %" material
§
SET_BODY_MATERIAL
Sets and assigns material to a body. The command requires Creo 7.0 or
above.
Syntax
SET_BODY_MATERIAL body<:in> "material"
Arguments

body
Body to which the material should be assigned.

material
Name and path of the material according the technique to specify file
paths. In case the specification does not include a path besides the
current working directory also the PRO_MATERIAL_DIR is searched.
Error handling
The program execution will be canceled if the body does not exist or
the material could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_BODY_MATERIAL body "lib:steel.mtl"
SET_BODY_MATERIAL body2 "copper"
§
GET_BODY_MATERIAL_PROPERTIES
Reads the standard properties of the assigned material of a body. The
command requires Creo 7.0 or above.
Syntax
GET_BODY_MATERIAL_PROPERTIES body<:in> material<:out>
Arguments

body
Body from which the assigned material properties should be read.

material
Structure variable of type MATERIAL which receives the material
properties.
Error handling
The program execution will be canceled if the body does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_BODY_MATERIAL_PROPERTIES body material
PRINT "Material: % emissivity: %" material.name material.emissivity
§
SET_BODY_MATERIAL_PROPERTIES
Set the standard properties of the assigned material of a body. The
command requires Creo 7.0 or above.
Syntax
SET_BODY_MATERIAL_PROPERTIES body<:in> material<:in>
Arguments

body
Body for which the assigned material properties should be changed.

material
Structure variable of type MATERIAL which contains the material
properties.
Error handling
The program execution will be canceled if the body does not exist or
the properties could not bet set, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_BODY_MATERIAL_PROPERTIES body material
material.bend_table = "table1"
SET_BODY_MATERIAL_PROPERTIES body material
§
GET_BODY_MATERIAL_PROPERTY
Read a property of the assigned material of a body. This allows also
to access custom material properties. The command requires Creo 7.0
or above.
Syntax
GET_BODY_MATERIAL_PROPERTY body<:in> "property_name" value<:out>
Arguments

body
Body from which the assigned material property be read.

property_name
Name of the property. Any string expression is allowed.

value
Name of the variable which receives the property content.
Error handling
The program execution will be canceled if the body does not exist or
the property could not be found, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_BODY_MATERIAL_PROPERTY body "price" price
PRINT "Price: % price
§
SET_BODY_MATERIAL_PROPERTY
Set a property in the assigned material of a body. This allows also
to access custom material properties. The command requires Creo 7.0
or above.
Syntax
SET_BODY_MATERIAL_PROPERTY body<:in> "property_name" valueSTRNUM
Arguments

Body
Body from which the assigned material property should be read.

property_name
Name of the property. Any string expression is allowed.

value
Value which should be set to the material property. Any string
expression or math expression is allowed.
Error handling
The program execution will be canceled if the body does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_BODY_MATERIAL_PROPERTY body "price" 1.25
§
GET_BODY_MASS_PROPERTIES
Calculates the mass properties of a body similar to Analysis > Mass
Properties. In case the coordinate system is from another model, a
temporary one will be created for the measurement. The command
requires Creo 7.0 or above.
Syntax
GET_BODY_MASS_PROPERTIES [options] body<:in> reference_csys<:in>
mass_properties<:out>
Arguments

options
The following options are supported:
ONLY_TRANSLATION_INVARIANT valueBOOL — to limit the calculation to
the translation invariant properties volume, surface_area, density,
mass and center_of_gravity in order to avoid the creation of a
temporary coordinate system. Default is FALSE.

body
Body for which the mass properties should be calculated.

reference_csys
The coordinate system which is used for the calculation. If NULL is
specified the default coordinate system will be used.

mass_properties
Structure variable of type MASS_PROPERTIES which receives the
calculate result.
Error handling
The program execution will be canceled if the body does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case a density is defined in the assigned body material, the
density will be set to 1.0.
Example
GET_BODY_MASS_PROPERTIES body NULL mass
PRINT "Volume: % surface area: %" mass.volume mass.surface_area
PRINT "Center of gravity (% % %)" mass.center_of_gravity.x
mass.center_of_gravity.y mass.center_of_gravity.z
§
GET_BODY_DENSITY
Retrieves the current density of a body. In case no density is
specified 1 is used as default. The command requires Creo 7.0 or
above.
Syntax
GET_BODY_DENSITY body<:in> density<:out>
Arguments

body
Body from which the density should be retrieved.

density
Name of the variable which will receive the density.
Error handling
The program execution will be canceled if the body does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_BODY_DENSITY THIS density
§
SET_BODY_DENSITY
Sets the density of a part. The command requires Creo 7.0 or above.
Syntax
SET_BODY_DENSITY body<:in> value DOUBLE
Arguments

body
Body for which the density should be set.

value
Value which should be used as density.
Error handling
The program execution will be canceled if the body could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_BODY_DENSITY THIS 8.5
§
About Commands for Inseparable Assembly Support
Inseparable Assembly support starts in Creo 8.0, therefor all related
commands require Creo 8.0 and above.
The following commands are available:
EMBED_COMPONENT — to embed a component to an inseparable assembly.
EXTRACT_COMPONENT — to extract an embedded component.
Also the logical expression IS_EMBEDDED is available to tests if a
component is an embedded component.
§
EMBED_COMPONENT
Embeds a component to an inseparable assembly as it could be done
interactively via Operations > Inseparable Assemblies > Embed. The
command requires Creo 8.0 or above.
Syntax
EMBED_COMPONENT model<:in> recursiveBOOL
Arguments

model
The model which should be embedded.

recursive
Boolean variable to determine if the sub components should be
embedded as well.
Error handling
The program execution will be canceled if the model does not exist or
it could not be embedded, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT comp
EMBED_COMPONENT comp TRUE
§
EXTRACT_COMPONENT
Extract an embedded component as it could be done interactively via
Operations > Inseparable Assemblies > Extract. The command requires
Creo 8.0 or above.
Syntax
EXTRACT_COMPONENT model<:in> recursiveBOOL new_namesBOOL
Arguments

model
The model which should be embedded.

recursive
Boolean variable to determine if the sub components should be
extracted as well.

new_names
Boolean variable to determine if new names should be used for the
extract components. Use FALSE to re-use the existing models.
Error handling
The program execution will be canceled if the model does not exist or
it could not be extracted, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
USER_SELECT COMPONENT comp
EXTRACT_COMPONENT comp TRUE TRUE
§
About Commands which are launched after tab file execution
Some tasks can only be fulfilled after the tab file is executed and
the return comes back to Pro/ENGINEER / Creo.
The following commands are available:
WINDOW_ACTIVATE — to activate the window after processing the tab
file.
WINDOW_CLOSE — to close the window after processing the tab file.
ERASE_ALL_POST — to erase all models after processing the tab file.
SWITCH_TO_MDL_POST — to switch to a specified model after
processing the tab file.
§
WINDOW_ACTIVATE
Activates the window after the tab files was processed.
Syntax
WINDOW_ACTIVATE
Example
WINDOW_ACTIVATE
§
WINDOW_CLOSE
Closes the window after the tab files was processed.
Syntax
WINDOW_CLOSE
Example
WINDOW_CLOSE
§
ERASE_ALL_POST
Erases all the models after the tab file was processed.
Syntax
ERASE_ALL_POST
Example
ERASE_ALL_POST
§
SWITCH_TO_MDL_POST
Switches to a specified model after the tab file was processed.
Syntax
SWITCH_TO_MDL_POST model
Arguments

model
The specified model.
Example
SEARCH_MDL_REF ASSEMBLY COMPONENT "*0815*" comp
SWITCH_TO_MDL_POST comp
§
About Commands for Identifiers
Components and UDFs created by the script language are marked by the
component / feature level string parameter CONNECT_EQUIP_IDENT_STR.
In case of identical content, the components and UDFs are considered
to be created by the same program and will be deleted together. When
a new program file is launched, the identifier is always set to a new
session identifier. The commands below provide support to assign
different identifiers in one tab program.
The following commands are available:
CREATE_IDENTIFIER — to create a new identifier and store the result
to a variable.
SET_IDENTIFIER — to set a new session identifier from the content
of a variable.
GET_IDENTIFIER — to get the current session identifier and store
the result to a variable.
GET_IDENTIFIER_FROM_REF — to retrieve a identifier from a
reference.
Also the following reference types can be used in SEARCH_MDL_REF and
SEARCH_MDL_REFS to search for identifiers:
IDENTIFIER — to search for components and features with a specified
identifier.
IDENTIFIER_COMPONENT — to search for components with a specified
identifier.
IDENTIFIER_FEATURE — to search for feature with a specified
identifier.
§
CREATE_IDENTIFIER
Creates a new component engine identifier and stores the result in a
variable.
Syntax
CREATE_IDENTIFIER paramIdent<:out>
Arguments

paramIdentl
Name of the parameter which will receive the identifier information.
Example
CREATE_IDENTIFIER ident
SET_IDENTIFIER ident
§
SET_IDENTIFIER
Set a new session identifier from the content of a variable.
Syntax
SET_IDENTIFIER paramIdent<:in>
Arguments

paramIdentl
Existing string variable with the content for the session identifier.
Example
CREATE_IDENTIFIER ident
SET_IDENTIFIER ident
§
GET_IDENTIFIER
Gets the current session identifier and stores the result to a
variable.
Syntax
GET_IDENTIFIER paramIdent<:out>
Arguments

paramIdentl
Name of the parameter which will receive the identifier information.
Example
GET_IDENTIFIER ident
PRINT "%" ident
§
GET_IDENTIFIER_FROM_REF
Retrieves a component engine identifier and stores the result in a
variable.
Syntax
GET_IDENTIFIER_FROM_REF ref<:in> ident<:out>
Arguments

ref
Name of the reference for which the identifier information should be
searched.

ident
Name of the variable which will receive the content of the component
engine identifier as string content.
Error handling
The program execution will be canceled if the reference does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT MODEL refMdl
GET_IDENTIFIER_FROM_REF refMdl ident
SEARCH_MDL_REFS RECURSIVE ASSEMBLY IDENTIFIER ident arrayIdents
FOR refIdent REF ARRAY arrayIdents
PRINT "%" refIdent
END_FOR
§
About Commands for External Data
Creo Parametric provides a mechanism to store user defined data to a
model. The data is structured internally in classes and slots to
distinguish data from different applications.
To manage data in SmartAssembly the class name SAS_EXT_DATA is preset
and the slot names are automatically set as consecutive numbers.
The following commands are supplied to store data by SmartAssembly:
READ_EXTERNAL_DATA — to read external data by keyword from a model.
WRITE_EXTERNAL_DATA — to write external data by keyword to a model.
DELETE_EXTERNAL_DATA — to delete external data by keyword from a
model.
To access external data written from other applications,
SmartAssembly offers the following command which provide the
flexibility to specify class and slot names:
GET_EXTERNAL_DATA_CLASSES — to get the names of all external data
classes which are stored in a model.
GET_EXTERNAL_DATA_SLOTS — to get the names of all slots for a
specified external data class which are store in a model.
READ_EXTERNAL_DATA_SLOT — to read the content of an external data
slot.
§
READ_EXTERNAL_DATA
Reads external data by keyword from a model.
Syntax
READ_EXTERNAL_DATA model "keyword" arrayData<:out>
Arguments

model
The specified model.

keyword
The key for which data is to be searched. Wildcards could be used to
read data for multiple keywords.

arrayData
Array variable which will receive the data as string elements.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
READ_EXTERNAL_DATA ASSEMBLY "info" arrayInfo
FOR info REF ARRAY arrayInfo
PRINT "%" info
END_FOR
§
WRITE_EXTERNAL_DATA
Writes external data by keyword to a model. The data could be a
string value or an array of string values.
Syntax
WRITE_EXTERNAL_DATA model "keyword" "data" | arrayData
Arguments

model
The specified model.

keyword
The key for which data is to be stored.

data | arrayData
String expressions or array of string values.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
WRITE_EXTERNAL_DATA ASSEMBLY "info" "My first Info"
DECLARE_ARRAY arrayOfInfos
ADD_ARRAY_ELEM arrayOfInfos "info1"
ADD_ARRAY_ELEM arrayOfInfos "info2"
WRITE_EXTERNAL_DATA ASSEMBLY "info" arrayOfInfos
§
DELETE_EXTERNAL_DATA
Deletes external data by keyword from a model.
Syntax
DELETE_EXTERNAL_DATA model "keyword" "data"
Arguments

model
The specified model.

keyword
The key for which data is to be deleted. Wildcards could be used to
delete data for multiple keywords.

data
The string value which should be searched an deleted. Wildcards could
be used to remove multiple data.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
DELETE_EXTERNAL_DATA ASSEMBLY "info" "*"
DELETE_EXTERNAL_DATA ASSEMBLY "*" "*"
§
GET_EXTERNAL_DATA_CLASSES
Gets the names of all external data classes which are stored in a
model.
Syntax
GET_EXTERNAL_DATA_CLASSES model arrayClassNames<:out>
Arguments

model
The specified model.

arrayClassNames
Array variable which will receive the class names as string values.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_EXTERNAL_DATA_CLASSES PART arrayClassNames
FOR className REF ARRAY arrayClassNames

GET_EXTERNAL_DATA_SLOTS PART className arraySlotNames

FOR slotName REF ARRAY arraySlotNames


READ_EXTERNAL_DATA_SLOT PART className slotName data
PRINT "(%/%): %" className slotName data
END_FOR
END_FOR
§
GET_EXTERNAL_DATA_SLOTS
Get the names of all slots of a specified external data class which
are stored in a model.
Syntax
GET_EXTERNAL_DATA_SLOTS model "class_name" arraySlotNames<:out>
Arguments

model
The specified model.

class_name
Name of the external data class for which the slots should be
retrieved.

arraySlotNames
Array variable which will receive the slot names as string values.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_EXTERNAL_DATA_CLASSES PART arrayClassNames
FOR className REF ARRAY arrayClassNames

GET_EXTERNAL_DATA_SLOTS PART className arraySlotNames

FOR slotName REF ARRAY arraySlotNames


READ_EXTERNAL_DATA_SLOT PART className slotName data
PRINT "(%/%): %" className slotName data
END_FOR
END_FOR
§
READ_EXTERNAL_DATA_SLOT
Reads the content of an external data slot.
Syntax
READ_EXTERNAL_DATA_SLOT model "class_name" "slot_name" content<:out>
Arguments

model
The specified model.

class_name
Name of the external data class.

slot_name
Name of the external data slot for which the content should be
retrieved.

content
Variable of type string which will received the content of the slot.
Error handling
The program execution will be canceled if the model or the slot do
not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_EXTERNAL_DATA_CLASSES PART arrayClassNames
FOR className REF ARRAY arrayClassNames

GET_EXTERNAL_DATA_SLOTS PART className arraySlotNames

FOR slotName REF ARRAY arraySlotNames


READ_EXTERNAL_DATA_SLOT PART className slotName data
PRINT "(%/%): %" className slotName data
END_FOR
END_FOR
§
About Commands for the System
Commands to retrieve and set system information for Creo Parametric
and SmartAssembly. The following commands are available:
ADD_SEARCH_PATH — to add a path to the search path temporarily.
GET_WORKING_DIRECTORY — to retrieve the information of the current
working directory.
SET_WORKING_DIRECTORY — to set the working directory.
GET_CONFIG_OPTION — to retrieve the current setting of a Creo
Parametric configuration option.
SET_CONFIG_OPTION — to set the current value of a Creo Parametric
configuration option.
LOAD_CONFIG_OPTIONS — to read a configuration file for the current
Creo Parametric session.
GET_PROE_VERSION — to retrieve the version information from the
current Creo Parametric version as number and as string.
GET_PROE_DATECODE — to retrieve the datecode information from the
current Creo Parametric version as string.
GET_PROE_MODE — to retrieve the mode in which Creo Parametric is
currently running.
GET_SA_VERSION — to retrieve the version release and datecode
information from the current SmartAssembly build.
GET_SYMBOL_STRING — to retrieve character symbol encodings for note
or geometric tolerances.
GET_AUTHENTICATION — to retrieve login and password information
from the password database.
ENABLE_DATA_CAPTURE_MODE — to determine if Creo Elements/Pro
parameters for modification should be created or not.
ENABLE_CONT_REF_CHECKING_MODE — to determine if a continuous
checking for the validity of all references should take place after
each traversed line of the program file.
ENABLE_RESTORE_SIMPREPS — to determine if restorage of simplified
representations should be done after each processed code line.
ENABLE_RESOLVE_MODE — to determine if Creo should show up the
resolved mode (panic window) in case of regeneration problems.
ENABLE_SAVE_DRAWINGS — to determine if drawings should be saved.
ENABLE_PRINT_MESSAGE — to enable or disable the output of PRINT
commands.
ENABLE_ERROR_LOG — to enable to disable the error log output to a
distinct file.
ENABLE_LOG_MESSAGE — to enable or disable message logging.
WRITE_LOG_MESSAGE — to write output to a log file in case the
logging mode is enabled.
WRITE_TRAIL_MESSAGE — to write a tagged message to the trail file.
GET_CLIPBOARD_TEXT — to retrieve text from the clipboard.
SET_CLIPBOARD_TEXT — to copy text to the clipboard.
GET_REGISTRY_STRING — to retrieve text from a registry value.
GET_REGISTRY_STRINGS — to retrieve an array of strings from a
registry value.
SET_REGISTRY_STRING — to write text to a registry value.
SET_REGISTRY_STRINGS — to write an array of strings to a registry
value.
GET_BROWSER_SIZE — to retrieve the size of the Creo embedded
browser.
SET_BROWSER_SIZE — to set the size of the Creo embedded browser.
GET_TRANSLATION — to receive the translation strings from
text/<language>/component_engine.txt according to the specified
path and language.
SET_AUTO_TRANSLATION_PATH — to sets the default path for the
GET_TRANSLATION command.
SET_AUTO_TRANSLATION_LANGUAGE — to sets the default language for
the GET_TRANSLATION command.
RESOLVE_PATH — to resolve syntax elements or environment variable
in the path description to the actual path..
PROCESS_PROE_EVENTS — to stop processing of further commands for a
short while to process waiting Creo Parametric events.
GET_WINDOW_MDLS — to retrieve an array of model references which
are occupying a Creo window.
CLOSE_MDL_WINDOW — to closes the window which is occupied by a
specific model.
§
ADD_SEARCH_PATH
Temporary adds a path to the search paths. This command will not
modify the Creo Elements/Pro config.pro file. After restarting Creo
Elements/Pro this setting is lost.
Syntax
ADD_SEARCH_PATH "path"
Arguments

path
Path which should be added to the search path. See path
specifications for details.
Note
To add a search path to the config.pro file, use the FILE_WRITE_LINE
command.
Example
ADD_SEARCH_PATH "c:\program files\SmartAssembly"
ADD_SEARCH_PATH "lib:\components"
§
GET_WORKING_DIRECTORY
Retrieves the information of the current working directory and stores
it to a variable.
Syntax
GET_WORKING_DIRECTORY paramWorkingDirectory<:out>
Arguments

paramWorkingDirectory
Name of the variable which receives the information of the current
working directory.
Example
GET_WORKING_DIRECTORY dir
SET_WORKING_DIRECTORY "d:\\temp"
...
SET_WORKING_DIRECTORY dir
§
SET_WORKING_DIRECTORY
Sets the working directory to a specified path.
Syntax
SET_WORKING_DIRECTORY "path"
Arguments

path
Path to which the working directory should be set. See path
specifications for details. Any string expression is allowed.
Error handling
The program execution will be canceled if the working directory could
not be set, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_WORKING_DIRECTORY dir
SET_WORKING_DIRECTORY "d:\\temp"
...
SET_WORKING_DIRECTORY dir
§
GET_CONFIG_OPTION
Retrieves the current setting of a Creo Elements/Pro configuration
option and stores it to a variable as string value.
Syntax
GET_CONFIG_OPTION "option" paramOptionValue<:out>
Arguments

option
Name of the configuration option. Any string expression is allowed.

paramOptionValue
Name of the variable which receives the current setting of the
configuration option.
Error handling
The program execution will be canceled if the configuration option
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_CONFIG_OPTION "DEFAULT_EXT_REF_SCOPE" origValu
SET_CONFIG_OPTION "DEFAULT_EXT_REF_SCOPE" "all"
...
SET_CONFIG_OPTION "DEFAULT_EXT_REF_SCOPE" "none"
§
SET_CONFIG_OPTION
Sets the value of a Creo Elements/Pro configuration option.
Syntax
SET_CONFIG_OPTION "option" "value"
Arguments

option
Name of the configuration option. Any string expression is allowed.

value
New value for the configuration option. Any string expression is
allowed.
Error handling
In case the option could not be set due to an illegal value or if it
is part of the config.sup, a warning message will show up, but the
program execution will not be canceled.
Example
GET_CONFIG_OPTION "DEFAULT_EXT_REF_SCOPE" origValu
SET_CONFIG_OPTION "DEFAULT_EXT_REF_SCOPE" "all"
...
SET_CONFIG_OPTION "DEFAULT_EXT_REF_SCOPE" "none"
§
LOAD_CONFIG_OPTIONS
Reads a configuration file for the current Creo Parametric session.
Syntax
LOAD_CONFIG_OPTIONS "config_pro_file"
Arguments

config_pro_file
Path and Name of the configuration file. Any string expression is
allowed.
Error handling
The program execution will be canceled if the configuration file
could not be read, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_CONFIG_OPTION "bell" bell
PRINT "bell: %" bell

LOAD_CONFIG_OPTIONS "lib:config"

GET_CONFIG_OPTION "bell" bell


PRINT "bell: %" bell
§
GET_PROE_VERSION
Retrieves the version information from the current Pro/ENGINEER /
Creo version as number and as string.
Syntax
GET_PROE_VERSION paramNumber<:out> paramName<:out>
Arguments

paramNumber
Name of the variable which receives the version number of the active
Creo Parametric version. Currently the following version numbers are
supported:
31 — for Creo 2.0
33 — for Creo 3.0
34 — for Creo 4.0
35 — for Creo 5.0
36 — for Creo 6.0
37 — only used for PTC internal versions.
38 — for Creo 7.0
39 — only used for PTC internal versions.
40 — for Creo 8.0

paramName
Name of the variable which receives the version name of the active
Creo Parametric version. Currently the following version names are
supported:
Creo Parametric 2.0
Creo Parametric 3.0
Creo Parametric 4.0
Creo Parametric 5.0
Creo Parametric 6.0
Creo Parametric 7.0
Creo Parametric 8.0
Example
GET_PROE_VERSION nVersion strVersion
PRINT "% - number: %" strVersion nVersion
§
GET_PROE_DATECODE
Retrieves the datecode information from the current Creo Parametric
version. Until Creo 4.0 this is shown in M notation (e.g. M120).
Since Creo 5.0 this is shown in the new notation (e.g. 6.0.4.0).
Syntax
GET_PROE_DATECODE datacode<:out>
Arguments

datecode
Name of the variable which receives the datecode as string.
Example
GET_PROE_DATECODE strDatecode
PRINT "%" strDatecode
§
GET_PROE_MODE
Retrieves the mode in which Pro/ENGINEER / Creo is currently running.
Syntax
GET_PROE_MODE paramMode<:out>
Arguments

paramModel
Name of the variable which receives the current mode. The following
modes are available:
MODE_SKETCHER
MODE_PART
MODE_SHEET_METAL
MODE_COMPOSITE
MODE_SCAN_MODEL
MODE_ASSEMBLY
MODE_DRAWING
MODE_MANUFACTURE
MODE_MOLD
MODE_CAST
MODE_DIEFACE
MODE_LAYOUT
MODE_FORMAT
MODE_REPORT
MODE_MARKUP
MODE_DIAGRAM
MODE_INTERCHANGE
MODE_LEGACY
MODE_USER_DEFINED
MODE_VERIFY
MODE_PROCESS
MODE_NC_MODEL
MODE_NONE
Example
GET_PROE_MODE mode
PRINT "%" mode
§
GET_SA_VERSION
Retrieves the version release and datecode information from the
current SmartAssembly build.
Syntax
GET_SA_VERSION version<:out> release<:out> datecode<:out>
Arguments

version
Name of the double variable which receives the version number (e.g.
6).

release
Name of the string variable which receives release information (e.g.
M040 or 000).

datecode
Name of the string variable which receives the datecode information
(e.g. 2017-07-05-01).
Example
GET_SA_VERSION version release datecode
PRINT "version: %" version
PRINT "release: %" release
PRINT "datecode: % datecode
§
GET_SYMBOL_STRING
Retrieves character symbol encodings to be placed on notes or
geometric tolerances. This command requires Creo 4.0 or above.
Syntax
GET_SYMBOL_STRING "tag" symbol_encoding<:out>
Arguments

tag
The followings tags are supported:
DIAMETER
FREE_STATE
STAT_TOL
TANGENT_PLANE
LMC
MMC
RFS
DEFAULT_RFS
LMC_R
MMC_R
ANGULARITY
PERPENDICULARITY
PARALLELISM
SYMMETRY

symbol_encoding
Name of the string variable which receives the encoded symbol to be
placed in notes or geometric tolerances.
Example
GET_SYMBOL_STRING DIAMETER dia
PRINT "%" dia
§
GET_AUTHENTICATION
Retrieves login and password information from the password database
See Using SmartAssembly > Miscellaneous > Password Database in the
User Guide for more information.
Syntax
GET_AUTHENTICATION "key" paramLogin<:out> paramPassword<:out>
Arguments

key
Key which will be looked up in the password database.

paramLogin
Name of the parameter which will receive the information about the
login.

paramPassword
Name of the parameter which will receive the information about the
password.
Error handling
The program execution will be canceled if the key is not inside the
password database, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The password can be used for most commands like PRINT or
SET_MDL_PARAM etc to prevent it can be published in this way. However
it is possible to concatenate the password with other strings and use
it later on for command which require a password. Currently the
following commands can used the password:
AUTHENTICATE
INFO_ENGINE_AUTHENTICATE
ODBC_CONNECT
FTP_CONNECT
SEND_MAIL
WEBSERVICE_CALL
If you use the password with another command it will always show up
as "*encrypted*".
Example
GET_AUTHENTICATION oracle_account login password
DECLARE_VARIABLE STRING strConnect
strConnect = "DSN=buw;UID=" + login + ";PWD=" + password
ODBC_CONNECT strConnect
§
ENABLE_DATA_CAPTURE_MODE
Determines if Creo Elements/Pro parameters for modification should be
created or not. By default these parameters are created. In case of
disabling this mode, modification and access to existing components
is disabled. In return processing time is faster.
Syntax
ENABLE_DATA_CAPTURE_MODE paramBOOL
Arguments

param
Boolean parameter determines if the capture mode should be enabled or
disabled.
Example
ENABLE_DATA_CAPTURE_MODE FALSE
§
ENABLE_CONT_REF_CHECKING_MODE
Determines if a continuous checking for the validity of all
references should take place after each traversed line of the program
file. Especially if many models are in session, this could have
effect on the performance. The default setting is determined by the
configuration option CONT_REF_CHECKING_MODE.
Syntax
ENABLE_CONT_REF_CHECKING_MODE paramBOOL
Arguments

param
Boolean parameter determines if the continuous reference check should
take place after each processed program file or only after the ones
which are removing models or features.
Note
In case the continuous reference checking is disabled it will only
occur in situations where features are removed or models are erased.
Example
ENABLE_CONT_REF_CHECKING_MODE FALSE
§
ENABLE_RESTORE_SIMPREPS
Determines if after each processed code line the simplified
representations of the solid models in session should be restored.
This is useful especially when switching to drawing with simplified
representations. The default setting is determined by the
configuration option RESTORE_SIMPREPS.
Syntax
ENABLE_RESTORE_SIMPREPS paramBOOL
Arguments

param
Boolean parameter determines if the restorage of simplified
representations should take place after each processed program file.
Example
ENABLE_RESTORE_SIMPREPS TRUE
§
ENABLE_RESOLVE_MODE
Determines if Creo should show up the resolved mode (panic window) in
case of regeneration problems. This command overwrites the
RESOLVE_MODE option for the execution of the tab file.
Syntax
ENABLE_RESOLVE_MODE modeBOOL
Arguments

mode
Boolean parameter determines if the resolve mode should be enabled or
not.
Note
This command overwrites the RESOLVE_MODE configuration option for the
execution of the tab file. It does not alter the Creo configuration
option regen_failure_handling.
Example
ENABLE_RESOLVE_MODE FALSE
REGEN_MDL ASSEMBLY
§
ENABLE_SAVE_DRAWINGS
Determines if drawings should be saved after the execution of a tab
file. This command overwrites the SAVE_DRAWINGS option for the
execution of the tab file.
Syntax
ENABLE_SAVE_DRAWINGS paramBOOL
Arguments

param
Boolean parameter determines if drawings should be saved or not.
Note
This command overwrites the SAVE_DRAWINGS configuration options for
the execution of the tab file.
Example
ENABLE_SAVE_DRAWINGS FALSE
§
ENABLE_PRINT_MESSAGE
Enables or disables the output of the PRINT command.
Syntax
ENABLE_PRINT_MESSAGE paramBOOL
Arguments

param
Boolean parameter determines if the PRINT output should be enabled or
disabled.
Example
PRINT "Output 1"
ENABLE_PRINT_MESSAGE FALSE
PRINT "Output 2"
ENABLE_PRINT_MESSAGE TRUE
PRINT "Output 3"
§
ENABLE_ERROR_LOG
Enables or disables the error log output to a distinct file.
Syntax
ENABLE_ERROR_LOG activeBOOL "file"
Arguments

active
Boolean variable to enable to disable the output of error and warning
messages.
file
Name and path of the file for the error log.
Example
ENABLE_ERROR_LOG TRUE "d:\\errors\\output.txt"
...
ENABLE_ERROR_LOG FALSE "d:\\errors\\output.txt"
§
ENABLE_LOG_MESSAGE
Enables or disables the message logging mode.
Syntax
ENABLE_LOG_MESSAGE paramBOOL
Arguments

param
Boolean parameter determines if logging the messages should be
enabled or disabled.
Note
In case the output file is already existing prior to an
ENABLE_LOG_MESSAGE with argument TRUE, LOG_MESSAGE erases all
previous content.
Example
ENABLE_LOG_MESSAGE TRUE
WRITE_LOG_MESSAGE "output.log" "This is a message"
§
WRITE_LOG_MESSAGE
Writes output to a log file in case the message logging mode is
enabled.
Syntax
WRITE_LOG_MESSAGE [options] "file_name" "message"
Arguments

options
The following options are supported:
WITH_TIMESTAMP valueBOOL — determines if a time stamp should be
written before the output message. Default is FALSE.

file_name
Name of the file according to file path specification. Any string
expressions are allowed

message
Message which should be written to the log file. Any string
expressions are allowed.
Note
In case the output file is already existing prior to an
ENABLE_LOG_MESSAGE with argument TRUE, LOG_MESSAGE erases all
previous content.
Example
ENABLE_LOG_MESSAGE TRUE
WRITE_LOG_MESSAGE "output.log" "This is a message"
§
WRITE_TRAIL_MESSAGE
Writes a tagged message to the trail file. This command is helpful in
combination with the configuration option DEBUG_TRAIL_FILE to track
complex problems.
Syntax
WRITE_TRAIL_MESSAGE [options] "tag" "message"
Arguments

options
The following options are supported:
WITH_TIMESTAMP valueBOOL — determines if a time stamp should be
written before the output message. Default is FALSE.

tab
Tag which can be used to scan a specific trail file for this output.

message
Message which should be written to the trail file. Any string
expressions are allowed.
Example

!Creates output in trail file like the following


!(DEBUG_SIMPREP) MASTER line: 10 file:
D:\buw\SmartAssembly60\component_engine\buw_test.tab
IF REF_VALID ASSEMBLY
GET_ACTIVE_SIMPREP ASSEMBLY activeRep
WRITE_TRAIL_MESSAGE "DEBUG_SIMPREP" activeRep
END_IF
§
GET_CLIPBOARD_TEXT
Retrieves text from the clipboard.
Syntax
GET_CLIPBOARD_TEXT text<:out>
Arguments

text
Name of the string variable which receives the clipboard content.
Example
GET_CLIPBOARD_TEXT text
PRINT "%" text
§
SET_CLIPBOARD_TEXT
Copies text to the clipboard.
Syntax
SET_CLIPBOARD_TEXT mode "text"
Arguments

mode
The following modes are available:
ANSI — to export text in ANSI mode.
UNICODE — to export text in UNICODE mode.
The editor or the encoding of the document defines the best matching
mode.

text
Text to copy. Any string expression is allowed.
Example
SET_CLIPBOARD_TEXT ANSI "Copy this text to the clipboard"
§
GET_REGISTRY_STRING
Retrieves text from a registry value. In case the registry value has
a different data type, the content is converted to a string.
Syntax
GET_REGISTRY_STRING [options] key_and_value text<:out>
Arguments

options
The following options are supported:
DEFAULT_VALUE valueBOOL — determines the unnamed default value of
the registry key should be used. Default is FALSE.

key_and_value
Completes path to the registry value. Any string expression is
allowed.

text
Name of the string variable which receives the registry content.
Error handling
The program execution will be canceled if the registry value could
not be read, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_REGISTRY_STRING "HKEY_CURRENT_USER\\XXX\\test" output
PRINT "%" output
§
GET_REGISTRY_STRINGS
Retrieves an array of text from the a registry value. In case the
registry value has a different data type, the content of the array is
converted to strings.
Syntax
GET_REGISTRY_STRINGS [options] key_and_value arrayText<:out>
Arguments

options
The following options are supported:
DEFAULT_VALUE valueBOOL — determines the unnamed default value of
the registry key should be used. Default is FALSE.

key_and_value
Completes path to the registry value. Any string expression is
allowed.

arrayText
Name of the array variable which receives the registry content.
Error handling
The program execution will be canceled if the registry value could
not be read, unless errors are handled by BEGIN_CATCH_ERROR.
Note
This command is especially useful for reading multi line texts.
Example
GET_REGISTRY_STRINGS "HKEY_CURRENT_USER\\XXX\\test" arrayOutput
FOR output REF ARRAY arrayOutput
PRINT "%" output
END_FOR
§
SET_REGISTRY_STRING
Sets text to a registry value.
Syntax
GET_REGISTRY_STRING [options] key_and_value "text"
Arguments

options
The following options are supported:
DEFAULT_VALUE valueBOOL — determines the unnamed default value of
the registry key should be used. Default is FALSE.

key_and_value
Completes path to the registry value. Any string expression is
allowed.

text
Text which should be written to the registry value. Any string
expression is allowed.
Error handling
The program execution will be canceled if the registry value could
not be written, unless errors are handled by BEGIN_CATCH_ERROR.
Example
SET_REGISTRY_STRING "HKEY_CURRENT_USER\\XXX\\test" "this is a test"
§
SET_REGISTRY_STRING
Sets an array of strings to a registry value.
Syntax
GET_REGISTRY_STRINGS [options] key_and_value arrayText<:in>
Arguments

options
The following options are supported:
DEFAULT_VALUE valueBOOL — determines the unnamed default value of
the registry key should be used. Default is FALSE.

key_and_value
Completes path to the registry value. Any string expression is
allowed.

arrayText
Array variable with Text which should be written to the registry
value.
Error handling
The program execution will be canceled if the registry value could
not be written, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_ARRAY values
ADD_ARRAY_ELEM values "line1"
ADD_ARRAY_ELEM values "line2"
SET_REGISTRY_STRINGS "HKEY_CURRENT_USER\\XXX\\test" values
§
GET_BROWSER_SIZE
Retrieves the size of the Creo embedded browser in percentage of
coverage of the Creo window. The values in the range 0.0 to 100.0.
Syntax
GET_BROWSER_SIZE size<:out>
Arguments

size
Name of the variable which receives the browser size.
Example
GET_BROWSER_SIZE size
PRINT "%" size
§
SET_BROWSER_SIZE
Sets the size of the Creo embedded browser in percentage of coverage
of the Creo window. The values in the range 0.0 to 100.0.
Syntax
SET_BROWSER_SIZE sizeDOUBLE
Arguments

size
Size of the browser window in percent. Any math expression can be
used.
Example
SET_BROWSER_SIZE 50.0
§
GET_TRANSLATION
Receives the translation strings from
text/<language>/component_engine.txt according to the specified path
and language. Percentage signs '%' can be used as placeholders for
variables.
Syntax
GET_TRANSLATION "path" "language" "key" output [argument] [argument]
Arguments

path
The path should not include the "text" directory. Any string
expression is allowed and all elements of the path specification
rules can be used.
In case the path is an empty string, either the local component
engine directory is considered or the path which was set by
SET_AUTO_TRANSLATION_PATH.

language
The language for which the translation should be retrieved. Any
string expression is allowed.
In case the language is an empty string, either the current language
of Creo Parametric is considered or the language which was set by
SET_AUTO_TRANSLATION_LANGUAGE.
Translated languages from PTC:
usascii — English language.
chinese_cn — Chinese simplified, used in Mainland china.
chinese_tw — Chinese traditional used in Taiwan.
french — French language.
german — German language.
italian — Italian language.
japanese — Japanese language.
korean — Korean language.
spanish — Spanish language.
portuguese_br — Portuguese language in Portugal and Brazil.
russian — Russian language.
Supported languages from PTC:
greek — Greek language.
hebrew — Hebrew language.
hungarian — Hungarian language.
polish — Polish language.
slovak — Slovak language.
slovenian — Slovenian language.
turkish — Turkish language.

key
key of the entry which should be retrieved. Any string expression is
allowed.

output
Name of the output variable.

arguments
Number of arguments according to percentage sign in the format
string. The Arguments could be string, number or parameter expression
according to the rules for math equations and string expressions.
Note
Variables which are translated by GET_TRANSLATION will be used for
translating the graphical user interface.
Example
GET_TRANSLATION "lib:" "german" "MESSAGE3" test "input1" 8*3
PRINT "%" test
§
SET_AUTO_TRANSLATION_PATH
Sets the default path for the GET_TRANSLATION command. This
specification is used in case an empty path is specified in
GET_TRANSLATION.
Syntax
SET_AUTO_TRANSLATION_PATH "path"
Arguments

path
The path should not include the "text" directory. Any string
expression is allowed and all elements of the path specification
rules can be used.
Example
SET_AUTO_TRANSLATION_PATH "lib:\\translations"
GET_TRANSLATION "" "usascii" "MESSAGE3" test "input1" 8*3
PRINT "%" test
§
SET_AUTO_TRANSLATION_LANGUAGE
Sets the default language for the GET_TRANSLATION command. This
specification is used in case an empty translation is specified in
GET_TRANSLATION.
Syntax
SET_AUTO_TRANSLATION_LANGUAGE "language"
Arguments

language
The language for which the translation should be retrieved. Any
string expression is allowed.
Translated languages from PTC:
usascii — English language.
chinese_cn — Chinese simplified, used in Mainland china.
chinese_tw — Chinese traditional used in Taiwan.
french — French language.
german — German language.
italian — Italian language.
japanese — Japanese language.
korean — Korean language.
spanish — Spanish language.
portuguese_br — Portuguese language in Portugal and Brazil.
russian — Russian language.
Supported languages from PTC:
greek — Greek language.
hebrew — Hebrew language.
hungarian — Hungarian language.
polish — Polish language.
slovak — Slovak language.
slovenian — Slovenian language.
turkish — Turkish language.
Example
SET_AUTO_TRANSLATION_LANGUAGE "usascii"
GET_TRANSLATION "lib:" "" "MESSAGE3" test "input1" 8*3
PRINT "%" test
§
RESOLVE_PATH
Resolve syntax elements or environment variables in the path
description to the actual path on hard drive, in Windchill or as
network protocol description.
Syntax
RESOLVE_PATH "path" resolved_path<:out>
Arguments

path
Path description. Any string expression is allowed and all elements
of the path specification rules can be used.

resolved_path
Name of the string variable which receives the resolved path.
Note
Environment variables should by used in Creo notation with the prefix
$ (e.g. $CREO_COMMON_FILES).
Example
RESOLVE_PATH @"$CREO_COMMON_FILES\graphic-
library\appearances\appearance.dmt" path1
RESOLVE_PATH "lib:buw.dmt" path2
RESOLVE_PATH @"$CREO_COMMON_FILES" path3
RESOLVE_PATH "lib:\\" path4
RESOLVE_PATH "http://www.buw-soft.de" path5
RESOLVE_PATH "wtpub://www.buw-soft.de/test" path6
RESOLVE_PATH "d:\\test\\temp" path7
RESOLVE_PATH "wtpub:default_csys.gph" path8
§
PROCESS_PROE_EVENTS
Stops the processing of further commands for a short while and allows
waiting Creo events to be processed. This could be used for example
for wait for rule based layers to populate new features.
Syntax
PROCESS_PROE_EVENTS
Example
PROCESS_PROE_EVENTS
§
GET_WINDOW_MDLS
Retrieves an array of model references which are occupying a Creo
window.
Syntax
GET_WINDOW_MDLS array_mdls<:out>
Arguments

array_mdls
Name of the array which receives the references of the models are
occupying a Creo window.
Error handling
The program execution will be canceled if the reference to a curve
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_WINDOW_MDLS arrayMdls
FOR mdl REF ARRAY arrayMdls
GET_MDL_NAME mdl name
GET_MDL_EXTENSION mdl type
PRINT "%.%" name type
END_FOR
§
CLOSE_MDL_WINDOW
Closes the window which is occupied by a specific model.
Syntax
CLOSE_MDL_WINDOW model<:in>
Arguments

model
The specified model.
Error handling
The program execution will be canceled if the reference to the model
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Note
It is not possible to close the base window. If the SmartAssembly
configuration option COMPENGINE_RESTORE_MDL is set to the default
value YES, the previously active model is restored after the
SmartAssembly program has finished.
Example
RETRIEVE_MDL "prt0002.prt" mdl
CLOSE_MDL_WINDOW mdl
About Commands for Interfaces
Commands for interfaces includes access to different products, import
and export functionality, ODBC databases and general access to an
external program.
The following commands are available:
Access to PDM — to access Intralink und PDMLink.
Access to Microsoft Excel — to read from and write data to
Microsoft Excel.
Access to Microsoft Word — to read from and write data to Microsoft
Word.
Import / Export functionality — to import and export foreign data
formats.
Operating System — to retrieve values from the operating system.
Regular Expressions — to use regular expression as technique for
pattern matching.
Services — to access different services.
General API — to execute mapkeys and start external applications.
3rd Party Integration — to execute specific commands for 3rd Party
systems.
Toolkit applications — to execute other Creo Toolkit applications.
J-Link applications — to execute other J-Link applications.
SmartAssembly Toolkit — to create C++ dlls which can interact with
SmartAssembly.
SmartDesignServer — commands which are only available for the
SmartDesignServer.
About Commands for PDM
PDM commands provide the access to active Intralink or PDMLink
sessions. Functionality for PDMLink requires Creo Elements/Pro
Wildfire 3 or above.
The following commands are available:
For Intralink 3.4 and Intralink 8.0 (and above) / PDMLink:
CHECKOUT_OBJECT — to check-out or download one object from the PDM
system.
CHECKOUT_OBJECTS — to check-out or download multiple objects from
the PDM system.
GET_CURRENT_WORKSPACE — to get the name of the current workspace.

For Intralink 8.0 (and above) / PDMLink


GET_WORKSPACES — to retrieve the names of all workspaces of the
current PDMLink session.
GET_WORKSPACE_CONTEXT — to retrieve the context of a specified
workspace of the current PDMLink session.
UNDO_CHECKOUT_OBJECTS — to revoke the checkout of an object in the
PDMLink.
CHECKIN_OBJECT— to check-in or upload an object to PDMLink.
CHECKIN_OBJECTS— to check-in or upload multiple object to PDMLink.
CHECKIN_WORKSPACE — to check-in the complete workspace to PDMLink.
This allows to check-in also non Creo objects.
AUTHENTICATE — to authenticate a user via the password database.
REGISTER_SERVER — to register a PDMLink server.
UNREGISTER_SERVER — to unregister a PDMLink server.
ACTIVATE_SERVER — to set a PDMLink server active.
DEACTIVATE_SERVER—to deactivate the current PDMLink server
connection.
GET_SERVERS — to retrieve the name of all PDMLink servers.
GET_SERVER — to retrieve the name of the active or of another
PDMLink server.
GET_SERVER_LOCATION — to retrieve the location of the server.
CREATE_WORKSPACE — to create a new workspace for the active PDMLink
server.
DELETE_WORKSPACE — to delete an existing workspace from the active
PDMLInk server.
ACTIVATE_WORKSPACE — to set a workspace active.
REMOVE_WORKSPACE_OBJECTS — to remove objects by name or by
reference from the current workspace.
CLEAR_WORKSPACE — to erase all objects from the active workspace.
COPY_FILE_FROM_WS — to copy a file from the current workspace to
the hard drive.
COPY_FILE_TO_WS — to copy a file from the local hard drive to the
current workspace.
GET_PDM_STATE — to determine by reference if a model is downloaded,
checked out or no PDM object.
GET_PDM_STATE_EX — to determine extended PDM information by
reference.
GET_PDM_STATE_BY_NAME — to determine by name if a model is
downloaded, checked out or no PDM object.
GET_PDM_STATE_BY_NAME_EX — to determine extended PDM information by
by name.
GET_PDM_STORAGE — to determine if a model is already checked in, or
if it is only available in the workspace or if it is no PDM object.
GET_PDM_MODIFICATION_STATE — to determine if a model was modified
locally or in the workspace.
GET_PDM_LOCK_STATE — to determine if a model is locked in PDMLink.
SET_PDM_LOCK_STATE — to lock or unlock a model in PDMLink.
GET_URL_FROM_ALIASED_URL — to convert an aliased URL to its real
URL.
Additionally the following logical expression can be used:
PDM_CONNECTED — to figure out if a connection to PDMLink or
Intralink is established.
§
CHECKOUT_OBJECT
To check an object from Intralink or check out / download it from
PDMLink.
Syntax
CHECKOUT_OBJECT [options] downloadBOOL "object_name"
Arguments

options
The following options are supported:
CASE_SENSITIVE argument BOOL — to determine if the object name
should be case sensitive. Since Creo objects are always stored in
lowercase characters, this option is only useful for non-Creo
objects. Default is FALSE.
VERSION "version" — Version of the object in the
"revision.iteration" format. The version is only working when
downloading an object.

download
Boolean variable. In case of TRUE the object will be downloaded and
in case of FALSE it will be checked out. For Intralink this parameter
is disregarded.

object_name
Name of the object to check out. This must include the file
extension.
Error handling
The program execution will be canceled if the check out fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
In Intralink the objects will be checked out as link. For PDMLink
family table instances must not include the generic name.
Example
CHECKOUT_OBJECT FALSE "sample.prt"
§
CHECKOUT_OBJECTS
To check-out multiple objects from Intralink or check out / download
them from PDMLink.
Syntax
CHECKOUT_OBJECTS [otions] downloadBOOL arrayObjectNames<:in>
Arguments

options
The following options are supported:
CASE_SENSITIVE argument BOOL — to determine if the object name
should be case sensitive. Since Creo objects are always stored in
lowercase characters, this option is only useful for non-Creo
objects. Default is FALSE.
VERSION "version" — Version of the object in the
"revision.iteration" format. The version is only working when
downloading an object.

download
Boolean variable. In case of TRUE the object will be downloaded and
in case of FALSE it will be checked out. For Intralink this parameter
is disregarded.

arrayObjectNames
Array with objects names to check out. The object names must include
the file extension.
Error handling
The program execution will be canceled if the array does not exist or
the check out fails, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In Intralink the objects will be checked out as link. For PDMLink
family table instances must not include the generic name.
Example
DECLARE_ARRAY arrayObjects
ADD_ARRAY_ELEM arrayObjects "sample1.prt"
ADD_ARRAY_ELEM arrayObjects "sample2.prt"
ADD_ARRAY_ELEM arrayObjects "sample2.prt"
CHECKOUT_OBJECTS FALSE arrayObjects
§
UNDO_CHECKOUT_OBJECTS
Revokes the checkout of an object in PDMLink.
Syntax
UNDO_CHECKOUT_OBJECTS object | arrayObjects
Arguments

object | arrayObjects
Name or reference or array of names or references of the objects for
which the checkout should be revoked. Any string expression is
allowed.
Error handling
The program execution will be canceled if the array does not exist or
the check out fails, unless errors are handled by BEGIN_CATCH_ERROR.
Example
UNDO_CHECKOUT_OBJECTS "test.prt"

ADD_ARRAY_ELEM arrayObjects "sample1.prt"


ADD_ARRAY_ELEM arrayObjects "sample2.prt"
ADD_ARRAY_ELEM arrayObjects "sample2.prt"
UNDO_CHECKOUT_OBJECTS arrayObjects
§
GET_CURRENT_WORKSPACE
Determines the name of the current workspace from the connected
Intralink or PDMLink session. In case no workspace is available, the
results is an empty string.
Syntax
GET_CURRENT_WORKSPACE [options] param<:out>
Arguments

options
The following options are supported:
SERVER_NAME "name" — Name of the server for which the workspaces
are retrieved. Default is the active server.

param
Name of the parameter which receives the name of the current
workspace.
Example
GET_CURRENT_WORKSPACE workspace_name
PRINT "workspace name: %" workspace_name
§
GET_WORKSPACES
Retrieves the names of all workspaces of the current PDMLink session.
In case no workspace is available, the results is an empty array.
Syntax
GET_WORKSPACES [options] arrayWorkspaces<:out>
Arguments

options
The following options are supported:
SERVER_NAME "name" — Name of the server for which the workspaces
are retrieved. Default is the active server.

arrayWorkspaces
Array variable which receives the workspaces as string variables.
Error handling
The program execution will be canceled if no PDMLink server is
connected, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_WORKSPACES allWorkspaces

FOR workspace REF ARRAY allWorkspaces


GET_WORKSPACE_CONTEXT workspace context
PRINT "%: %" workspace context
END_FOR
§
GET_WORKSPACE_CONTEXT
Retrieves the of context of a specified workspace of the current
PDMLink session.
Syntax
GET_WORKSPACE_CONTEXT [options] "workspace" context<:out>
Arguments

options
The following options are supported:
SERVER_NAME "name" — Name of the server for which the workspaces
are retrieved. Default is the active server.

workspace
Name of the workspace. Any string expression is allowed.

context
String variable which receives the workspace context.
Error handling
The program execution will be canceled if no PDMLink server is
connected or the workspace could not be found, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
GET_WORKSPACES allWorkspaces

FOR workspace REF ARRAY allWorkspaces


GET_WORKSPACE_CONTEXT workspace context
PRINT "%: %" workspace context
END_FOR
§
CHECKIN_OBJECT
To check-in an object to PDMLink.
Syntax
CHECKIN_OBJECT model<:in> checkin_option<:in>
Arguments

model
The model which should be checked in to PDMLink.

checkin_option
Structure variable of type CHECKIN_OPTION.
Error handling
The program execution will be canceled if the model is not defined or
the check-in fails, unless errors are handled by BEGIN_CATCH_ERROR.
In case the model is already checked-in, no error will occur.
Note
Locations in the CHECKIN_OPTION and CHECKIN_LOCATION structure
default_location, location and baseline_location) are considered to
start after the context information. To overwrite the context of the
current workspace, put the context information in less-than and
greater-than brackets '<...>' (e.g. <SmartAssembly>/project4711). If
the library name contains lesser or greater signs, use a backslash to
prevent them from being replaced (e.g.'\<sample\>).
By default the context is expected to reside in the cabinet Products.
Use cabinet with content Libraries of the CHECKIN_OPTION and
CHECKIN_LOCATION option structure for libraries.
Example
DECLARE_STRUCT CHECKIN_OPTION checkin_option
checkin_option.include_drawings = TRUE
checkin_option.default_location = "project4711"
CHECKIN_OBJECT mdl checkin_option
§
CHECKIN_OBJECTS
To check-in an object to PDMLink.
Syntax
CHECKIN_OBJECTS arrayModels<:in> checkin_option<:in>
Arguments

arrayModels
Array of models which should be checked in to PDMLink.

checkin_option
Structure variable of type CHECKIN_OPTION.
Error handling
The program execution will be canceled if the model is not defined or
the check-in fails, unless errors are handled by BEGIN_CATCH_ERROR.
In case the model is already checked-in, no error will occur.
Note
Locations in the CHECKIN_OPTION and CHECKIN_LOCATION structure
default_location, location and baseline_location) are considered to
start after the context information. To overwrite the context of the
current workspace, put the context information in less-than and
greater-than brackets '<...>' (e.g. <SmartAssembly>/project4711). If
the library name contains lesser or greater signs, use a backslash to
prevent them from being replaced (e.g.'\<sample\>).
By default the context is expected to reside in the cabinet Products.
Use cabinet with content Libraries of the CHECKIN_OPTION and
CHECKIN_LOCATION option structure for libraries.
Example
DECLARE_STRUCT CHECKIN_OPTION checkin_option
checkin_option.include_drawings = TRUE
checkin_option.default_location = "project4711"
DECLARE_ARRAY arrayModels
ADD_ARRAY_ELEM arrayModels mdl1
ADD_ARRAY_ELEM arrayModels mdl2
CHECKIN_OBJECTS arrayModels checkin_option
§
CHECKIN_WORKSPACE
To check-in the complete workspace in PDMLink. This allows to check-
in also non Creo objects.
Syntax
CHECKIN_WORKSPACE checkin_workspace_option<:in>
Arguments

checkin_workspace_option
Structure variable of type CHECKIN_WORKSPACE_OPTION.
Error handling
The program execution will be canceled if the check-in fails, unless
errors are handled by BEGIN_CATCH_ERROR. In case the model is already
checked-in, no error will occur.
Note
Locations in the CHECKIN_WORKSPACE_OPTION and
CHECKIN_WORKSPACE_LOCATION structure default_location, location and
baseline_location) are considered to start after the context
information. To overwrite the context of the current workspace, put
the context information in less-than and greater-than brackets
'<...>' (e.g. <SmartAssembly>/project4711). If the library name
contains lesser or greater signs, use a backslash to prevent them
from being replaced (e.g.'\<sample\>).
By default the context is expected to reside in the cabinet Products.
Use cabinet with content Libraries of the CHECKIN_WORKSPACE_OPTION
and CHECKIN_WORKSPACE_LOCATION option structure for libraries.
Example
READ_DIRECTORY "wtws:" "*" files
DECLARE_STRUCT CHECKIN_WORKSPACE_OPTION ws_option
FOR file REF ARRAY files

PARSE_FILE_NAME file path name extension

IF extension == "pdf"
DECLARE_STRUCT CHECKIN_WORKSPACE_LOCATION location

location.file = file
location.location = "/pdf_documents"
ADD_ARRAY_ELEM ws_option.array_locations location

ELSE_IF extension == "dxf"


DECLARE_STRUCT CHECKIN_WORKSPACE_LOCATION location

location.file = file
location.location = "/dxf"
ADD_ARRAY_ELEM ws_option.array_locations location
END_IF

END_FOR
CHECKIN_WORKSPACE ws_option
§
AUTHENTICATE
Authenticates a user via the password database.
Syntax
AUTHENTICATE "login" "password"
Arguments

login
Login which will be used for the authentication. Any string
expression is allowed.

password
Password which will be used for the authentication. Any string
expression is allowed.
Example
GET_AUTHENTICATION windchill login pasword
AUTHENTICATE login password
§
REGISTER_SERVER
Registers a PDMLink server.
Syntax
REGISTER_SERVER [options] "location" ["workspace"]
Arguments

options
The following options are supported:
SERVER_NAME "name" — Name which will be used to identify the server
(e.g. in wtpub://<name>). Default is a random number.

location
Location of the PDMLink server. Any string expression is allowed.

workspace
Optional workspace. Any string expression is allowed. In case the
workspace is not specified, the first one will be used.
Error handling
This functions fails if server location or workspace are not found
unless errors are handled by BEGIN_CATCH_ERROR.
Note
This function does not update the settings in the server manager. It
does not set the server as active. Use ACTIVATE_SERVER for this.
Example
GET_AUTHENTICATION windchill_user password login
AUTHENTICATE password login
REGISTER_SERVER SERVER_NAME "buw"
"http://myserver.mycompany.com/Windchill" "my_workspace"
ACTIVATE_SERVER "http://myserver.mycompany.com/Windchill"
§
UNREGISTER_SERVER
Unregisters a PDMLink server
Syntax
UNREGISTER_SERVER "location"
Arguments

location
Location of the PDMLink server. Any string expression is allowed.
Error handling
This functions fails if the server location is not found unless
errors are handled by BEGIN_CATCH_ERROR.
Note
This function does not update the settings in the server manager.
Example
UNREGISTER_SERVER "http://myserver.mycompany.com/Windchill"
§
ACTIVATE_SERVER
Activates a registered PDMLink server.
Syntax
ACTIVATE_SERVER "location"
Arguments

location
Location of the PDMLink server. Any string expression is allowed.
Error handling
This functions fails if the server location is not found unless
errors are handled by BEGIN_CATCH_ERROR.
Note
This function does not update the settings in the server manager.
Example
ACTIVATE_SERVER "http://myserver.mycompany.com/Windchill"
§
DEACTIVATE_SERVER
Deactivates the current PDMLink server connection.
Syntax
DEACTIVATE_SERVER
Error handling
This functions fails if the server could not be deactivated unless
errors are handled by BEGIN_CATCH_ERROR.
Example
DEACTIVATE_SERVER
§
CREATE_WORKSPACE
Creates a workspace for the active PDMLink server.
Syntax
CREATE_WORKSPACE "workspace" "context"
Arguments

workspace
Name of the new workspace Any string expression is allowed.

context
Context of the new workspace. Any string expression is allowed.
Error handling
This functions fails if the workspace could not be created unless
errors are handled by BEGIN_CATCH_ERROR.
Example
CREATE_WORKSPACE "my_workspace" "Site"
§
DELETE_WORKSPACE
Delete a workspace for the active PDMLink server.
Syntax
DELETE_WORKSPACE "workspace"
Arguments

workspace
Workspace of the active PDMLink server. Any string expression is
allowed.
Error handling
This functions fails if the workspace could not be deleted unless
errors are handled by BEGIN_CATCH_ERROR.
Example
DELETE_WORKSPACE "my_workspace"
§
GET_SERVERS
Retrieves the names of all servers, even if they are offline.
Syntax
GET_SERVERS arrayServers<:out>
Arguments

arrayServers
Array variable which receives the servers as string variables.
Example
GET_SERVERS allServers

FOR server REF ARRAY allServers


PRINT "Server: %" server
GET_WORKSPACES SERVER_NAME server allWorkspaces
FOR workspace REF ARRAY allWorkspaces
PRINT "workspace: %" workspace
END_FOR
END_FOR
§
GET_SERVER
Retrieves the names of the active server or of an offline server.
Syntax
GET_SERVER server<:out>
Arguments

server
String variable which receives the server name.
Error handling
This functions fails if no server could not be detected, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
GET_SERVER server

PRINT "Server: %" server


GET_WORKSPACES SERVER_NAME server allWorkspaces
FOR workspace REF ARRAY allWorkspaces
PRINT "workspace: %" workspace
END_FOR
§
GET_SERVER_LOCATION
Retrieves the location of the server from the active server or based
on its alias.
Syntax
GET_SERVER_LOCATION "alias" location<:out>
Arguments

alias
Alias which is used to identify the server. Any string expression is
allowed. If the alias is empty, the active server is used.

location
String variable which receives the server location.
Error handling
This functions fails if the alias could not be detected or if the
server is not active, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_SERVER_LOCATION "" location_active_server
PRINT "%" location_active_server

GET_SERVER_LOCATION "*B&W*" location_buw_server


PRINT "%" location_buw_server
§
ACTIVATE_WORKSPACE
Activate a workspace for the active PDMLink server.
Syntax
ACTIVATE_WORKSPACE "workspace"
Arguments

workspace
Workspace of the active PDMLink server. Any string expression is
allowed.
Error handling
This functions fails if the workspace is not found is not found
unless errors are handled by BEGIN_CATCH_ERROR.
Note
This function does not update the settings in the server manager.
Example
ACTIVATE_WORKSPACE "my_workspace"
§
REMOVE_WORKSPACE_OBJECTS
Removes objects by name or by reference from the current workspace of
the active PDMLink server.
Syntax
REMOVE_WORKSPACE_OBJECTS object | arrayObjects
Arguments

object | arrayObject
Name or reference or array of names or references of the object which
should be removed from the current Workspace of the active PDMLink
server. Any string expression is allowed.
Error handling
This functions fails if the objects could not be deleted unless
errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_ARRAY arrayObjects
ADD_ARRAY_ELEM arrayObjects ASSEMBLY
ADD_ARRAY_ELEM arrayObjects "sample.prt"
REMOVE_WORKSPACE_OBJECTS arrayObjects
§
CLEAR_WORKSPACE
Erases all models from the client side and from the server side
active workspace.
Syntax
CLEAR_WORKSPACE
Example
CLEAR_WORKSPACE
§
COPY_FILE_FROM_WS
Copies a file from the current workspace to local hard disk for
Intralink 8.0 (and above) / PDMLink.
Syntax
COPY_FILE_FROM_WS [options] "filename" "path"
Arguments

options
The following options are supported since Creo 2.0 M160 / Creo 3.0
M050 or higher:
ATTACH_TO "name" | refMdl — to specify that the file is second
content to this model in PDMLink.

filename
Name of the file which should be copied to hard disk.

path
Destination path on the hard disk. This should not include the file
name. See path specifications for details.

Error handling
This functions fails if the file could not be copied from workspace,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
The command will fail if the path includes the file name.
Example
COPY_FILE_FROM_WS "test.pdf" "."
COPY_FILE_FROM_WS ATTACH_TO "sample.prt" "test.xlsx" "."
§
COPY_FILE_TO_WS
Copies a file from the local hard disk to the current workspace for
Intralink 8.0 (and above) / PDMLink.
Syntax
COPY_FILE_TO_WS [options] "filename"
Arguments

options
The following options are support:
ATTACH_TO "name" | refMdl — to attach the file to an existing
object in PDMLink.

filename
Path to the file which should be copied to the workspace. See path
specifications for details.

Error handling
This functions fails if the file could not be copied to workspace,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
COPY_FILE_TO_WS "lib:test.pdf"
COPY_FILE_TO_WS ATTACH_TO "sample.prt" "lib:document.pdf"
§
GET_PDM_STATE
Determines by a reference whether a model is downloaded, checked out
or no PDM object for Intralink 8.0 (and above) / PDMLink.
Syntax
GET_PDM_STATE model param<:out>
Arguments

model
The specified model.

param
Name of the parameter which receives the PDM state. Valid states are:
NO_PDM — in case the object was never stored to Intralink /
PDMLink.
NOT_CHECKED_IN — in case the object is saved in the workspace, but
was not yet checked in to the common space.
CHECKED_OUT — in case the object is checked out and can be
modified.
DOWNLOADED — in case the object is only downloaded.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_PDM_STATE mdl state
§
GET_PDM_STATE_EX
Determines extended PDM Information by a reference.
Syntax
GET_PDM_STATE_EX model param<:out>
Arguments

model
The specified model.

param
Name of the parameter which receives the PDM state. Valid states are:
NO_PDM — in case the object was never stored to Intralink /
PDMLink.
NOT_CHECKED_IN — in case the object is saved in the workspace, but
was not yet checked in to the common space.
CHECKED_OUT — in case the object is checked out and can be
modified.
CHECKED_OUT_MODIFIED — in case the object is checked out and is
already modified.
DOWNLOADED — in case the object is only downloaded.
DOWNLOADED_MODIFIED — in case the object is downloaded and
modified.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_PDM_STATE_EX mdl state
§
GET_PDM_STATE_BY_NAME
Determines by name whether a model is downloaded, checked out or no
PDM object for Intralink 8.0 (and above) / PDMLink.
Syntax
GET_PDM_STATE_BY_NAME "model_name" param<:out>
Arguments

model_name
Specifies the model name. Any string expression is allowed. The
extension (e.g. '.prt', '.asm') must be included.

param
Name of the parameter which receives the PDM state. Valid states are:
NO_PDM — in case the object was never stored to Intralink /
PDMLink.
NOT_CHECKED_IN — in case the object is saved in the workspace, but
was not yet checked in to the common space.
CHECKED_OUT — in case the object is checked out and can be
modified.
DOWNLOADED — in case the object is only downloaded.
COMMONSPACE — in case the object is not available in the workspace.
Example
GET_PDM_STATE_BY_NAME "sample.prt" state
§
GET_PDM_STATE_BY_NAME_EX
Determines extended PDM information by name.
Syntax
GET_PDM_STATE_BY_NAME_EX "model_name" param<:out>
Arguments

model_name
Specifies the model name. Any string expression is allowed. The
extension (e.g. '.prt', '.asm') must be included.

param
Name of the parameter which receives the PDM state. Valid states are:
NO_PDM — in case the object was never stored to Intralink /
PDMLink.
NOT_CHECKED_IN — in case the object is saved in the workspace, but
was not yet checked in to the common space.
CHECKED_OUT — in case the object is checked out and can be
modified.
CHECKED_OUT_MODIFIED — in case the object is checked out and is
already modified.
DOWNLOADED — in case the object is only downloaded.
DOWNLOADED_MODIFIED — in case the object is downloaded and
modified.
COMMONSPACE — in case the object is not available in the workspace.
Example
GET_PDM_STATE_BY_NAME_EX "sample.prt" state
§
GET_PDM_STORAGE
Determines if the storage place of a model given by name for
Intralink 8.0 (and above) / PDMLink.
Syntax
GET_PDM_STORAGE "model_name" param<:out>
Arguments

model_name
Specifies the model name. Any string expression is allowed. The
extension (e.g. '.prt', '.asm') must be included.

param
Name of the parameter which receives the PDM storage place. Valid
places are:
NO_PDM — in case the object was never stored to Intralink /
PDMLink.
WORKSPACE — in case the object is saved in the workspace, but was
not yet checked it to the common space.
COMMONSPACE — in case the object was already checked into to the
common space.
Example
GET_PDM_STORAGE "sample.prt" storage_place
§
GET_PDM_MODIFICATION_STATE
Determines if an object is modified locally or in the workspace. This
could be used to determine if a model should be uploaded. The command
requires Creo Parametric 2.0 or above.
Syntax
GET_PDM_MODIFICATION_STATE "model_name" modified_locally<:out>
modified_in_workspace<:out>
Arguments

model_name
Specifies the model name. Any string expression is allowed. The
extension (e.g. '.prt', '.asm') must be included.

modified_locally
Name of the boolean variable which receives the information if the
model was modified locally.

modified_in_workspace
Name of the boolean variable which receives the information if the
model was modified in the workspace.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_PDM_MODIFICATION_STATE "sample.prt" modified_locally
modified_in_workspace

IF modified_locally == TRUE
PRINT "The object was locally modified"
END_IF

IF modified_in_workspace == TRUE
PRINT "The object was modified in the workspace"
END_IF
§
GET_PDM_LOCK_STATE
Determines the lock state of a model in PDMLink. The command is
available since Creo 4.0 M110 / Creo 6.0.3.0. Creo 5.0 is not
supported.
Syntax
GET_PDM_LOCK_STATE model lock_state<:out>
Arguments

model
The specified model.

lock_state
Name of the boolean variable which receives the information if the
model is locked in PDMLink or not.
Error handling
The program execution will be canceled if the model does not exist or
the lock state cannot be determined, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_PDM_LOCK_STATE PART lock_state
PRINT "%" lock_state
§
SET_PDM_LOCK_STATE
Sets the lock state of a model in PDMLink. The command is available
since Creo 4.0 M110 / Creo 6.0.3.0. Creo 5.0 is not supported.
Syntax
SET_PDM_LOCK_STATE model lock_stateBOOL
Arguments

model
The specified model.

lock_state
Boolean variable to lock or unlock the model in PDMLink.
Error handling
The program execution will be canceled if the model does not exist or
the lock state cannot be set, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
SET_PDM_LOCK_STATE PART TRUE
§
GET_URL_FROM_ALIASED_URL
Converts an aliased URL (like
"wtpub://buw/Produkts/SmartAssembly/sample.prt") to its real URL.
Syntax
GET_URL_FROM_ALIASED_URL "aliased_url" url<:out>
Arguments

aliased_url
Aliased url. Any string expression is allowed.

url
String variable which receives the URL.
Error handling
This functions fails if the aliased url could not be converted or if
the server is not active, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
GET_URL_FROM_ALIASED_URL "wtws://buw/SmartAssembly/sample.prt" url
PRINT "%" url
GET_URL_FROM_ALIASED_URL
"wtws://buw/SmartAssembly/instance<generic>.prt" instance_url
PRINT "%" instance_url
About Excel Commands
Excel commands includes reading and writing access to Microsoft Excel
spreadsheets and the functionality to open and save these documents.
The following commands are available:
EXCEL_CONNECT — to start and connect to the Microsoft Excel
application.
EXCEL_START — to start a new Microsoft Excel application instance.
EXCEL_DISCONNECT — to disconnect from the Microsoft Excel
application.
EXCEL_NEW_DOCUMENT — to create a new document.
EXCEL_LOAD_DOCUMENT — to load a document.
EXCEL_SAVE_DOCUMENT — to save a document.
EXCEL_CLOSE_DOCUMENT — to close a document.
EXCEL_ACTIVATE_SHEET — to activate a sheet of the active document.
EXCEL_GET_ACTIVE_SHEET — to determine the index of the active sheet
of the active document.
EXCEL_GET_SHEET_NAME — to retrieve the name of the specified sheet
of the active document.
EXCEL_GET_SHEET_NAMES — to retrieve the name of all sheets of the
excel document.
EXCEL_CREATE_SHEET — to create a new sheet in the active document.
EXCEL_COPY_SHEET — to create a copy of an existing sheet.
EXCEL_MOVE_SHEET — to move an existing sheet.
EXCEL_GET_VALUE — to retrieve one value from the active sheet.
EXCEL_GET_STRING — to retrieve one text from the active sheet.
EXCEL_GET_VALUES — to retrieve multiple values from the active
sheet.
EXCEL_GET_STRINGS — to retrieve multiple strings from the active
sheet.
EXCEL_SET_VALUE — to set one value to the active sheet.
EXCEL_SET_VALUES — to set multiple values to the active sheet.
EXCEL_CLEAR_CONTENT — to clear the content of one cell or of a
range of cells.
EXCEL_GET_SELECTION — to retrieve the information about the
selected cells.
EXCEL_ACTIVATE_DOCUMENT — to activate a document.
EXCEL_GET_DOCUMENT_NAME — to retrieve the name of the active
document.
EXCEL_GET_DOCUMENT_READONLY — to retrieve the information if the
document is opened read-only.
EXCEL_GET_CELL_BY_NAME — to retrieve row and column index based on
the cell name.
EXCEL_GET_ACTIVE_RANGE — to determine the active range of a
document.
EXCEL_UPDATE_BUFFER — to synchronize the Excel read/write buffer.
EXCEL_GET_VALUE_BUFFER — to read a value from the Excel buffer.
EXCEL_GET_STRING_BUFFER — ro read a string from the Excel buffer.
EXCEL_SET_VALUE_BUFFER — to write a value to the Excel buffer.
EXCEL_CLEAR_BUFFER — to clear the data of the Excel buffer.
EXCEL_GET_FILE_EXTENSION — to evaluate the standard file extension
for the connected Microsoft Excel.
EXCEL_RUN_MACRO — to execute a macro in the active Excel document.
EXCEL_DISPLAY_ALERTS — to enable or disable Excel alerts.
EXCEL_ENABLE_MACROS — to enable or disable Excel macros.
EXCEL_ADD_ROWS — to add new rows to the active Excel sheet.
EXCEL_DELETE_ROWS — to delete existing rows from the active Excel
sheet.
EXCEL_ADD_COLUMNS — to add new columns to the active Excel sheet.
EXCEL_DELETE_COLUMS — to delete existing columns from the active
Excel sheet.
EXCEL_TO_FOREGROUND — to bring the Excel window to the front of the
screen.
Additionally the following logical expression can be used:
EXCEL_CONNECTED — to determine if a connection to Microsoft
Excel already established.
EXCEL_HAS_DOCUMENT — to determine if a document is opened in
Microsoft Excel.
§
EXCEL_CONNECT
Establishes a connection to Microsoft Excel. In case Excel is not
already running, it will be launched. Otherwise a connection to the
already running Excel program is established.
Syntax
EXCEL_CONNECT [options]
Arguments

options
INVISIBLE — In case Excel is not running already, it will be
started without showing the UI.
Note
In case Excel was launched by EXCEL_CONNECT, EXCEL_DISCONNECT will
shut down Excel. If you want to figure out whether Excel is already
connected use the logical expression EXCEL_CONNECTED in an IF
statement.
Example
IF NOT EXCEL_CONNECTED
EXCEL_CONNECT
END_IF
§
EXCEL_START
Starts a new connection to Microsoft Excel.
Syntax
EXCEL_START [options]
Arguments

options
INVISIBLE — Excel will be started without showing the UI.
Note
EXCEL_DISCONNECT will shut down Excel. If this command is not used,
the Excel process will be terminated after the tab file was executed.
If you want to figure out whether Excel is already connected use the
logical expression EXCEL_CONNECTED in an IF statement.
Example
EXCEL_START INVISIBLE
§
EXCEL_DISCONNECT
Terminates a connection to Microsoft Excel.
Syntax
EXCEL_DISCONNECT
Note
In case Excel was launched by EXCEL_CONNECT, EXCEL_DISCONNECT will
shut down Excel. If you want to figure out whether Excel is already
connected use the logical expression EXCEL_CONNECTED in an IF
statement.
Example
IF EXCEL_CONNECTED
EXCEL_DISCONNECT
END_IF
§
EXCEL_NEW_DOCUMENT
Creates a new Excel document.
Syntax
EXCEL_NEW_DOCUMENT
Example
EXCEL_NEW_DOCUMENT
§
EXCEL_LOAD_DOCUMENT
Retrieves a new Excel document specified by the name. The document
could be located either in library or in working directory.
Syntax
EXCEL_LOAD_DOCUMENT "document_name"
Arguments

document_name
Name and path of the document. According to the path specification it
could be either in library or in working directory. Any string
expression is allowed.
Error handling
The program execution will be canceled if the document can't be
retrieved, unless errors are handled by BEGIN_CATCH_ERROR.
Note
If no file extension is specified for document name the default
extension is determined.
Example
EXCEL_LOAD_DOCUMENT lib:sample.xls
§
EXCEL_SAVE_DOCUMENT
Saves a Excel document specified by the name. The document could be
located either in library or in working directory.
Syntax
EXCEL_SAVE_DOCUMENT ["document_name"]
Arguments

document_name
Optional name and path of the document according to the path
specification rules. Any string expression is allowed.
Error handling
The program execution will be canceled if the document can't be
saved, unless errors are handled by BEGIN_CATCH_ERROR.
Note
If no name is specified the document is saved by its current name. If
no file extension is specified for document name the default
extension is determined.
Example
EXCEL_SAVE_DOCUMENT lib:sample.xls
§
EXCEL_CLOSE_DOCUMENT
Closes the active document in Excel.
Syntax
EXCEL_CLOSE_DOCUMENT [options]
Arguments

options
The following options are available:
SAVE_CHANGES save_option — where the save option is YES, NO or ASK.
Default is NO.
Error handling
The program execution will be canceled if the document can't be saved
before closing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
EXCEL_CLOSE_DOCUMENT SAVE_CHANGES ASK
§
EXCEL_ACTIVATE_SHEET
Activates a specific data sheet of the active document in Excel.
Syntax
EXCEL_ACTIVATE_SHEET sheet
Arguments

sheet
The sheet could be specified either by the sheet index (starting with
0) or by the sheet name (for example sheet1). to distinguish these
cases, the following options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name. Any string expression could be used
for this.

SHEET_BY_INDEX sheet_numberINT
Specifies the sheet by index starting with 0. Any math expression
could be used of this.
If no sheet option is specified SHEET_BY_INDEX is used as default.
Note
Reading and writing values and accessing selections are always
regarding the active sheet.
Example
EXCEL_ACTIVATE_SHEET SHEET_BY_INDEX 0
§
EXCEL_GET_ACTIVE_SHEET
Determines the index of the active sheet of the active document in
Excel.
Syntax
EXCEL_GET_ACTIVE_SHEET paramSheetIndex<:out>
Arguments

paramSheetIndex
Name of the parameter which will receive the index of the active
sheet.
Note
The sheet index starts with 0 for the first sheet.
Example
EXCEL_GET_ACTIVE_SHEET index
EXCEL_GET_SHEET_NAME index name
PRINT "Active sheet: %" index
§
EXCEL_GET_SHEET_NAME
Retrieves the name of the specified sheet of the active excel
document.
Syntax
EXCEL_GET_SHEET_NAME indexINT paramSheetName<:out>
Arguments

index
Index to specify number of the sheet. The numbering starts with 0.

paramSheetName
Name of the parameter which will receive the sheet name.
Example
EXCEL_GET_ACTIVE_SHEET index
EXCEL_GET_SHEET_NAME index name
PRINT "Active sheet: %" index
§
EXCEL_GET_SHEET_NAMES
Retrieves the name of all sheets of the excel document.
Syntax
EXCEL_GET_SHEET_NAMES arraySheetNames<:out>
Arguments

arraySheetNames
Name of the array which will receive the sheet names
Example
EXCEL_GET_SHEET_NAMES arraySheetNames
FOR sheetName REF ARRAY arraySheetNames
PRINT "%" sheetName
END_FOR
§
EXCEL_CREATE_SHEET
Creates a new sheet in the active document in Excel. In case the
sheet already exists, it activates the existing sheet.
Syntax
EXCEL_CREATE_SHEET sheet "new_sheet_name"
Arguments

sheet
The sheet could be specified either by the sheet index (starting with
0) or by the sheet name (for example "sheet1"). to distinguish these
cases, the following options are available:
SHEET_BY_NAME "predecessor_name"
Specifies the predecessor sheet by name. Any string expression
could be used for this. In case of an empty string or if the sheet
name could not be found, the new sheet is inserted at last.

SHEET_BY_INDEX sheet_numberINT
Specifies the sheet by index starting with 0 for the first
position. Any math expression could be used of this. In case of an
negative number or if the number exceeds the number of existing
sheets, the new sheet is inserted as last.
If no sheet option is specified SHEET_BY_INDEX is used as default.

new_sheet_name
Name of the sheet which should be created. Any string expression
could be used for this If an empty sheet name is specified, a default
name is used.
Error handling
The program execution will be canceled if the sheet can't be created,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
The new sheet will be automatically activated.
Example
EXCEL_CREATE_SHEET SHEET_BY_INDEX 0 "New sheet"
§
EXCEL_COPY_SHEET
Creates a copy of an existing sheet in the active Excel document.
Syntax
EXCEL_COPY_SHEET sheet_to_copy<:in> "position_indicator"
sheet_pos<:in> "sheet_name"
Arguments

sheet_to_copy
The sheet could be specified either by the sheet index (starting with
0) or by the sheet name (for example "sheet1"). to distinguish these
cases, the following options are available:
SHEET_BY_NAME "sheet_name"
Specifies the sheet by name. Any string expression could be used
for this. In case of an empty string or if the sheet name could not
be found, the last sheet is used.

SHEET_BY_INDEX sheet_numberINT
Specifies the sheet by index starting with 0 for the first
position. Any math expression could be used of this. In case of an
negative number or if the number exceeds the number of existing
sheets, the last sheet is used.
If no sheet option is specified SHEET_BY_INDEX is used as default.

position_indicator
Either BEFORE or AFTER to indicate whether the sheet should be copied
before or after the specified position. Any string expression could
be used for this.

sheet_pos
The new position of the sheet could be specified either by the sheet
index (starting with 0) or by the sheet name (for example "sheet1").
to distinguish these cases, the following options are available:
SHEET_BY_NAME "sheet_name"
Specifies the sheet by name. Any string expression could be used
for this. In case of an empty string or if the sheet name could not
be found, the last sheet is used.

SHEET_BY_INDEX sheet_numberINT
Specifies the sheet by index starting with 0 for the first
position. Any math expression could be used of this. In case of an
negative number or if the number exceeds the number of existing
sheets, the last sheet is used.
If no sheet option is specified SHEET_BY_INDEX is used as default.

sheet_name
Name of the new sheet which was copied. Any string expression could
be used for this If an empty sheet name is specified, a default name
is used.
Error handling
The program execution will be canceled if the sheet can't be copied,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Copy table1 to the second last position.
EXCEL_COPY_SHEET SHEET_BY_NAME "Table1" BEFORE SHEET_BY_INDEX -1
"Table1-2"
§
EXCEL_MOVE_SHEET
Moves an existing sheet in the active Excel document.
Syntax
EXCEL_MOVE_SHEET sheet_to_move<:in> "position_indicator"
sheet_pos<:in>
Arguments

sheet_to_move
The sheet could be specified either by the sheet index (starting with
0) or by the sheet name (for example "sheet1"). to distinguish these
cases, the following options are available:
SHEET_BY_NAME "sheet_name"
Specifies the sheet by name. Any string expression could be used
for this. In case of an empty string or if the sheet name could not
be found, the last sheet is used.

SHEET_BY_INDEX sheet_numberINT
Specifies the sheet by index starting with 0 for the first
position. Any math expression could be used of this. In case of an
negative number or if the number exceeds the number of existing
sheets, the last sheet is used.
If no sheet option is specified SHEET_BY_INDEX is used as default.

position_indicator
Either BEFORE or AFTER to indicate whether the sheet should be moved
before or after the specified position. Any string expression could
be used for this.

sheet_pos
The new position of the sheet could be specified either by the sheet
index (starting with 0) or by the sheet name (for example "sheet1").
to distinguish these cases, the following options are available:
SHEET_BY_NAME "sheet_name"
Specifies the sheet by name. Any string expression could be used
for this. In case of an empty string or if the sheet name could not
be found, the last sheet is used.

SHEET_BY_INDEX sheet_numberINT
Specifies the sheet by index starting with 0 for the first
position. Any math expression could be used of this. In case of an
negative number or if the number exceeds the number of existing
sheets, the last sheet is used.
If no sheet option is specified SHEET_BY_INDEX is used as default.

sheet_name
Name of the new sheet which was copied. Any string expression could
be used for this If an empty sheet name is specified, a default name
is used.
Error handling
The program execution will be canceled if the sheet can't be moved,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Move table1 to the last position.
EXCEL_MOVE_SHEET SHEET_BY_NAME "Table1" AFTER SHEET_BY_INDEX -1
§
EXCEL_GET_VALUE
Retrieves a value of the specified row and column in Excel and stores
to a parameter.
Syntax
EXCEL_GET_VALUE cell parameter<:out>
Arguments

cell
The cell could be specified either by the cell index (starting with 0
for row and column), a standard cell name (for example B12) or a
custom cell name which is defined in the excel spread sheet. To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
For backward compatibility the keyword CELL_BY_INDEX is not required
to specify.

parameter
Name of the parameter which should contain the cell data. The type of
the parameter is adjusted to the cell content and could be figured
out by GET_PARAM_TYPE.
Error handling
The program execution will be canceled if value could not be read,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
Use this function to retrieve a variable depending on the data type
in Excel. To get the content as a string use EXCEL_GET_STRING.
Example
EXCEL_GET_VALUE 0 0 value1
EXCEL_GET_VALUE CELL_BY_INDEX 1 1 value2
EXCEL_GET_VALUE CELL_BY_NAME "B12" value3
§
EXCEL_GET_STRING
Retrieves a string of the specified row and column in Excel and
stores to a parameter. This command does not consider hidden cells.
Syntax
EXCEL_GET_STRING cell parameter<:out>
Arguments

cell
The cell could be specified either by the cell index (starting with 0
for row and column), a standard cell name (for example B12) or a
custom cell name which is defined in the excel spread sheet. To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
For backward compatibility the keyword CELL_BY_INDEX is not required
to specify.

parameter
Name of the string parameter which should contain the cell data.
Note
Use this function to retrieve the cell text as it shows up in Excel.
To get variables depending on the data type in Excel use
EXCEL_GET_VALUE.
Example
EXCEL_GET_STRING 0 0 strText1
EXCEL_GET_STRING CELL_BY_INDEX 1 1 strText2
EXCEL_GET_STRING CELL_BY_NAME "B12" strText3
§
EXCEL_GET_VALUES
Retrieves the content from multiple excel cells and stores in to an
array. Each element of the array is a sub array describing row,
column and value.
Syntax
EXCEL_GET_VALUES cellFrom cellTo array<:out>
Arguments

cellFrom / cellTo
Delimits the block inside the active excel sheet whose data should be
transferred.
Each cell could be specified either by the cell index (starting with
0 for row and column), a standard cell name (for example B12) or a
custom cell name which is defined in the excel spread sheet. To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
For backward compatibility the keyword CELL_BY_INDEX is not required
to specify.

array
Array which will receive the retrieved data in form of sub arrays.
Each sub array contains the data of a cell. First element is the row
index, second element is the column index and third element is the
cell data.
Row and column index start counting with 0 for the first element.
Error handling
The program execution will be canceled if values could not be read,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
Use this function to retrieve a variable depending on the data type
in Excel. To get the content as a string use EXCEL_GET_STRINGS. If a
large number of values should be retrieved in a loop, EXCEL_GET_VALUE
is quite slow. Therefor EXCEL_GET_VALUES was added.
Example
EXCEL_CONNECT
EXCEL_LOAD_DOCUMENT lib:data.xls
DECLARE_ARRAY arrayExcelData
EXCEL_GET_VALUES CELL_BY_NAME B5 CELL_BY_NAME J15 arrayData
FOR data REF ARRAY arrayData
GET_ARRAY_ELEM data 0 row
GET_ARRAY_ELEM data 1 col
GET_ARRAY_ELEM data 2 value
PRINT "(%/%): %" row col value
END_FOR
EXCEL_DISCONNECT
§
EXCEL_GET_STRINGS
Retrieves the strings from multiple excel cells and stores in to an
array. Each element of the array is a sub array describing row,
column and value. Use this function to retrieve the cell text as it
shows up in Excel. This command does not consider hidden cells.
Syntax
EXCEL_GET_STRINGS cellFrom cellTo array<:out>
Arguments

cellFrom / cellTo
Delimits the block inside the active excel sheet whose data should be
transferred.
Each cell could be specified either by the cell index (starting with
0 for row and column), a standard cell name (for example B12) or a
custom cell name which is defined in the excel spread sheet. To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
For backward compatibility the keyword CELL_BY_INDEX is not required
to specify.

array
Array which will receive the retrieved data in form of sub arrays.
Each sub array contains the data of a cell. First element is the row
index, second element is the column index and third element is the
string parameter.
Row and column index start counting with 0 for the first element.
Note
Use this function to retrieve the cell text as it shows up in Excel.
Example
EXCEL_CONNECT
EXCEL_LOAD_DOCUMENT lib:data.xls
DECLARE_ARRAY arrayExcelData
EXCEL_GET_STRINGS CELL_BY_NAME B5 CELL_BY_NAME J15 arrayData
FOR data REF ARRAY arrayData
GET_ARRAY_ELEM data 0 row
GET_ARRAY_ELEM data 1 col
GET_ARRAY_ELEM data 2 value
PRINT "(%/%): %" row col value
END_FOR
EXCEL_DISCONNECT
§
EXCEL_SET_VALUE
Retrieves a parameter values and assigns it to an Excel cell.
Syntax
EXCEL_SET_VALUE cell parameter<:in>
Arguments

cell
The cell could be specified either by the cell index (starting with 0
for row and column), a standard cell name (for example B12) or a
custom cell name which is defined in the excel spread sheet. To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
For backward compatibility CELL_BY_INDEX is not required to specify.

parameter
Name of the parameter which contains the cell data.
Error handling
The program execution will be canceled if value could not be set,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
For large number of values which should be transferred
EXCEL_SET_VALUE is quite slow. Therefor EXCEL_SET_VALUES was added.
Example
EXCEL_SET_VALUE 0 0 17.8
EXCEL_SET_VALUE CELL_BY_INDEX 1 1 17.8
EXCEL_SET_VALUE CELL_BY_NAME "B12" 17.8
§
EXCEL_SET_VALUES
Assigns the content of a complete array to Excel cell. Each element
of the array is a sub array describing row, column and value.
Syntax
EXCEL_SET_VALUES array<:in>
Arguments

array
Name of the existing array which has to consists of sub arrays. Each
sub array specifies a cell. It must have two or three elements.
In case of two elements, first element is cell name and the second
element is the value which should be placed in the cell.
In case of three elements, first element is the row index, second
element is the column index and third element is the value which
should be placed in the cell. Row and column index start counting
with 0 for the first element.
Error handling
The program execution will be canceled if the array was not found or
the values could not be set, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
If a large number of values should be transferred in a loop,
EXCEL_SET_VALUE is quite slow. Therefor EXCEL_SET_VALUES was added.
Example
DECLARE_ARRAY arrayValues
DECLARE_VARIABLE INTEGER row
DECLARE_VARIABLE INTEGER col
row = 0
WHILE row < 10
col = 0
WHILE col < 5
DECLARE_ARRAY arrayCell
CLEAR_ARRAY arrayCell
ADD_ARRAY_ELEM arrayCell row
ADD_ARRAY_ELEM arrayCell col
DECLARE_VARIABLE DOUBLE value
value = row*col
ADD_ARRAY_ELEM arrayCell value
ADD_ARRAY_ELEM arrayValues arrayCell
col = col + 1
END_WHILE
row = row + 1
END_WHILE
EXCEL_CONNECT
EXCEL_NEW_DOCUMENT
EXCEL_SET_VALUES arrayValues
WAIT
EXCEL_DISCONNECT
§
EXCEL_CLEAR_CONTENT
Clears the content of one Excel cell or of a range of cells
Syntax
EXCEL_CLEAR_CONTENT cellFrom [cellTo]
Arguments

cellFrom / cellTo
Delimits the block inside the active excel sheet whose content should
be cleared.
Each cell could be specified either by the cell index (starting with
0 for row and column), a standard cell name (for example B12) or a
custom cell name which is defined in the excel spread sheet. To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
For backward compatibility the keyword CELL_BY_INDEX is not required
to specify.
Note
The cellTo argument is optional. In case this is not specified only
one cell is cleared.
Example
EXCEL_CONNECT
EXCEL_LOAD_DOCUMENT lib:data.xls
EXCEL_CLEAR_CONTENT CELL_BY_INDEX 0 0
EXCEL_CLEAR_CONTENT CELL_BY_INDEX 10 10 CELL_BY_INDEX 14 15
EXCEL_SAVE_DOCUMENT
EXCEL_DISCONNECT
§
EXCEL_GET_SELECTION
Assigns the content of a currently selected Excel cells to an array.
For each selected cell a sub array consisting on row and column index
and the content of the cell is appended.
Syntax
EXCEL_GET_SELECTION array<:out>
Arguments

array
Name of the new array which will receive the information for each
selected cell as a sub array. Each sub array consists of the row
index as first value, the column index as second value and the
content as third value.
Example
EXCEL_CONNECT
WAIT
EXCEL_GET_SELECTION arraySel
FOR cell REF ARRAY arraySel
GET_ARRAY_ELEM cell 0 row
GET_ARRAY_ELEM cell 1 col
GET_ARRAY_ELEM cell 2 content
PRINT "%/%: %" row col content
END_FOR
EXCEL_DISCONNECT
§
EXCEL_ACTIVATE_DOCUMENT
Activates a specific document in excel. The document must already be
loaded. This functionality is used to switch between different
documents for reading and writing.
Syntax
EXCEL_ACTIVATE_DOCUMENT "document"
Arguments

document
Name of the document. Any string expression is allowed.
Note
No document path should be specified. Since the document is already
retrieved by Excel, no path is required.
Error handling
The program execution will be canceled if the document does not
exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
EXCEL_ACTIVATE_DOCUMENT "test.xls"
§
EXCEL_GET_DOCUMENT_NAME
Retrieves the name of the active excel document.
Syntax
EXCEL_GET_DOCUMENT_NAME paramDocName<:out>
Arguments

paramDocName
Name of the parameter which will receive the document name.
Example
EXCEL_GET_DOCUMENT_NAME name
PRINT "Active doc: %" index
§
EXCEL_GET_DOCUMENT_READONLY
Retrieves the information if the document is opened read-only.
Syntax
EXCEL_GET_DOCUMENT_READONLY paramReadonly<:out>
Arguments

paramReadonly
Name of the boolean parameter which receives the information if the
document is opened read-only.
Example
EXCEL_GET_DOCUMENT_READONLY bReadonly
IF bReadonly
PRINT "READONLY"
ELSE
PRINT "NOT READONLY"
END_IF
§
EXCEL_GET_CELL_BY_NAME
Retrieves the row and column index based on the cell name.
Syntax
EXCEL_GET_CELL_BY_NAME "name" paramRow<:out> paramCol<:out>
Arguments

name
Name of the cell.

paramRow
Name of the Parameter which will receive the row index.

paramCol
Name of the Parameter which will receive the column index.
Example
EXCEL_GET_CELL_BY_NAME "A10" row col
EXCEL_SET_VALUE row col 10
§
EXCEL_GET_ACTIVE_RANGE
Determines the active range of a document. This is the smallest block
which contains all cells with a value in the active sheet.
Syntax
EXCEL_GET_ACTIVE_RANGE paramRowFrom<:out> paramRowTo<:out>
paramColFrom<:out> paramColTo<:out>
Arguments

paramRowFrom
Name of the parameter which will receive the lower row index. Rows
starts counting with 0.

paramRowTo
Name of the parameter which will receive the upper row index. Rows
starts counting with 0.

paramColFrom
Name of the parameter which will receive the lower column index.
Columns starts counting with 0.

paramColTo
Name of the parameter which will receive the upper column index.
Columns starts counting with 0.
Note
In case of an empty sheet all upper and lower indices are 0.
Example
EXCEL_GET_ACTIVE_RANGE row_min row_max col_min col_max
PRINT "%/% - %/%" row_min row_max col_min col_max
§
EXCEL_UPDATE_BUFFER
Synchronizes the Excel read/write buffer with the active sheet. This
command is used to allow buffered read/write access to Excel data
with higher performance.
Syntax
EXCEL_UPDATE_BUFFER [options] direction
Arguments

options
The following options are supported:

UPDATE_STRINGS valueBOOL — determines if also the strings are read


into the buffer. This is required in order to use the
EXCEL_GET_STRING_BUFFER command. Default is TRUE.

direction
Direction of the synchronization:
EXCEL_TO_BUFFER
Reads the current sheet information the buffer.
BUFFER_TO_EXCEL
Writes the buffer to the current sheet.
Example
EXCEL_UPDATE_BUFFER EXCEL_TO_BUFFER
EXCEL_GET_ACTIVE_RANGE rowFrom rowTo colFrom colTo
DECLARE_VARIABLE INTEGER row rowFrom
DECLARE_VARIABLE INTEGER col colFrom

WHILE row <= rowTo


WHILE col <= colTo
EXCEL_GET_VALUE_BUFFER CELL_BY_INDEX row col data
data *= 2
EXCEL_SET_VALUE_BUFFER CELL_BY_INDEX row col data
col++
END_WHILE

col = colFrom
row++
END_WHILE

EXCEL_UPDATE_BUFFER BUFFER_TO_EXCEL
EXCEL_CLEAR_BUFFER
§
EXCEL_GET_VALUE_BUFFER
Retrieves a value from the Excel read/write buffer. This command
allows to read data from Excel with high performance.
Syntax
EXCEL_GET_VALUE_BUFFER cell parameter<:out>
Arguments

cell
The cell could be specified either by the cell index (starting with 0
for row and column), a standard cell name (for example B12) or a
custom cell name which is defined in the excel spread sheet. To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
For backward compatibility the keyword CELL_BY_INDEX is not required
to specify.

parameter
Name of the parameter which should contain the cell data. The type of
the parameter is adjusted to the cell content and could be figured
out by GET_PARAM_TYPE.
Error handling
The program execution will be canceled if value could not be read,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
EXCEL_UPDATE_BUFFER EXCEL_TO_BUFFER
EXCEL_GET_ACTIVE_RANGE rowFrom rowTo colFrom colTo
DECLARE_VARIABLE INTEGER row rowFrom
DECLARE_VARIABLE INTEGER col colFrom

WHILE row <= rowTo


WHILE col <= colTo
EXCEL_GET_VALUE_BUFFER CELL_BY_INDEX row col data
data *= 2
EXCEL_SET_VALUE_BUFFER CELL_BY_INDEX row col data
col++
END_WHILE

col = colFrom
row++
END_WHILE

EXCEL_UPDATE_BUFFER BUFFER_TO_EXCEL
EXCEL_CLEAR_BUFFER
§
EXCEL_GET_STRING_BUFFER
Retrieves a string from the Excel read/write buffer. This command
allows to read data from Excel with high performance. This command
does not consider hidden cells.
Syntax
EXCEL_GET_STRING_BUFFER cell parameter<:out>
Arguments

cell
The cell could be specified either by the cell index (starting with 0
for row and column), a standard cell name (for example B12) or a
custom cell name which is defined in the excel spread sheet. To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
For backward compatibility the keyword CELL_BY_INDEX is not required
to specify.

parameter
Name of the variable of type string which should contain the cell
data.
Example
EXCEL_UPDATE_BUFFER EXCEL_TO_BUFFER
EXCEL_GET_ACTIVE_RANGE rowFrom rowTo colFrom colTo
DECLARE_VARIABLE INTEGER row rowFrom
DECLARE_VARIABLE INTEGER col colFrom

WHILE row <= rowTo


WHILE col <= colTo
EXCEL_GET_VALUE_BUFFER_STRING CELL_BY_INDEX row col strdata
data = stof(strdata)
data *= 2
EXCEL_SET_VALUE_BUFFER CELL_BY_INDEX row col data
col++
END_WHILE

col = colFrom
row++
END_WHILE

EXCEL_UPDATE_BUFFER BUFFER_TO_EXCEL
EXCEL_CLEAR_BUFFER
§
EXCEL_SET_VALUE_BUFFER
Writes a value to the Excel read/write buffer. This command allows to
write data from Excel with high performance.
Syntax
EXCEL_SET_VALUE_BUFFER cell parameter<:in>
Arguments

cell
The cell could be specified either by the cell index (starting with 0
for row and column), a standard cell name (for example B12) or a
custom cell name which is defined in the excel spread sheet. To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
For backward compatibility CELL_BY_INDEX is not required to specify.

parameter
Name of the parameter which contains the cell data.
Error handling
The program execution will be canceled if value could not be set,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
EXCEL_UPDATE_BUFFER EXCEL_TO_BUFFER
EXCEL_GET_ACTIVE_RANGE rowFrom rowTo colFrom colTo
DECLARE_VARIABLE INTEGER row rowFrom
DECLARE_VARIABLE INTEGER col colFrom

WHILE row <= rowTo


WHILE col <= colTo
EXCEL_GET_VALUE_BUFFER CELL_BY_INDEX row col data
data *= 2
EXCEL_SET_VALUE_BUFFER CELL_BY_INDEX row col data
col++
END_WHILE

col = colFrom
row++
END_WHILE

EXCEL_UPDATE_BUFFER BUFFER_TO_EXCEL
EXCEL_CLEAR_BUFFER
§
EXCEL_CLEAR_BUFFER
Clears the data of the Excel read/write buffer.
Syntax
EXCEL_CLEAR_BUFFER
Example
EXCEL_UPDATE_BUFFER EXCEL_TO_BUFFER
EXCEL_GET_ACTIVE_RANGE rowFrom rowTo colFrom colTo
DECLARE_VARIABLE INTEGER row rowFrom
DECLARE_VARIABLE INTEGER col colFrom

WHILE row <= rowTo


WHILE col <= colTo
EXCEL_GET_VALUE_BUFFER CELL_BY_INDEX row col data
data *= 2
EXCEL_SET_VALUE_BUFFER CELL_BY_INDEX row col data
col++
END_WHILE
row++
END_WHILE

EXCEL_UPDATE_BUFFER BUFFER_TO_EXCEL
EXCEL_CLEAR_BUFFER
§
EXCEL_GET_FILE_EXTENSION
Evaluates if the currently connected Microsoft Excel is using xslx or
xls as file extension.
Syntax
EXCEL_GET_FILE_EXTENSION parameter<:out>
Arguments

parameter
Name of the string parameter which should contain the extension.
Currently the following values are returned:
xlsx — for Microsoft Excel 2010 and 2007
xls — for Microsoft Excel 97, 2000 and 2003
Example
EXCEL_GET_FILE_EXTENSION ext
PRINT "Extension: %" ext
§
EXCEL_RUN_MACRO
Executes a Macro in the current Excel document.
Syntax
EXCEL_RUN_MACRO "macro_name" array_arguments<:in>
Arguments

macro_name
Name of the macro. This can be either a sub routine or a function.
Any string expression is allowed.

array_arguments
Name of an existing array whose elements are used as arguments for
the macro.
Error handling
Error handling
The program execution will be canceled if the macro fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
The number of arguments must match the macro declaration in Excel.
For example the macro declaration is used for an array with a string
and an integer argument:
Sub function(argument1 As String, argumen2 As Integer)
Example
BEGIN_ASM_DESCR
EXCEL_CONNECT
EXCEL_LOAD_DOCUMENT "lib:sample.xls"

DECLARE_ARRAY arrayArgumentsMacro
ADD_ARRAY_ELEM arrayArgumentsMacro "This is a text"
ADD_ARRAY_ELEM arrayArgumentsMacro 11
ADD_ARRAY_ELEM arrayArgumentsMacro 23.456
EXCEL_RUN_MACRO "SampleMacro1" arrayArgumentsMacro

WAIT

DECLARE_ARRAY arrayArgumentsFunction1
ADD_ARRAY_ELEM arrayArgumentsFunction1 "This is the message text"
EXCEL_RUN_MACRO "SampleFunction1" arrayArgumentsFunction1

WAIT

EXCEL_DISCONNECT
END_ASM_DESCR
§
EXCEL_DISPLAY_ALERTS
Enables or disables Excel alerts. By default the alters are disabled.
Syntax
EXCEL_DISPLAY_ALERTS alertBOOL<:in>
Arguments

alert
Boolean variable which decides if Excel alerts will be shown to the
user.
Example
EXCEL_DISPLAY_ALERTS TRUE
§
EXCEL_ENABLE_MACROS
Enables or disables Excel macros. By default the macros are enabled.
Enabling or disabling macros is only effective before opening the
document.
Syntax
EXCEL_ENABLE_MACRO enable_macroBOOL<:in>
Arguments

enable_macro
Boolean variable which decides if macros could be executed in Excel
document which are opened after this command.
Error handling
The program execution will be canceled if the macros cannot be
enabled or disabled, unless errors are handled by BEGIN_CATCH_ERROR.
Example
EXCEL_ENABLE_MACROS FALSE
EXCEL_LOAD_DOCUMENT "lib:sample.xlsm"
§
EXCEL_ADD_ROWS
Adds new rows to the active Excel sheet.
Syntax
EXCEL_ADD_ROWS rowINT number_rowsINT
Arguments

row
The row index where the new rows should be added. The row index is
starting with 0. Any math expression is allowed.

number_rows
The number of rows which should be added. Any math expression is
allowed.
Error handling
The program execution will be canceled if the rows could not be
added, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Add 3 rows at the front of the active sheet
EXCEL_ADD_ROWS 0 3
§
EXCEL_DELETE_ROWS
Deletes existing rows from the active Excel sheet.
Syntax
EXCEL_DELETE_ROWS rowINT number_rowsINT
Arguments

row
The first row which should be deleted. The row index is starting with
0. Any math expression is allowed.

number_rows
The number of rows which should be deleted. Any math expression is
allowed.
Error handling
The program execution will be canceled if the rows could not be
deleted, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Delete 3 rows from the front of the active sheet
EXCEL_DELETE_ROWS 0 3
§
EXCEL_ADD_COLUMNS
Adds new columns to the active Excel sheet.
Syntax
EXCEL_ADD_COLUMNS colINT number_colsINT
Arguments

col
The column index where the new columns should be added. The column
index is starting with 0. Any math expression is allowed.

number_cols
The number of columns which should be added. Any math expression is
allowed.
Error handling
The program execution will be canceled if the columns could not be
added, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Add 3 columns at the front of the active sheet
EXCEL_ADD_COLUMNS 0 3
§
EXCEL_DELETE_COLUMNS
Deletes existing columns from the active Excel sheet.
Syntax
EXCEL_DELETE_COLUMNS colINT number_colsINT
Arguments

col
The first column which should be deleted. The column index is
starting with 0. Any math expression is allowed.

number_cols
The number of columns which should be deleted. Any math expression is
allowed.
Error handling
The program execution will be canceled if the column could not be
deleted, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Delete 3 columns from the front of the active sheet
EXCEL_DELETE_COLUMNS 0 3
§
EXCEL_TO_FOREGROUND
Brings the Excel window to the front of the screen.
Syntax
EXCEL_TO_FOREGROUND
Example
EXCEL_TO_FOREGROUND
About Word Commands
Excel commands includes reading and writing access to Microsoft Word
documents and the functionality to open and save these documents.
The following commands are available:
WINWORD_CONNECT — to start and connect to the Microsoft Word
application.
WINWORD_DISCONNECT — to disconnect from the Microsoft Word
application.
WINWORD_LOAD_DOCUMENT — to load a document
WINDORD_SAVE_DOCUMENT — to save a document.
WINWORD_GET_BOOKMARK_TEXT — to retrieve the content of a bookmark.
WINWORD_SET_BOOKMARK_TEXT — to modify the content of a bookmark.
WINWORD_GET_BOOKMARKS — to retrieve an array of all bookmark names
from a document.
WINWORD_REPLACE — to replace text in the current Word document.
Additionally the following logical expression can be used:
WINWORD_CONNECTED — to figure out if a connection to Microsoft
Word is already established.
§
WINWORD_CONNECT
Establishes a connection to Microsoft Word. In case Word is not
already running, it will be launched. Otherwise a connection to the
already running Word program is established.
Syntax
WINWORD_CONNECT
Note
In case Word was launched by WINWORD_CONNECT, WINWORD_DISCONNECT will
shut down Word. If you want to figure out whether Microsoft Word is
already connected use the logical expression WINWORD_CONNECTED in an
IF statement.
Example
IF NOT WINWORD_CONNECTED
WINWORD_CONNECT
END_IF
§
WINDORD_DISCONNECT
Terminates a connection to Microsoft Word.
Syntax:
WINWORD_DISCONNECT
Note:
In case Word was launched by WINWORD_CONNECT, WINWORD_DISCONNECT will
shut down Word. If you want to figure out whether Microsoft Word is
already connected use the logical expression WINWORD_CONNECTED in an
IF statement.
Example
IF WINWORD_CONNECTED
WINWORD_DISCONNECT
END_IF
§
WINWORD_LOAD_DOCUMENT
Retrieves a new Word document specified by the name. The document
could be located either in library or in working directory.
Syntax
WINWORD_LOAD_DOCUMENT "document_name"
Arguments

document_name
Name and path of the document. According to the path specification it
could be either in library or in working directory. Any string
expression is allowed.
Note
If no file extension is specified for document name the default
extension is determined.
Example
WINWORD_LOAD_DOCUMENT lib:sample.doc
§
WINWORD_SAVE_DOCUMENT
Saves a Word document specified by the name. The document could be
located either in library or in working directory.
Syntax
WINWORD_SAVE_DOCUMENT ["document_name"]
Arguments

document_name
Optional name and path of the document. According to the path
specification it could be either in library or in working directory.
Any string expression is allowed.
Note
If no name is specified the document is saved by its current name. If
no file extension is specified for document name the default
extension is determined.
Example
WINWORD_SAVE_DOCUMENT lib:sample.doc
§
WINWORD_GET_BOOKMARK_TEXT
Searches in the current Word document for a bookmark and stores the
content to a parameter.
Syntax
WINWORD_GET_BOOKMARK_TEXT "bookmark" parameter<:out>
Arguments

bookmark
Specifies name of the bookmark which should be searched. Any string
expression is allowed.

parameter
Name of the new parameter which will receive the content of the
bookmark.
Error handling
The program execution will be canceled if the bookmark was not found,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
WINWORD_GET_BOOKMARK_TEXT "sample" paramSample
§
WINWORD_SET_BOOKMARK_TEXT
Searches in the current Word document for a bookmark and replaces the
content with the new text.
Syntax:
WINWORD_GET_BOOKMARK_TEXT "bookmark" "text"
Arguments

bookmark
Specifies name of the bookmark which should be searched. Any string
expression is allowed.

text
New text which should be assigned to the bookmark. Any string
expression is allowed.
Error handling
The program execution will be canceled if the bookmark was not found,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
WINWORD_SET_BOOKMARK_TEXT "sample" "this is the new text"
§
WINWORD_GET_BOOKMARKS
Retrieves an array of all bookmarks names from the current Word
document.
Syntax
WINWORD_GET_BOOKMARKS arrayBookmarks<:out>
Arguments

arrayBookmarks
Name of the array which receives the bookmark names.
Example
WINWORD_GET_BOOKMARKS bookmarks
FOR bookmark REF ARRAY bookmarks
WINWORD_GET_BOOKMARK_TEXT bookmark text_bookmark
PRINT "%" text_bookmark
END_FOR
§
WINWORD_REPLACE
Replaces text in the current Word document.
Syntax
WINWORD_REPLACE [options] "search text" "replace text"
Arguments

options
the following options are supported:
CASE_SENSITIVE valueBOOL — determines if the text search is case
sensitive. Default is FALSE.

WHOLE_WORD_MATCH valueBOOL — determines if the text search only


works on entire words and not on a part of a longer word. Default
is FALSE.

REPLACE_ALL valueBOOL — determines if the replacement should be


done for all occurrences. Default is FALSE.

search text
Text which is searched.

replace text
Text which should be used for replacement.
Example
WINWORD_REPLACE "<software company>" "B&W"
About Google API Commands
Using Google API commands requires to setup a project in Google by
the Google Cloud Console on the following link:
https://console.cloud.google.com. A build in project buw-
smartassembly-api is available which should be used only for testing
purpose.
The following commands are available for the general Google API
GOOGLEAPI_REGISTER_APPLICATION — to register another project than
the default buw-smartassembly-api.
GOOGLEAPI_UNREGISTER_APPLICATION — to unregister the current
project.
GOOGLEAPI_LOGIN — to log in by the Google OAuth2 mechanism.
GOOGLEAPI_LOGOUT — to log out the current user.
The information about the current user access token and the
application is stored in the registry at
HKEY_CURRENT_USER\Software\B&W Software GmbH\B&W
SmartAssembly\GoogleAPI\OAuth in encoded form. Therefor the login
information is not required to be re-entered on the program start. To
remove this information the user needs to be explicitly logged out or
the application has to be unregistered.
§
GOOGLEAPI_REGISTER_APPLICATION
Registers another project than the default buw-smartassembly-api.
This command requires to supply the client id and the client secret
from the project. This can be retrieved by selecting the project in
the Google Could Console https://console.cloud.google.com and opening
the OAuth 2.0 Client IDs from the credentials. The client secret
should not be exposed to others, therefor it is recommended to save
it in the Security Center as password.
Syntax
GOOGLEAPI_REGISTER_APPLICATION "client_id" "client_secret"
Arguments

client_id
Client id from the project as string expression.

client_secret
Client secret from the project as string expression.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
Registering the application is automatically logging out the current
user.
Example
GET_AUTHENTICATION "client_secret" dummy client_secret

DECLARE_VARIABLE STRING client_id


client_id = "600029634108-
om5hg70bp144qps1m7t90l7e7tdpv03a.apps.googleusercontent.com"

GOOGLEAPI_REGISTER_APPLICATION client_id client_secret


GOOGLEAPI_LOGIN
§
GOOGLEAPI_UNREGISTER_APPLICATION
Unregisters the current project and logs out the user.
Syntax
GOOGLEAPI_UNREGISTER_APPLICATION
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
Unregistering the application is automatically logging out the
current user.
Example
GOOGLEAPI_UNREGISTER_APPLICATION
§
GOOGLEAPI_LOGIN
Asks the user to provide the login credentials for the current
project by the Google OAuth2 login web page. The desired Google user
account must be selected in the page. In case the application is not
verified by Google, the user has to click Advanced" and "Go to
<project name> (unsafe) to select it. Afterwards OAuth2 asks for
granting the permissions for "Google Drive", "Google Docs" and
"Google Sheets". If this was applied or denied, the control goes back
to SmartAssembly.
In case the web page is not available or accidentally closed, the
process can be stopped by clicking on the Stop Google OAuth2 Login
button which opens in the background.
Syntax
GOOGLEAPI_LOGIN [options]
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
The login page will also show up when using other commands in case no
user is currently logged in.
Example
GET_AUTHENTICATION "client_secret" dummy client_secret

DECLARE_VARIABLE STRING client_id


client_id = "600029634108-
om5hg70bp144qps1m7t90l7e7tdpv03a.apps.googleusercontent.com"

GOOGLEAPI_REGISTER_APPLICATION client_id client_secret


GOOGLEAPI_LOGIN
§
GOOGLEAPI_LOGOUT
Logs out the current user.
Syntax
GOOGLEAPI_LOGOUT
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
GOOGLEAPI_LOGOUT
About Google Sheets Commands
Google Sheets commands include reading and writing access to Google
Sheets.
The following commands are available:
GOOGLESHEETS_NEW_DOCUMENT — to create a new Google Sheets document.
GOOGLESHEETS_GET_SHEET_NAME — to retrieve the name of a sheet of a
Google Sheets document.
GOOGLESHEETS_GET_SHEET_NAMES — to retrieve the names of all sheets
of a Google Sheets document.
GOOGLESHEETS_CREATE_SHEET — to create a new sheets in a Google
Sheets document.
GOOGLESHEETS_GET_VALUE — to retrieve the value of a cell in a
Google Sheets document.
GOOGLESHEETS_GET_STRING — to retrieve the text value of a cell in a
Google Sheets document.
GOOGLESHEETS_GET_VALUES — to retrieve the content of multiple cells
in a Google Sheets document.
GOOGLESHEETS_GET_STRINGS — to retrieve the text content of multiple
cells in a Google Sheets document.
GOOGLESHEETS_SET_VALUE — to set the value of a cell on a Google
Sheets document.
GOOGLESHEETS_SET_VALUES — to set the content of multiple cells on a
Google Sheets document.
GOOGLESHEETS_CLEAR_CONTENT — to clear the content of one cell,
multiple cells or all cells on a Google Sheets document.
GOOGLESHEETS_GET_ACTIVE_RANGE — to determine the active rand of a
sheet of a Google Sheets document.
GOOGLESHEETS_UPDATE_BUFFER — to synchronize the Google Sheets
read/write buffer.
GOOGLESHEETS_GET_VALUE_BUFFER — to read a value from the Google
Sheets buffer.
GOOGLESHEETS_GET_STRING_BUFFER — to read a text from the Google
Sheets buffer.
GOOGLESHEETS_SET_VALUE_BUFFER — to write a value to the Google
Sheets buffer.
GOOGLESHEETS_CLEAR_BUFFER — to clear data from the Google Sheets
buffer.
§
GOOGLESHEETS_NEW_DOCUMENT
Creates a new Google Sheets document in the current project.
Syntax
GOOGLESHEETS_NEW_DOCUMENT [options] "name"
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

name
Name of the document.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
In case a file of this name is already existing, the command does not
modify this file. This is also affecting files in the folder Trash.
Example
GOOGLESHEETS_NEW_DOCUMENT "test"
§
GOOGLESHEETS_GET_SHEET_NAME
Retrieves the name of the specified sheet of a Google Sheets
document.
Syntax
GOOGLESHEETS_GET_SHEET_NAME [options] "spreadsheet" indexINT
name<:out>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

index
Index to specify number of the sheet. The numbering starts with 0.

name
Name for the variable which receives the name of the sheet.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
GOOGLESHEETS_GET_SHEET_NAME "samplesheet" 2 name
PRINT "%" name
§
GOOGLESHEETS_GET_SHEET_NAMES
Retrieves the names of all sheets of a Google Sheets document.
Syntax
GOOGLESHEETS_GET_SHEET_NAMES [options] "spreadsheet" array<:out>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

array
Name of the array which will receive the sheet names.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
GOOGLESHEETS_GET_SHEET_NAMES "samplesheet" arraySheetNames
FOR sheetName REF ARRAY arraySheetNames
PRINT "%" sheetName
END_FOR
§
GOOGLESHEETS_CREATE_SHEET
Creates a new sheet in an existing Google Sheets document.
Syntax
GOOGLESHEETS_CREATE_SHEET [options] "spreadsheet" sheet
"new_sheet_name"
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0) or by the sheet name (for example "sheet1"). to distinguish these
cases, the following options are available:
SHEET_BY_NAME "predecessor_name"
Specifies the predecessor sheet by name. Any string expression
could be used for this. In case of an empty string or if the sheet
name could not be found, the new sheet is inserted at last.

SHEET_BY_INDEX sheet_numberINT
Specifies the sheet by index starting with 0 for the first
position. Any math expression could be used of this. In case of an
negative number of if the number exceeds the number of existing
sheets, the new sheet is inserted as last.
If no sheet option is specified SHEET_BY_INDEX is used as default.

new_sheet_name
Name of the sheet which should be created. Any string expression
could be used for this If an empty sheet name is specified, a default
name is used.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
In case the sheet is already existing, it will not be moved to the
specified position.
Example
GOOGLESHEETS_CREATE_SHEET "samplesheet" SHEET_BY_NAME "Sheet2"
"new_sheet_1"
GOOGLESHEETS_CREATE_SHEET "samplesheet" SHEET_BY_INDEX 2
"new_sheet_2"
§
GOOGLESHEETS_GET_VALUE
Retrieves the value of a cell of a Google Sheets document.
Syntax
GOOGLESHEETS_GET_VALUE [options] "spreadsheet" sheet cell value<:out>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

cell
The cell could be specified either by the cell index (starting with 0
for row and column) or the standard cell name (for example B12). To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, CELL_BY_INDEX is used as default.

value
Name for the variable which receives the value of the cell. The type
of the parameter is adjusted to the cell content and could be figured
out by GET_PARAM_TYPE.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
Use this function to retrieve a variable depending on the data type
in Google Sheets. To get the content as a string use
GOOGLESHEETS_GET_STRING.
Example
GOOGLESHEETS_GET_VALUE "samplesheet" SHEET_BY_INDEX 0 CELL_BY_NAME A1
value
PRINT "%" value
§
GOOGLESHEETS_GET_STRING
Retrieves the text content of a cell of a Google Sheets document.
Syntax
GOOGLESHEETS_GET_STRING [options] "spreadsheet" sheet cell text<:out>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

cell
The cell could be specified either by the cell index (starting with 0
for row and column) or the standard cell name (for example B12). To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, CELL_BY_INDEX is used as default.

text
Name for the variable which receives the text content of the cell.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
Use this function to retrieve a variable depending on the data type
in Google Sheets. To get variables depending on the data type in
Google Sheets, use GOOGLESHEETS_GET_VALUE.
Example
GOOGLESHEETS_GET_SHEET "samplesheet" SHEET_BY_INDEX 0 CELL_BY_NAME A1
text
PRINT "%" text
§
GOOGLESHEETS_GET_VALUES
Retrieves the content of multiple cells of a Google Sheets document
and stores in to an array. Each element of the array is a sub array
describing row, column and value.
Syntax
GOOGLESHEETS_GET_VALUES [options] "spreadsheet" sheet cellFrom cellTo
array<:out>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

cellFrom / celTo
The cell could be specified either by the cell index (starting with 0
for row and column) or the standard cell name (for example B12). To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, CELL_BY_INDEX is used as default.

array
Array which will receive the retrieved data in form of sub arrays.
Each sub array contains the data of a cell. First element is the row
index, second element is the column index and third element is the
cell data.
Row and column index start counting with 0 for the first element.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
Use this function to retrieve a variable depending on the data type
in Google Sheets. To get the content as a string use
GOOGLESHEETS_GET_STRINGS.
Example
GOOGLESHEETS_GET_VALUES "test" SHEET_BY_INDEX 0 CELL_BY_NAME A1
CELL_BY_NAME C3 arrayData

FOR data REF ARRAY arrayData


GET_ARRAY_ELEM data 0 row
GET_ARRAY_ELEM data 1 col
GET_ARRAY_ELEM data 2 value
PRINT "(%/%): %" row col value
END_FOR
§
GOOGLESHEETS_GET_STRINGS
Retrieves the text content of multiple cells of a Google Sheets
document and stores in to an array. Each element of the array is a
sub array describing row, column and value.
Syntax
GOOGLESHEETS_GET_STRINGS [options] "spreadsheet" sheet cellFrom
cellTo text<:out>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

cellFrom / cellTo
The cell could be specified either by the cell index (starting with 0
for row and column) or the standard cell name (for example B12). To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, CELL_BY_INDEX is used as default.

text
Name for the variable which receives the text content of the cell.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
Use this function to retrieve a variable depending on the data type
in Google Sheets. To get variables depending on the data type in
Google Sheets, use GOOGLESHEETS_GET_VALUES.
Example
GOOGLESHEETS_GET_STRINGS "test" SHEET_BY_INDEX 0 CELL_BY_NAME A1
CELL_BY_NAME C3 arrayData

FOR data REF ARRAY arrayData


GET_ARRAY_ELEM data 0 row
GET_ARRAY_ELEM data 1 col
GET_ARRAY_ELEM data 2 value
PRINT "(%/%): %" row col value
END_FOR
§
GOOGLESHEETS_SET_VALUE
Sets the value of a cell on a Google Sheets document.
Syntax
GOOGLESHEETS_SET_VALUE [options] "spreadsheet" sheet cell value<:in>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

cell
The cell could be specified either by the cell index (starting with 0
for row and column) or the standard cell name (for example B12). To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, CELL_BY_INDEX is used as default.

value
Variable which contains the value for the cell.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
For large number of values which should be transferred, the command
GOOGLESHEETS_SET_VALUE is quite slow. Therefor
GOOGLESHEETS_SET_VALUES was added.
Example
GOOGLESHEETS_SET_VALUE "samplesheet" SHEET_BY_NAME "Sheet1"
CELL_BY_NAME A1 "New Value"
GOOGLESHEETS_SET_VALUE "samplesheet" SHEET_BY_NAME "Sheet1"
CELL_BY_NAME B1 3.14
§
GOOGLESHEETS_SET_VALUES
Sets the content of multiple cells on a Google Sheets document by an
array. Each element of the array is a sub array describing row,
column and value.
Syntax
GOOGLESHEETS_SET_VALUES [options] "spreadsheet" sheet array<:in>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

array
Existing array in form of sub arrays. Each sub array contains the
data of a cell. First element is the row index, second element is the
column index and third element is the cell data.
Row and column index start counting with 0 for the first element.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
For large number of values which should be transferred, the command
GOOGLESHEETS_SET_VALUE is quite slow. Therefor
GOOGLESHEETS_SET_VALUES was added.
Example
GOOGLESHEETS_GET_VALUES "samplesheet" SHEET_BY_INDEX 0 CELL_BY_NAME
A1 CELL_BY_NAME C3 arrayData
GOOGLESHEETS_SET_VALUES "samplesheet" SHEET_BY_INDEX 1 arrayData
§
GOOGLESHEETS_CLEAR_CONTENT
Clears the content of one Google Sheets cell or of a range of cells
Syntax
GOOGLESHEETS_CLEAR_CONTENT [options] "spreadsheet" sheet [cellFrom
[cellTo]]
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

cellFrom / celTo
The cell could be specified either by the cell index (starting with 0
for row and column) or the standard cell name (for example B12). To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, CELL_BY_INDEX is used as default.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
The cellFrom and cellTo arguments are optional. In case non of them
is specified, the complete sheet content will be erased. In case only
cellFrom is specified, the content of this cell will be erased.
Example
GOOGLESHEETS_CLEAR_CONTENT "samplesheet" SHEET_BY_NAME "Sheet1"
CELL_BY_NAME B2 CELL_BY_NAME C3
§
GOOGLESHEETS_GET_ACTIVE_RANGE
Determines the active range of a sheet of a Google Sheets document.
This is the smallest block which contains all cells with a value in
the active sheet.
Syntax
GOOGLESHEETS_GET_ACTIVE_RANGE [options] "spreadsheet" sheet
row_from<:out> row_to<:out> col_from<:out> col_to<:out>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

row_from
Name of the variable which will receive the lower row index. Rows
starts counting with 0.

row_to
Name of the variable which will receive the upper row index. Rows
starts counting with 0.

col_from
Name of the variable which will receive the lower column index.
Columns starts counting with 0.

col_to
Name of the variable which will receive the upper column index.
Columns starts counting with 0.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
In case of an empty sheet all upper and lower indices are 0.
Example
GOOGLESHEETS_GET_ACTIVE_RANGE "samplesheet" SHEET_BY_NAME "Sheet1"
row_from row_to col_from col_to
PRINT "%/% - %/%" row_from col_from row_to col_to
§
GOOGLESHEETS_UPDATE_BUFFER
Synchronizes the Google Sheets read/write buffer with the specified
spreadsheet and sheet. This command is used to allow buffered
read/write access to Google Sheets data with higher performance.
Syntax
GOOGLESHEETS_UPDATE_BUFFER [options] "spreadsheet" sheet direction
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

direction
Direction of the synchronization:
GOOGLESHEET_TO_BUFFER
Reads the specified sheet information to the buffer.
BUFFER_TO_GOOGLESHEET
Writes the buffer to the specified sheet.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
The buffer content will be available in the complete Creo session
unless it is removed by GOOGLESHEETS_CLEAR_BUFFER.
Example
GOOGLESHEETS_UPDATE_BUFFER "samplesheet" SHEET_BY_INDEX 0
GOOGLESHEET_TO_BUFFER
GOOGLESHEETS_GET_ACTIVE_RANGE "samplesheet" SHEET_BY_INDEX 0 row_from
row_to col_from col_to

DECLARE_VARIABLE INTEGER row row_from


DECLARE_VARIABLE INTEGER col col_from

WHILE row <= row_to

WHILE col <= col_to

GOOGLESHEETS_GET_VALUE_BUFFER "samplesheet" SHEET_BY_INDEX 0


CELL_BY_INDEX row col data
data *= 2
GOOGLESHEETS_SET_VALUE_BUFFER "samplesheet" SHEET_BY_INDEX 0
CELL_BY_INDEX row col data
col++
END_WHILE

col = col_from
row++

END_WHILE

GOOGLESHEETS_UPDATE_BUFFER "samplesheet" SHEET_BY_INDEX 0


BUFFER_TO_GOOGLESHEET
GOOGLESHEETS_CLEAR_BUFFER "samplesheet" SHEET_BY_INDEX 0
§
GOOGLESHEETS_GET_VALUE_BUFFER
Retrieves a value from the Google Sheets read/write buffer. This
command allows to read data from Google Sheets with high performance.
Syntax
GOOGLESHEETS_GET_VALUE_BUFFER [options] "spreadsheet" sheet cell
value<:out>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

cell
The cell could be specified either by the cell index (starting with 0
for row and column) or the standard cell name (for example B12). To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, CELL_BY_INDEX is used as default.

value
Name for the variable which receives the value of the cell. The type
of the parameter is adjusted to the cell content and could be figured
out by GET_PARAM_TYPE.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
GOOGLESHEETS_UPDATE_BUFFER "samplesheet" SHEET_BY_INDEX 0
GOOGLESHEET_TO_BUFFER
GOOGLESHEETS_GET_ACTIVE_RANGE "samplesheet" SHEET_BY_INDEX 0 row_from
row_to col_from col_to

DECLARE_VARIABLE INTEGER row row_from


DECLARE_VARIABLE INTEGER col col_from

WHILE row <= row_to

WHILE col <= col_to

GOOGLESHEETS_GET_VALUE_BUFFER "samplesheet" SHEET_BY_INDEX 0


CELL_BY_INDEX row col data
data *= 2
GOOGLESHEETS_SET_VALUE_BUFFER "samplesheet" SHEET_BY_INDEX 0
CELL_BY_INDEX row col data
col++
END_WHILE

col = col_from
row++

END_WHILE

GOOGLESHEETS_UPDATE_BUFFER "samplesheet" SHEET_BY_INDEX 0


BUFFER_TO_GOOGLESHEET
GOOGLESHEETS_CLEAR_BUFFER "samplesheet" SHEET_BY_INDEX 0
§
GOOGLESHEETS_GET_STRING_BUFFER
Retrieves a text from the Google Sheets read/write buffer. This
command allows to read data from Google Sheets with high performance.
Syntax
GOOGLESHEETS_GET_STRING_BUFFER [options] "spreadsheet" sheet cell
text<:out>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

cell
The cell could be specified either by the cell index (starting with 0
for row and column) or the standard cell name (for example B12). To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, CELL_BY_INDEX is used as default.

text
Name for the variable which receives the text content of the cell.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
GOOGLESHEETS_UPDATE_BUFFER "samplesheet" SHEET_BY_INDEX 0
GOOGLESHEET_TO_BUFFER
GOOGLESHEETS_GET_ACTIVE_RANGE "samplesheet" SHEET_BY_INDEX 0 row_from
row_to col_from col_to

DECLARE_VARIABLE INTEGER row row_from


DECLARE_VARIABLE INTEGER col col_from

WHILE row <= row_to

WHILE col <= col_to

GOOGLESHEETS_GET_STRING_BUFFER "samplesheet" SHEET_BY_INDEX 0


CELL_BY_INDEX row col str_data

DECLARE_VARIABLE DOUBLE data


data = stof(str_data)

data *= 2
GOOGLESHEETS_SET_VALUE_BUFFER "samplesheet" SHEET_BY_INDEX 0
CELL_BY_INDEX row col data
col++
END_WHILE

col = col_from
row++

END_WHILE

GOOGLESHEETS_UPDATE_BUFFER "samplesheet" SHEET_BY_INDEX 0


BUFFER_TO_GOOGLESHEET
GOOGLESHEETS_CLEAR_BUFFER "samplesheet" SHEET_BY_INDEX 0
§
GOOGLESHEETS_SET_VALUE_BUFFER
Writes a value to the Google Sheets read/write buffer. This command
allows to write data to Google Sheets with high performance.
Syntax
GOOGLESHEETS_SET_VALUE_BUFFER [options] "spreadsheet" sheet cell
value<:in>
Arguments

options
The following options are available:
VERBOSE — logs debug information to the trail file.

spreadsheet
Name of the spreadsheet.

sheet
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.

cell
The cell could be specified either by the cell index (starting with 0
for row and column) or the standard cell name (for example B12). To
distinguish these cases, two options are available:
CELL_BY_NAME "name"
Specifies the cell by name. Any string expression could be used for
this.

CELL_BY_INDEX row INT column INT


Specifies the cell by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, CELL_BY_INDEX is used as default.

value
Name or the variable which contains the cell data.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
GOOGLESHEETS_UPDATE_BUFFER "samplesheet" SHEET_BY_INDEX 0
GOOGLESHEET_TO_BUFFER
GOOGLESHEETS_GET_ACTIVE_RANGE "samplesheet" SHEET_BY_INDEX 0 row_from
row_to col_from col_to

DECLARE_VARIABLE INTEGER row row_from


DECLARE_VARIABLE INTEGER col col_from

WHILE row <= row_to

WHILE col <= col_to

GOOGLESHEETS_GET_VALUE_BUFFER "samplesheet" SHEET_BY_INDEX 0


CELL_BY_INDEX row col data
data *= 2
GOOGLESHEETS_SET_VALUE_BUFFER "samplesheet" SHEET_BY_INDEX 0
CELL_BY_INDEX row col data
col++
END_WHILE

col = col_from
row++

END_WHILE

GOOGLESHEETS_UPDATE_BUFFER "samplesheet" SHEET_BY_INDEX 0


BUFFER_TO_GOOGLESHEET
GOOGLESHEETS_CLEAR_BUFFER "samplesheet" SHEET_BY_INDEX 0
§
GOOGLESHEETS_CLEAR_BUFFER
Retrieves a value from the Google Sheets read/write buffer. This
command allows to read data from Google Sheets with high performance.
Syntax
GOOGLESHEETS_CLEAR_BUFFER ["spreadsheet" [sheet]]
Arguments

spreadsheet (optional)
Name of the spreadsheet.

sheet (optional)
The sheet could be specified either by the sheet index (starting with
0 the first sheet) or the sheet name (for example Sheet1). To
distinguish these cases, two options are available:
SHEET_BY_NAME "name"
Specifies the sheet by name Any string expression could be used for
this.

SHEET_BY_INDEX index INT


Specifies the sheet by index starting with 0. Any math expression
could be used of this.
In case no option is supplied, SHEET_BY_INDEX is used as default.
Error handling
The program execution will be canceled if the command fails, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
Use this function to retrieve a variable depending on the data type
in Google Sheets. To get variables depending on the data type in
Google Sheets, use GOOGLESHEETS_GET_VALUE.
Example
GOOGLESHEETS_UPDATE_BUFFER "samplesheet" SHEET_BY_INDEX 0
GOOGLESHEET_TO_BUFFER
GOOGLESHEETS_GET_ACTIVE_RANGE "samplesheet" SHEET_BY_INDEX 0 row_from
row_to col_from col_to

DECLARE_VARIABLE INTEGER row row_from


DECLARE_VARIABLE INTEGER col col_from

WHILE row <= row_to

WHILE col <= col_to

GOOGLESHEETS_GET_VALUE_BUFFER "samplesheet" SHEET_BY_INDEX 0


CELL_BY_INDEX row col data
data *= 2
GOOGLESHEETS_SET_VALUE_BUFFER "samplesheet" SHEET_BY_INDEX 0
CELL_BY_INDEX row col data
col++
END_WHILE

col = col_from
row++

END_WHILE

GOOGLESHEETS_UPDATE_BUFFER "samplesheet" SHEET_BY_INDEX 0


BUFFER_TO_GOOGLESHEET
GOOGLESHEETS_CLEAR_BUFFER "samplesheet" SHEET_BY_INDEX 0
§
About Import / Export Commands
Commands for importing features and models and exporting models to
foreign data formats. The following commands are available:
IMPORT_FEATURE — to import foreign geometry to feature in a model.
IMPORT_MDL — to import foreign geometry as a model.
EXPORT_FILE — to export a model in a foreign data format.
EXPORT_FEMMESH — to export a finite element mesh. This command
requires Mechanica.
PLOT — to plot a drawing.
EXPORT_PDF — to export PDFs from parts, assemblies and drawings.
§
IMPORT_FEATURE
Imports geometry as a Creo Elements/Pro feature like Insert > Shared
Data > From File.
Syntax
IMPORT_FEATURE referenceMdl<:in> 'type' "filename" [options]
[ref_feature<:out>]
Arguments

referenceMdl
A reference to the model which should incorporate the feature. Models
could be specified in the following manner.

type
Type of the file which should be imported. Currently supported types
are IGES, STEP, DXF, PARASOLID, SAT and STL.

filename
Specifies the file which should be imported. According to the path
specification it could be either in library or in working directory.
Any string expression is allowed.

options
The following options are supported:
CSYS refCsys<:in>
A reference to a coordinate system is specifies for the imported
feature. In case this is not specified, the default coordinate
system is used.
IMPORT_PROFILE "dip_file"
For Pro/ENGINEER Wildfire 5 / Creo Elements/Pro and above this
options can be used to set the import profile. In case the import
profile is not set the Pro/ENGINEER configuration option
intf_in_profile_default is used.

ref_feature
Optional name for the reference of the created imported feature.
Error handling
The program execution will be canceled if model was not found or the
import fails, unless errors are handled by BEGIN_CATCH_ERROR.
Note
If no file extension is specified for file name '.igs' is assumed for
IGES files.
Example
USER_SELECT CSYS placementCsys
USER_SELECT PART mdlTarget
IMPORT_FEATURE placementCsys IGES lib:sample.igs CSYS placementCsys
§
IMPORT_MDL
Imports geometry as a Creo Elements/Pro model like File > Open
Syntax
IMPORT_MDL data_type mdl_type "filename" "mdl name" [options]
Arguments

data_type
Type of the file which should be imported. Currently supported are
IGES, STEP, DXF (for parts, assemblies and drawings), PARASOLID, SAT
, NX, INVENTOR, SOLIDWORKS, SOLIDEDGE, CATIA_V5, JT (for parts and
assemblies), for STL (for part), ECAD for (assemblies) and DWG, (for
drawings).

mdl_type
Type of the model which should be created. The model types ASSEMBLY,
PART and DRAWING are supported.

filename
Specifies the file which should be imported. According to the path
specification it could be either in library or in working directory.
Any string expression is allowed.

mdl name
Specifies the name of the model which should be created in Creo
Elements/Pro. Any string expression is allowed.

options
The following options are supported:
IMPORT_PROFILE "dip_file"
For Pro/ENGINEER Wildfire 5 / Creo Elements/Pro and above this
options can be used to set the import profile. In case the import
profile is not set the Pro/ENGINEER configuration option
intf_in_profile_default is used.

IMPORT_FLEX_DESIGN value BOOL


This option is only affecting the ECAD import. It sets the import
options to flexible or rigid PCB design. The default is FALSE for
rigid PCB design.
Note
If no file extension is specified for file name '.igs' is assumed
for IGES files and '.dxf' for DXF files.
For JT, the Creo license option 263 - INTF_for_JT is required,
otherwise the function will fail.
For ECAD the Creo license option 262 - ECAD_COLLABORATION is
required, otherwise the function will fail. The ECAD import
requires Creo 4.0 M030 or above.
Error handling
The program execution will be canceled if the model could not be
found or the import fails, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
IMPORT_MDL IGES PART lib:sample.igs sample
DECLARE_VARIABLE STRING partname
partname = sample + ".prt"
RETRIEVE_MDL partname refPart
§
EXPORT_FILE
Exports Creo Elements/Pro model like File > Save a Copy
Syntax:
EXPORT_FILE referenceMdl<:in> 'type' "filename" [options]
Arguments

referenceMdl
A reference to the model which be exported. Models could be specified
in the following manner.

type
Type of the file which should be exported. Currently supported type
is IGES, STEP, DXF, PRODVIEW (for parts, assemblies and drawings),
STL , JPEG, TIFF, BMP, SHRINKWRAP, CATIA, SAT, PARASOLID,
CATIA_V5_PART, CATIA_V5_ASSEMBLY, JT, VRML, SOLIDWORKS, NX, WAVEFRONT
(for parts and assemblies) and DWG for drawings.

filename
Name and path for the file which should be exported. See path
specifications for details.

options
The following options are supported:
For STL, IGES, STEP, DXF, SAT, PARASOLID, CATIA, CATIA_V5_PART,
CATIA_V5_ASSEMBLY, SOLIDWORKS, NX and JT on parts and assemblies:
CSYS refCsys<:in>
A reference to a coordinate system is for the exported model. In
case this is not specified, the default coordinate system is
used.

EXPORT_WITH_PROFILE value BOOL


Specifies if the export profile from Creo should be used. In this
case all other options are ignored.
for STL on parts and assemblies:
FORMAT BINARY | ASCII
If not specified BINARY is used as standard.

CHORD_HEIGHT value DOUBLE


Specifies the quality by the chord height. If not specified 0.1
is used as standard. Use a number smaller than zero to get the
minimal chord height (e.g. -1).

ANGLE_CONTROL value DOUBLE


Specifies the quality by the angle control. If not specified 0.1
is used as standard.
for IGES, STEP, CATIA, CATIA_V5_PART, CATIA_V5_ASSEMBLY ,
SOLIDWORKS, NX on parts and assemblies:
Note: note all combinations of the following options are supported.
Therefor contradictory settings are automatically resolved to valid
ones. Thereby configured types have priority over default settings.
EXPORT_AS_WIREFRAME TRUE | FALSE
Specifies if export should be include wireframe information. If
not specified FALSE is used as standard.
EXPORT_AS_SURFACES TRUE | FALSE
Specifies if export should be include surface information. If not
specified TRUE is used as standard.
EXPORT_AS_SOLID TRUE | FALSE
Specifies if export should be include solid information. If not
specified FALSE is used as standard.
EXPORT_AS_QUILTS TRUE | FALSE
Specifies if export should be include quilt information. If not
specified FALSE is used as standard.
for IGES, STEP, DXF, CATIA, CATIA_V5_PART, CATIA_V5_ASSEMBLY ,
SOLIDWORKS, NX on parts and assemblies:
INCLUDE_DATUMS TRUE | FALSE
Includes datum curves and points. If not specified FALSE is used
as standard.
INCLUDE_BLANKED_LAYERS TRUE | FALSE
Includes blanked entities. If not specified FALSE is used as
standard.
INCLUDE_FACETS TRUE | FALSE
Includes facets. If not specified FALSE is used as standard.
for WAVEFRONT on parts and assemblies:

CHORD_HEIGHT value DOUBLE


Specifies the quality by the chord height. If not specified the
Creo default will be used.
ANGLE_CONTROL value DOUBLE
Specifies the quality by the angle control. If not specified the
Creo default will be used.

STEP_SIZE value DOUBLE


Specifies the quality by the step size. If not specified the Creo
default will be used.
for DXF on parts and assemblies:
INCLUDE_QUILTS TRUE | FALSE
Includes quilts. If not specified FALSE is used as standard.
for JPEG, TIFF and BMP on parts and assemblies:

HEIGHT value DOUBLE


Specifies the height of the output image. 10 is used as default.

WIDTH value DOUBLE


Specifies the width of the output image: 10 is used as default.
UNIT MM | INCH
Specifies the unit of the output image. MM is used as default.

DPI value INT


Specifies the dots per inch of the output image. 100 is used as
default. Valid values are 100, 200, 300, 400, 500 and 600.
IMAGE_DEPTH 8BIT|24BIT
Specifies the image depth of the output image. 8BIT is used as
default.
for PRODVIEW on parts, assemblies and drawings:
PRODVIEW_FORMAT ED | EDZ | PVS | PVZ
Output Format for the product view file. Default is ED. Before
Pro/ENGINEER Wildfire 5 only ED is supported.
for SHRINKWRAP on parts and assemblies:
In case the filename includes the extension ".prt" or ".asm" this
will be used to determine the model type of the shrinkwrap model.
Otherwise the type of the reference model is used.
SHRINKWRAP_METHOD SURF_SUBSET | FACETED_SOLID | MERGED_SOLID
Specifies the method how the shrinkwrap is created. If not
specified SURF_SUBSET is used as default.

SHRINKWRAP_QUALITY value INTEGER


Specifies the quality of the shrinkwrap between 1 and 10. If not
specified 1 is used as default.
SHRINKWRAP_FILL_HOLES TRUE | FALSE
Specifies if the holes in the shrinkwrap are filled
automatically. If not specified TRUE is used as default.
SHRINKWRAP_IGNORE_SKELETONS TRUE | FALSE
Specifies if skeletons should be ignored. If not specified TRUE
is used as default.
SHRINKWRAP_IGNORE_QUILTS TRUE | FALSE
Specifies if quilts should be ignored. If not specified TRUE is
used as default.
SHRINKWRAP_IGNORE_SMALL_SURFACES TRUE | FALSE
Specifies if small surfaces should be ignored. If not specified
FALSE is used as default.
SHRINKWRAP_IGNORE_SMALL_SURFACES_THRESHOLD TRUE | FALSE
Specifies the percentage of the model size which surfaces are
considered as small. If not specified 0 is used as default.
SHRINKWRAP_ASSIGN_MASS_PROPERTIES TRUE | FALSE
Specifies if material properties should be assigned. If not
specified FALSE is used as default.
SHRINKWRAP_ADD_COMPONENTS arrayComponents
Specifies additional components which should be added. This
option is only used for the method MERGED_SOLID.
SHRINKWRAP_ADD_DATUMS arrayDatums
Specifies datums which should be added to the shrink wrap.
SHRINKWRAP_ADD_SURFACES arraySurfaces.
Specifies surfaces which should be added to the shrink wrap. This
option is only used for the method SURF_SUBSET.
TEMPLATE "model_name"
Name of path of the model which should be use as template.
For DXF and DWG on drawings:
EXPORT_SHEETS CURRENT_MODEL_SPACE | CURRENT_PAPER_SPACE | ALL |
SELECTED
Determines which drawing sheets should be exported.

MODEL_SPACE_SHEET valueINT
Determines which sheet should be exports as model space sheet.
This option is only used in case EXPORT_SHEETS is set to
SELECTED. The sheets start numbering with 1.
PAPER_SPACE_SHEETS arraySheetNumbers
Determines which sheets should be exports as paper space sheets.
This option is only used in case EXPORT_SHEETS is set to
SELECTED. The sheets start numbering with 1.
Error handling
The program execution will be canceled if the model could not be
found or the export fails, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
Type DXF for parts and assemblies works only for Creo Parametric
1.0 and above.
It is not possible to export TIFF files from drawing. For this
purpose, use the PLOT command with a pcf file which drives the TIFF
printer type.
For JT, the Creo license option 263 - INTF_for_JT is required,
otherwise the function will fail.
Example
! minimal number of arguments without any options
EXPORT_FILE mdl STL output
! all possible arguments
EXPORT_FILE mdl STL output CSYS coord FORMAT ASCII CHORD_HEIGHT 0.5
ANGLE_CONTROL 0.5 EXPORT_AS_WIREFRAME FALSE EXPORT_AS_SURFACES FALSE
EXPORT_AS_SOLID TRUE EXPORT_AS_QUILTS FALSE
§
EXPORT_FEMMESH
Exports a finite element mesh. This command requires a material with
density to be assigned on the model. Additionally since Wildfire 4
you need to make sure Creo Elements/Pro MECHANICA is installed. The
Creo Elements/Pro Pro/MESH licenses is required for this command.
Syntax:
EXPORT_FEMMESH mdl<:in> mesh_options<:in> "filename"
Arguments

mdl
Model for which the mesh should be created. Models could be specified
in the following manner.

mesh_options
Structure variable of type FEMMESH_OPTION to configure the type of
the mesh.

filename
Name and path for the file which should be exported. See path
specifications for details.
Error handling
The program execution will be canceled if the model could not be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_STRUCT FEMMESH_OPTION option
option.solver = FEAS_ANSYS
EXPORT_FEMMESH PART option "output"
§
PLOT
Plots a drawing on the printer according to a printer PCF file.
Syntax
PLOT referenceMdl<:in> "pcf_file" [options]
Arguments

referenceMdl
A reference to the model which should incorporate the feature. Models
could be specified in the following manner.

pcf_file
Specifies the pcf file for the printer definition. See path
specification for information how the PCF file can reside in the
library.

options
The following options are supported:
OUTPUT "filename"
File name and optional path for the output file. plot_destination
file must be configured in the PCF file to have any effect.

ADJUST_PAPER_SIZE adjustBOOL
Adjusts the paper size to the current drawing and overwrites the
paper_size setting of the cfg file. The default for this option is
false.
COMMIT
Automatically pushes the OK button. Use only for MS Printer
manager.
.
Error handling
The program execution will be canceled if referenceMdl was not found,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
PLOT THIS "lib:\printer\my_ps_plotter.pcf" OUTPUT out.ps
PLOT THIS "ms_print_mgr.pcf" COMMIT
§
EXPORT_PDF
Exports PDFs from parts, assemblies and drawings. This command is
available for Wildfire 4 and above.
Syntax
EXPORT_PDF model<:in> pdf_options "file_name"
Arguments

model
The specified model.

pdf_options
Existing structure variable of type PDF_OPTION.

file name
Name and path for the PDF file. See path specification for details.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_STRUCT PDF_OPTION option
GET_SESSION_MDLS mdls

FOR mdl REF ARRAY mdls


GET_MDL_NAME mdl name
EXPORT_PDF mdl option name + ".pdf"

BEGIN_CATCH_ERROR
SEARCH_MDL_REF mdl DRAWING "*" refDrw
END_CATCH_ERROR

IF REF_VALID refDrw
EXPORT_PDF refDrw option name + "_drw.pdf"
END_IF
END_FOR
About OS Commands
Commands for retrieving information from the operation system.
The following commands are available:
PARSE_STRING — to read formatted data from a string.
PARSE_STRING_EX — to read formatted data from a string and
provide the results in an array.
SPLIT_STRING — to split a multi line string with line break
characters '\n' to an array of single lines.
GET_TIME_STRING — to retrieve time and date as string from the
operation system.
GET_ENVIRONMENT_VARIABLE — to retrieve the content of
environment variables.
CREATE_UNIQUE_STRING — to create a globally unique string from
the operating system.
GENERATE_RANDOM_INT — to generate a random integer values
between specified boundaries.
DECLARE_STOPWATCH — to declare a stopwatch variable for
measuring elapsed time.
START_STOPWATCH — to start a stopwatch.
STOP_STOPWATCH — to stop a stopwatch.
RESET_STOPWATCH — to reset a stopwatch.
GET_STOPWATCH_TIME — to get the elapsed time of the stopwatch.
PARSE_STRING
Reads formatted data from a string. The format control string
determines which part of the input string is stored in the different
variables. Spaces and tabulators are ignored in the input and in the
format string. The command does not only allow to retrieve variables,
it can also be used to control that the string follows specific
rules.
Syntax
PARSE_STRING "input" "format" paramNumResultArguments<:out>
[paramResult1<:out>] [paramResult2<:out>]...
Arguments

input
Input string which should be parsed. Any string expression is
allowed.

format
Format control string, any string expression is allowed.
%i — reads an integer from the input string and stores the value in
the next output parameter.
%d — reads a double from the input string and stores the value in
the next output parameter.
%s — reads in a string from the input string and stores the value
in the next output parameter.
%% — reads a character from the input string. In case this
character is not a percentage sign, the command fails.
Any other character — reads a character from the input string and
compares it to this character. In case the characters are
different, the command fails.

paramNumResultArguments
Name of the integer parameter which receive the number of
successfully parsed result elements.

Output parameters
Names of the output parameters.
Error handling
The program execution will be canceled if the parse procedure fails,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case to many output parameter are provided to this command, they
are filled with standard values. In case to less parameters are
provided the command will succeed anyway, but you can't access the
values.
Example
! successful
! retrieves name1 = "B&W", name2 = "Software", year = "2011"
PARSE_STRING "B&W Software 2011" "%s%s%i" nArgs name1 name2 year

! successful since 'Software' is identical in input string and format


string
! retrieves name = "B&W", year = "2011"
PARSE_STRING "B&W Software 2011" "%s%Software%i" nArgs name year

! fails since 'Software' in the input string does not match 'XXX' in
the format string
PARSE_STRING "B&W Software 2011" "%sXXX%i" nArgs name year
§
PARSE_STRING_EX
Reads formatted data from a string and stores the result in an array.
The format control string determines which part of the input string
is stored in the different variables. Spaces and tabulators are
ignored in the input and in the format string. The command does not
only allow to retrieve variables, it can also be used to control that
the string follows specific rules.
Syntax
PARSE_STRING_EX "input" "format" arrayResults<:out>..
Arguments

input
Input string which should be parsed. Any string expression is
allowed.

format
Format control string, any string expression is allowed.
%i — reads an integer from the input string and stores the value in
the next output parameter.
%d — reads a double from the input string and stores the value in
the next output parameter.
%s — reads in a string from the input string and stores the value
in the next output parameter.
%% — reads a character from the input string. In case this
character is not a percentage sign, the command fails.
Any other character — reads a character from the input string and
compares it to this character. In case the characters are
different, the command fails.

arrayResults
Name of the array which will receive the parsed results.
Error handling
The program execution will be canceled if the parse procedure fails,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
This command is an enhancement of PARSE_STRING to handle the output
arguments in a more user friendly way.
Example
! successful
! retrieves name1 = "B&W", name2 = "Software", year = "2011"
PARSE_STRING "B&W Software 2011" "%s%s%i" arrayResult1

! successful since 'Software' is identical in input string and format


string
! retrieves name = "B&W", year = "2011"
PARSE_STRING "B&W Software 2011" "%s%Software%i" arrayResult2

! fails since 'Software' in the input string does not match 'XXX' in
the format string
PARSE_STRING "B&W Software 2011" "%sXXX%i" arrayResult3
SPLIT_STRING
Splits a multi line string with line break characters '\n' to an
array of single lines
Syntax
SPLIT_STRING "input" arrayLines<:out> [options]
Arguments

input
Input string which should be split to single lines. Any string
expression is allowed.

arrayLines
Name of the array variable which receive the single lines.

options
The following options are supported.
SPLIT_CHAR "char" — to use another split character than '\n'.
Example
DECLARE_VARIABLE STRING str
str = "line1\nline2\nline3"
SPLIT_STRING str lines
FOR line REF ARRAY lines
PRINT "%" line
END_FOR
GET_TIME_STRING
Retrieves time and date as a string from the operation system.
Syntax
GET_TIME_STRING "format" param_time<:out>
Arguments

format
Format control string, any string expression is allowed. Characters
with a leading percentage sign '%' are used for controlling the
output format. The following options produce the output for Friday
15, February 2008 at 04:05:43 pm.
%a — Abbreviated weekday name. For example: Fri
%A — Full weekday name. For example: Friday
%b — Abbreviated month name. For example: Feb
%B — Full month name. For example: February
%c — Date and time representation of the OS. For example:
02/15/2008 04:05:43 PM
%d — Day of month as decimal number (01 – 31). For example: 15
%H — Hour in 24-hour format (00 – 23). For example: 16
%I — Hour in 12-hour format (01 – 12). For example: 04
%j — Day of year as decimal number (001 – 366). For example: 046
%m — Month as decimal number (01 – 12). For example: 02
%M — Minute as decimal number (00 – 59). For example: 05
%p — Current OS settings A.M./P.M. indicator for 12-hour clock. For
example: PM
%S — Second as decimal number (00 – 59). For example: 43
%U — Week of year as decimal number, with Sunday as first day of
week (00 – 53). For example: 06
%w — Weekday as decimal number (0 – 6; Sunday is 0). For example: 5
%W — Week of year as decimal number, with Monday as first day of
week (00 – 53). For example: 06
%x — Date representation of the OS. For example: 02/15/2008
%X — Time representation of the OS. For example: 04:05:23 PM
%y — Year without century, as decimal number (00 – 99). For
example: 08
%Y — Year with century, as decimal number. For example: 2008
%z — Abbreviated time zone name. For example: W. Europe Standard
Time
%Z — Time zone name. For example: W. Europe Standard Time
%% — Percentage sign. For example: %

parameter
Name of the parameter which should receive the time or date
information.
Note
The most often used formats are:
%c — for date and time.
%x — for date.
%X — for time.
Example
GET_TIME_STRING "%c" time
PRINT "Date and time: %" time
GET_ENVIRONMENT_VARIABLE
Retrieves the content of an environment variable.
Syntax
GET_ENVIRONMENT_VARIABLE "varname" param_content<:out>
Arguments

varname
Name of the environment variable. Any string expression is allowed.

param_content
Name of the parameter which should receive the content of the
environment variable.
Error Handling
The program execution will be canceled if the environment variable
does not exist, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_ENVIRONMENT_VARIABLE "USERNAME" name
PRINT "USERNAME: %" name
CREATE_UNIQUE_STRING
Creates a globally unique string with 32 characters from the
operating system.
Syntax
CREATE_UNIQUE_STRING param_unique<:out>
Arguments

param_unique
Name of the string parameter which should receive the unique
identifier.
Example
CREATE_UNIQUE_STRING unique_string
PRINT "It's much more likely to win a thousand times the lottery in a
row than creating this string again: %" unique_string
§
GENERATE_RANDOM_INT
Generates a random integer between an upper and a lower limit based
on the Mersenne Twister algorithm.
Syntax
GENERATE_RANDOM_INT lower_limit<:in> upper_limit<:in> number<:out>
Arguments

lower_limit
Lower limit for the number generator. Any math expression is allowed.

upper_limit
Upper limit for the number generator. Any math expression is allowed.

number
Name of the variable which receives the integer output.
Example
! Generate 100 random numbers between 0 and 100
DECLARE_VARIABLE INTEGER n
n = 0
WHILE n < 100
GENERATE_RANDOM_INT 0 1000 number
PRINT "%" number
n++
END_WHILE
§
DECLARE_STOPWATCH
Declares a stopwatch variable for measuring elapsed time.
Syntax
DECLARE_STOPWATCH watch<:out>
Arguments

watch
Name of the new stopwatch which will be created.
Example
DECLARE_STOPWATCH watch
§
START_STOPWATCH
Starts a stopwatch.
Syntax
START_STOPWATCH watch<:in>
Arguments

watch
Name of an existing stopwatch.
Example
DECLARE_STOPWATCH watch
START_STOPWATCH watch
§
STOP_STOPWATCH
Stops a stopwatch.
Syntax
STOP_STOPWATCH watch<:in>
Arguments

watch
Name of an existing stopwatch.
Example
DECLARE_STOPWATCH watch
START_STOPWATCH watch
WAIT
STOP_STOPWATCH watch
§
RESET_STOPWATCH
Resets a stopwatch to zero.
Syntax
RESET_STOPWATCH watch<:in>
Arguments

watch
Name of an existing stopwatch.
Example
DECLARE_STOPWATCH watch
START_STOPWATCH watch
WAIT
RESET_STOPWATCH watch
§
GET_STOPWATCH_TIME
Gets the current time of the stopwatch.
Syntax
GET_STOPWATCH_TIME watch<:in> time<:out>
Arguments

watch
Name of an existing stopwatch.

time
Name of the output variable which receives the elapsed time as string
value.
Example
DECLARE_STOPWATCH watch
START_STOPWATCH watch
WAIT
STOP_STOPWATCH watch
GET_STOPWATCH_TIME watch time
PRINT "elapsed time: %" time
§
About Commands for Regular Expressions
Regular expressions are a formal language offering a very powerful
way for pattern matching techniques which includes parsing and
identifying sub strings. The pattern syntax follows the ECMAScript
(JavaScript) version.
Overview

Position matching
Symbol Function

Only match the beginning of a string.


^
"^A" matches first "A" in "An A+ for Anita."
Only match the ending of a string.
$
"t$" matches the last "t" in "A cat in the hat"
Matches any word boundary
\b
"ly\b" matches "ly" in "possibly tomorrow."
\B Matches any non-word boundary

Literals
Symbol Function

Matches alphabetical and numerical characters


Alphanumeric
literally.
\n Matches a new line
\f Matches a form feed
\r Matches carriage return
\t Matches horizontal tab
\v Matches vertical tab
\? Matches ?
\* Matches *
\+ Matches +
\. Matches .
\| Matches |
\{ Matches {
\} Matches }
\\ Matches \
\[ Matches [
\] Matches ]
\( Matches (
\) Matches )
Matches the ASCII character expressed by the octal
\xxx number xxx.
"\50" matches "(" or chr (40).
Matches the ASCII character expressed by the hex
\xdd number dd.
"\x28" matches "(" or chr (40).
Matches the ASCII character expressed by the UNICODE
\uxxxx xxxx.
"\u00A3" matches "£".

Characters classes
Symbol Function

Match any one character enclosed in the character set.


[xyz]
"[a-e]" matches "b" in "basketball".
Match any one character not enclosed in the character set.
[^xyz]
"[^a-e]" matches "s" in "basketball".
. Match any character except \n.
\w Match any word character. Equivalent to [a-zA-Z_0-9].
\W Match any non-word character. Equivalent to [^a-zA-Z_0-9].
\d Match any digit. Equivalent to [0-9].
\D Match any non-digit. Equivalent to [^0-9].
\s Match any space character. Equivalent to [ \t\r\n\v\f].
\S Match any non-space character. Equivalent to [^ \t\r\n\v\f].

Repetition
Symbol Function

Match exactly x occurrences of a regular expression.


{x}
"\d{5}" matches 5 digits.
Match x or more occurrences of a regular expression.
{x,}
"\s{2,}" matches at least 2 space characters.
Matches x to y number of occurrences of a regular
{x,y} expression.
"\d{2,3}" matches at least 2 but no more than 3 digits.
Match zero or one occurrences. Equivalent to {0,1}.
? "a\s?b" matches "ab" or "a b".

* Match zero or more occurrences. Equivalent to {0,}.


+ Match one or more occurrences. Equivalent to {1,}.

Alternation & Grouping


Symbol Function

Grouping a clause to create a clause. May be nested. "


()
(ab)?(c)" matches "abc" or "c".
(?:) Grouping without storing the result to the buffer.
Alternation combines clauses into one regular expression
| and then matches any of the individual clauses.
"(ab)|(cd)|(ef)" matches "ab" or "cd" or "ef".

Back references
Symbol Group

Matches a clause as numbered by the left parenthesis


()\n "(\w+)\s+\1" matches any word that occurs twice in a row,
such as "hubba hubba."

Replace functionality

In the search pattern


Symbol Function

() Stores the enclosed search result in the next buffer

In the replace pattern


Symbol Function

$1 Uses the content of the first buffer


External Links
Tutorial for regular expression: http://www.regular-
expressions.info
regex101: Online regular expression tester and debugger with
highlighting. https://regex101.com/ . Set the flavor to ECMAScript
(JavaScript) in order to receive the same results.
Wikipedia article: https://en.wikipedia.org/wiki/Regular_expression
Commands
The following regular expression commands are available:
REG_EXP_MATCH — to test if a string matches a regular expression
pattern.
REG_EXP_SEARCH — to search for the next matching regular match in a
string.
REG_EXP_FIND_ALL — to search for all regular expressions matches in
a string.
REG_EXP_REPLACE — to replace regular expression matches in a
string.
§
REG_EXP_MATCH
Tests if an input string matches a regular expression pattern. This
command only succeeds if the complete string is matched. The pattern
syntax follows the ECMAScript (JavaScript) version.
Syntax
REG_EXP_MATCH [option] "input" "search_pattern" matches BOOL<:out>
arraySubMatches<:out>
Arguments

options
The following options are available:
CASE_SENSITIVE argument BOOL — to determine if the comparison
should be case sensitive. Default is FALSE.

input
Text content which should be matched.

search_pattern
Regular expression pattern which is to be searched.

matches
Name of the boolean variable to retrieve the result if the pattern
matches or not.

arraySubMatches
Name of the array which receives the result of the sub matches. These
are the areas in the search pattern which have been marked by
parentheses ( ... ).
Example
DECLARE_VARIABLE STRING input
DECLARE_VARIABLE STRING pattern

input = "John Lennon"


pattern = "(\\w+) (\\w+)"

REG_EXP_MATCH input pattern matches arraySubMatches


IF matches == TRUE
FOR sub_match REF ARRAY arraySubMatches
PRINT "%" sub_match
END_FOR
END_IF
§
REG_EXP_SEARCH
Searches for the next regular expression match in an input string.
The pattern syntax follows the ECMAScript (JavaScript) version.
Syntax
REG_EXP_SEARCH [option] "input" "search_pattern" matches BOOL<:out>
text_match<:out>
Arguments

options
The following options are available:
CASE_SENSITIVE argument BOOL — to determine if the comparison
should be case sensitive. Default is FALSE.

input
Text content in which the patterns are to be searched.

search_pattern
Regular expression pattern which is to be searched. A ^ is
automatically added to the front and a $ to the end of the pattern to
make sure only the complete string it matched.

matches
Name of the boolean variable to retrieve the result if the pattern
matches or not.

text_match
Name of the structure variable of type TEXT_MATCH which will receive
the information about the text which was found and where it is
located in the input string. In case the search pattern is using
parentheses ( ... ).the sub matches are captured in the member array
array_sub_matches.
Example
DECLARE_VARIABLE STRING input
DECLARE_VARIABLE STRING pattern

input = "01234: John Lennon, Paul McCartney, Ringo Starr"


pattern = "(\\w+) (\\w+)"

REG_EXP_SEARCH input pattern matches text_match

IF matches == TRUE
PRINT "pos: %" text_match.position
PRINT "len: %" text_match.length
PRINT "text: %" text_match.text
PRINT "-----------------------------------"

FOR text_sub_match REF ARRAY text_match.array_sub_matches


PRINT "\tpos: %" text_sub_match.position
PRINT "\ten: %" text_sub_match.length
PRINT "\text: %" text_sub_match.text
PRINT "-----------------------------------"
END_FOR
END_IF
§
REG_EXP_FIND_ALL
Searches for all regular expressions matches in an input string. The
pattern syntax follows the ECMAScript (JavaScript) version.
Syntax
REG_EXP_FIND_ALL [option] "input" "search_pattern"
array_text_match<:out>
Arguments

options
The following options are available:
CASE_SENSITIVE argument BOOL — to determine if the comparison
should be case sensitive. Default is FALSE.

input
Text content in which the patterns are to be searched.

search_pattern
Regular expression pattern which is to be searched. A ^ is
automatically added to the front and a $ to the end of the pattern to
make sure only the complete string it matched.

array_text_match
Name of the array which receives each found match as a structure
variable of type TEXT_MATCH. This contains the information about the
text which was found and where it is located in the input string. In
case the search pattern is using parentheses ( ... ).the sub matches
are captured in the member array array_sub_matches.
Example
DECLARE_VARIABLE STRING input
DECLARE_VARIABLE STRING pattern

input = "01234: John Lennon, Paul McCartney, Ringo Starr"


pattern = "(\\w+) (\\w+)"

REG_EXP_FIND_ALL input pattern array_text_matches

FOR text_match REF ARRAY array_text_matches


PRINT "==================================="
PRINT "pos: %" text_match.position
PRINT "len: %" text_match.length
PRINT "text: %" text_match.text
PRINT "-----------------------------------"

FOR text_sub_match REF ARRAY text_match.array_sub_matches


PRINT "\tpos: %" text_sub_match.position
PRINT "\ten: %" text_sub_match.length
PRINT "\text: %" text_sub_match.text
PRINT "-----------------------------------"
END_FOR
END_FOR
§
REG_EXP_REPLACE
Searches for regular expression matches in an input string and
replaces them. The pattern syntax follows the ECMAScript (JavaScript)
version.
Syntax
REG_EXP_REPLACE [option] "input" "search_pattern" "replace_pattern"
output<:out>
Arguments

options
The following options are available:
CASE_SENSITIVE argument BOOL — to determine if the comparison
should be case sensitive. Default is FALSE.

REPLACE_ALL argument BOOL — to determine if all found patterns or


only the first one should be replaced. Default is FALSE.

input
Text in which the patterns should be replaced.

search_pattern
Regular expression pattern which is searched.

replace_pattern
Regular expression replace pattern which modifies the output.

output
Name of the string variable which receives the output.
Example
DECLARE_VARIABLE STRING input
DECLARE_VARIABLE STRING pattern
DECLARE_VARIABLE STRING replace_pattern

input = "01234: John Lennon, Paul McCartney, Ringo Starr"


pattern = "(\\w+) (\\w+)"
replace_pattern = "First name: $1, Second name: $2;"

REG_EXP_REPLACE REPLACE_ALL TRUE input pattern replace_pattern output

PRINT "%" output


§
About Commands for different Services
The following service oriented commands are available:
SEND_MAIL — to send out mails by specifying an mail server.
ZIP — to zip files or folders to a zip file.
§
SEND_MAIL
Sends mails via the specified mail server.
Syntax
SEND_MAIL [options] mailOptions
Arguments

options
The following options are available:
VERBOSE — logs information in the trail file.

mailOptions
Structure variable of type MAIL_OPTION.
Error handling
The program execution will be canceled if an error on sending out the
mail occurs, unless errors are handled by BEGIN_CATCH_ERROR.
Note
To connect the mail server without credentials, leave the login field
of the MAIL_OPTION structure empty.
Example
DECLARE_STRUCT MAIL_OPTION options
options.server = "mail.buw-soft.de"
options.login = "achim"
options.password = "xxxxx"
options.sender = "Achim Schön"
options.sender_mail_addr = "achim@buw-soft.de"
options.subject = "Greetings from SmartDesignServer"
options.message = "This is your SmartDesignServer.\nHave fun."
options.footer = "Achim Schön\nB&W Software GmbH"

DECLARE_STRUCT MAIL_ADDR mail_addr


mail_addr.name = "Achim Schön"
mail_addr.mail_addr = "achim@buw-soft.de"
ADD_ARRAY_ELEM options.recipients mail_addr

ADD_ARRAY_ELEM options.attachments "lib:data.pdf"


SEND_MAIL options
§
ZIP
Zips files and folders to a zip file. When a folder is specified all
includes files will be added recursively.
Syntax
ZIP [options] "file_out" "file" | arrayFilesAndFolders
Arguments

options
The following options are available:
VERBOSE — logs information in the trail file.

file_out
Name of the zip file which should be created.

file
File or folder which should be zipped

arrayFilesAndFolders
Name of an existing array of files and folders which should be
zipped.
Error handling
The program execution will be canceled if an error on zipping the
files occurs, unless errors are handled by BEGIN_CATCH_ERROR.
Example
ZIP "c:\\temp\\results.zip" "c:\\results"
DECLARE_ARRAY filesToZip
ADD_ARRAY_ELEM filesToZip "c:\\results\\sample1.txt"
ADD_ARRAY_ELEM filesToZip "c:\\results\\sample2.txt"
ZIP "c:\\temp\\results.zip" filesToZip
About API Commands
Commands to launch mapkeys and start external applications.
The following commands are available:
PLUGIN — to start an external application.
MAPKEY — to execute a mapkey in Creo Elements/Pro.
TOOLKIT_FUNCTION_CALL — to execute an exported function in a
running Pro/TOOLKIT dll.
PLUGIN
Starts an external program.
Syntax
PLUGIN [options] 'visibility' 'synchronism' "filename" [arguments]
Arguments

options
The following options are available:
CAPTURE_OUTPUT outputArray<:out> — in case this option is set, the
output of an console application is captured in an array of
strings.
OUTPUT_ENCODING — the following encoding options for the output are
available. Default is UTF8.
UTF8 — for UTF8 encoded output.
UTF16 — for UTF16 encoded output.
ASCII — for ASCII code ouput.

CODEPAGE numberINT — for an output encoding to a specific


encoding table (e.g.850 for DOS Latin 1).

visibility
HIDE or SHOW determines the visibility as startup information for the
external program. This is only an advice. It is in the responsibility
of the external application if this advice is used.

synchronism
SYNC or ASYNC determines if the processing of the script file waits
until the external program has terminated.

filename
Specifies the file which should be imported. According to the path
specification it could be either in library or in working directory.
Any string expression is allowed.

arguments
All further arguments are passed to the command line of the external
program.
Note
If no file extension is specified for file name ".exe" is assumed. In
case you are using the cmd.exe command line interpreter, the /c
option has to be set to execute the following arguments.
Example
PLUGIN SHOW SYNC lib:sample.exe "c:\\temp"
PLUGIN SHOW ASYNC "C:\\WINDOWS\\system32\\cmd.exe" "/c rename
file1.txt file2.txt"
MAPKEY
Executes a Creo Elements/Pro mapkey.
Syntax:
MAPKEY "mapkey text"[options]
Arguments

mapkey text
Mapkey text which should be executed in Creo Elements/Pro. Any string
expression is allowed. Line connectors could be used to make the
mapkey more readable to users.

options
Valid options are:
STOP — Executes the mapkey by enabling a string menu similar to the
command STOP.
EXEC_AT_END — Executes the mapkey after the complete tab file is
processed.
FORCE — Gives control back to Creo by using an internal hidden
dialog which it committing automatically. This option is only
useful for mapkeys which affect the current model on the screen.
Note
Not all mapkeys could be executed immediately in Creo Elements/Pro.
In the following situations, mapkeys will be executed in reversed
order after control comes to Creo Elements/Pro:
Activating windows or setting the current model.
Erasing the current model.
Completing dialog commands ending with an "OK" button press. It
will cancel some dialogs after showing them.
Executing macros during a trail file replay
An easy way to get a mapkey is to record and save it. In this case
only the command MAPKEY and an opening and closing quote must be
supplied.
Example
MAPKEY "mapkey xxx
@MAPKEY_NAMEXXXDescriptionXXX;@MAPKEY_LABELXXXNameXXX;\
mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree`1
`node5`;\
mapkey(continued) ~ Activate `main_dlg_cur` `ProCmdDatumCsys.datum`;\
mapkey(continued) ~ Activate `Odui_Dlg_00` `stdbtn_1`;\
mapkey(continued) ~ Activate `main_dlg_cur`
`ProCmdDatumPlane.datum`;\
mapkey(continued) ~ Activate `Odui_Dlg_00` `stdbtn_1`;\
mapkey(continued) ~ Activate `main_dlg_cur`
`ProCmdDatumPlane.datum`;\
mapkey(continued) ~ Activate `Odui_Dlg_00` `stdbtn_1`;\
mapkey(continued) ~ Activate `main_dlg_cur`
`ProCmdDatumPlane.datum`;\
mapkey(continued) ~ Activate `Odui_Dlg_00` `stdbtn_1`;\
mapkey(continued) ~ Activate `main_dlg_cur`
`ProCmdDatumPlane.datum`;\
mapkey(continued) ~ Activate `Odui_Dlg_00` `stdbtn_1`;"
TOOLKIT_FUNCTION_CALL
Executes a function of another Pro/TOOLKIT dll which is running as an
auxiliary application.
Syntax
TOOLKIT_FUNCTION_CALL "dll name" "function name" [ARGUMENTS variable1
variable2 ...]
Arguments

dll name
Name of the dll. The extension '.dll' needs not be included..

function name
Name of the function with should be called inside the dll. The
function must be exported by the following prototype:
extern "C" ProError __declspec(dllexport) function(int nArguments,
TKVariable* pVariables)
'TKVariable' is defined by the following way:
enum TK_VARIABLE_TYPE
{
TK_VARIABLE_INTEGER,
TK_VARIABLE_DOUBLE,
TK_VARIABLE_STRING,
TK_VARIABLE_SELECTION,
};
struct TKVariable
{
TCHAR m_cName[PRO_COMMENT_SIZE];
union _Data
{
int m_nValue;
double m_dValue;
TCHAR m_cValue[PRO_COMMENT_SIZE];
select3d m_sel;
} m_data;
TK_VARIABLE_TYPE m_type;
bool m_bValid;
};

ARGUMENTS variable1 variable2


Optional Input/output variables of type parameter or reference.
Error handling
The program execution will be canceled if executed task returns an
error values, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DECLARE_VARIABLE INT nValue
DECLARE_VARIABLE DOUBLE dValue
nValue = 1
TOOLKIT_FUNCTION_CALL "SampleApplication" "SampleFunction" ARGUMENTS
nValue dValue
PRINT "double value: %" dValue
§
About Commands for 3rd Party Integration
SmartAssembly offers special command to operate with 3rd Party
system. Currently the following products are supported:
Products from B&W Software.
Design Data Manager from Concurrent Systems Inc.
§
About Commands for Integration of products from B&W Software
SmartAssembly offers different interfaces other products from B&W
Software.
The following commands are available:
SMARTHOLECHART_EXEC — to execute jobs in SMARTHolechart.
SMARTUPDATE_EXEC — to execute SMARTUpdate for a specified model.
§
SMARTHOLECHART_EXEC
Executes the search for bore information in SMARTHolechart.
SMARTHolechart must be active in the Creo session in order to run
this command. It requires the SMARTHolechart version 8.0 M020 or
newer.
Syntax
SMARTHOLECHART_EXEC refCsys<:in> "table_name" "direction"
arrayResults
Arguments

refCsys
Reference to the coordinate system which locates the origin. This
also defines the model in which the holes are searched.

table_name
Name of the table format in SMARTHolechart to be used. This format
must be defined in SMARTHolechart. The name is case sensitive. This
format defines which columns are to be retrieved. All content is
supplied as a string value.

direction
Direction for which the holes are to be searched. The string
concatenates the different directions +x, -x, +y, -y, +z, -z, ? (for
example "+y-y").

arrayResults
Name of the array variable which receives the bore information. Each
member of the map consists of the row name of the table and the the
content as a string value.
Error handling
The program execution will be canceled if the coordinate system
reference could not be found or the command fails to retrieve
information from SMARTHolechart, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
When running SMARTHolechart from SmartAssembly the following
SMARTHolechart configuration options needs be considered:
SHOW_DIALOG — shows a status dialog about the found bores. Set this
to NO in order to avoid this dialog.
When running SMARTHolechart from SmartAssembly the following
SMARTHolechart configuration options are ignored:
CREATE_TABLE_PER_TYPE
CREATE_TABLE_PER_DIAMETER
SELECT_MAIN_TAB
CSYS_CREATE
CSYS_FORMAT
CSYS_AUTOSELECT
CSYS_AUTOSELECT_NAME
DIR_DEFAULT
Example
USER_SELECT CSYS csys
SMARTHOLECHART_EXEC csys "SmartAssembly" "+y-y" arrayBores
FOR bore REF ARRAY arrayBores
DECLARE_VARIABLE STRING strBore ""
FOR entry REF MAP bore
strBore += entry.key + ": " + entry.value
END_FOR

PRINT "%" strBore


END_FOR
§
SMARTUPDATE_EXEC
Executes SMARTUpdate for a specified model with a specified
configuration. SMARTUpdate must be active in the Creo session in
order to run this command. It requires the SMARTUpdate version 8.0
M010 or newer.
Syntax
SMARTUPDATE_EXEC model<:in> "config_path" "log_path" check_onlyBOOL
show_dialogBOOL
Arguments

model
The specified model.

config_path
String expression for the SMARTUpdate configuration folder. This
should not include the config directory.

log_path
String expression to the output folder which should receive the log
files.

check_only
Boolean expression to determine if the model is only examined or if
it should be repaired automatically.

show_dialog
Boolean expression if the SMARTUpdate results dialog should be shown.
Error handling
The program execution will be canceled if the model reference is not
valid or if the command fails, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
There are a couple of settings
In case the log_path does not exist, the logs are created in the
configuration folder.
The SMARTUpdate configuration option verbose_check should be set to
yes in order to generate logs for all results. In case it is set to
no, only errors and warnings will appear.
The SMARTUpdate configuration option custom_log should be set to
yes in <config_path>\config\config.update in order to receive
results of all checked models.
Example
SMARTUPDATE_EXEC ASSEMBLY "lib:configuration" "." FALSE TRUE
§
About Commands for Design Data Manager Integration
SmartAssembly offers an interface to the Design Data Manager (DDM)
tool from Concurrent Systems Inc.
The following commands are available:
DDM_CHECKOUT_OBJECT — to checkout objects from the DDM system.
§
DDM_CHECKOUT_OBJECT
Checks out an object from the PDM system DDM.
Syntax
DDM_CHECKOUT_OBJECT [options] "item_number" fileName<:out>
Arguments

options
The following options are supported:
INCLUDE_DRAWINGS — associated drawings will be checkout out.

item_number
Name of the item which should be checked out. Any string expression
is allowed.

fileName
Name of the string variable which receives the file name of the
checked out model.
Error handling
The program execution will be canceled if the model could not be
checked out, unless errors are handled by BEGIN_CATCH_ERROR.
Example
DDM_CHECKOUT_OBJECT INCLUDE_DRAWINGS sample object_name
RETRIEVE_MDL object_name mdl
SWITCH_TO_MDL mdl
§
About Commands for Toolkit Applications
SmartAssembly offers to load and unload Creo Toolkit dll applications
and to run exposed functions from them. The functions require the
following signature:
extern "C" ProError __declspec(dllexport)
task_function(ProArgument* pArgumentsIn, ProArgument**
pArgumentsOut);
Usually SmartAssembly needs to start the Creo Toolkit application in
order to get access to the required handle. However there is also a
technique available that the Toolkit application writes this
information in public area of the Microsoft Windows registry and
SmartAssembly retrieves the handle information from there.
Therefor the Creo Toolkit applications has to retrieve the
application id by calling ProToolkitDllIdGet. The result needs to be
written as string value named CURRENT_APP_ID to the following key:
HKEY_CURRENT_USER\Software\<path>\<creo_process_id>
The following commands are available to run Creo Toolkit
applications:
TK_APP_LOAD — to load a Creo Toolkit dll.
TK_GET_HANDLE_FROM_REGISTRY — to retrieve the handle from registry.
TK_TASK_EXEC — to execute a function of a Creo Toolkit dll.
TK_APP_UNLOAD — to unload a Creo Toolkit dll.
§
TK_APP_LOAD
Loads the Creo Toolkit dll.
Syntax
TK_APP_LOAD [options] program<:in> handle<:out>
Arguments

options
The following options are available:
PERSISTENT — usually the program is automatically stopped when the
handle variable is removed. Using this option allows to keep the
application also running when the SmartAssembly program file is
completely processed.

program
Name of the existing structure variable of type TOOLKIT_DLL with
contains the information about the dll which is to be loaded.

handle
Name of the variable which will receive the handle of the loaded
application.
Error handling
The program execution will be canceled if the dll was not found or
fails to start, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Load the Creo Toolkit dll
DECLARE_STRUCT TOOLKIT_DLL tkdll
tkdll.app_name="SampleProgram"
tkdll.exec_file = "lib:\\dlls\\$PRO_MACHINE_TYPE\\Sample.dll"
tkdll.text_dir = "lib:\\dlls"
tkdll.user_display = FALSE
TK_APP_LOAD tkdll handle

! Compose input array


DECLARE_ARRAY arrayArgumentsIn

DECLARE_VARIABLE STRING name


name = "sample"
ADD_ARRAY_ELEM arrayArgumentsIn.name

DECLARE_VARIABLE DOUBLE value


value = 3.14
ADD_ARRAY_ELEM arrayArgumentsIn.value

! Execute functions of the loaded dll


TK_TASK_EXEC handle "SampleFunction" arrayArgumentsIn
arrayArgumentsOut

! Output result
FOR result REF ARRAY arrayArgumentsOut
PRINT "%" result
END_FOR

! Unload the dll


TK_APP_UNLOAD handle
§
TK_GET_HANDLE_FROM_REGISTRY
Retrieves the handle from the Creo Toolkit dll from registry. This
works only if the Toolkit application writes the result of
ProToolkitDllIdGet to the windows registry. The registry key is:
HKEY_CURRENT_USER\Software\<path>\<creo_process_id> and the value:
CURRENT_APP_ID. At the end of the application the Toolkit dll should
remove this information again from registry. As path it is
recommended to use <company name>\<application name>.
Syntax
TK_GET_HANDLE_FROM_REGISTRY "path" handle<:out>
Arguments

Path
String value which defines the path in the registry which is appended
to HKEY_CURRENT_USER\Software.

handle
Name of the variable which will receive the handle of the loaded
application.
Error handling
The program execution will be canceled if the dll was not found,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Retrieve the handle from registry
TK_GET_HANDLE_FROM_REGISTRY "B&W Software GmbH\Sample application"
handle

! Compose input array


DECLARE_ARRAY arrayArgumentsIn

DECLARE_VARIABLE STRING name


name = "sample"
ADD_ARRAY_ELEM arrayArgumentsIn.name

DECLARE_VARIABLE DOUBLE value


value = 3.14
ADD_ARRAY_ELEM arrayArgumentsIn.value

! Execute functions of the loaded dll


TK_TASK_EXEC handle "SampleFunction" arrayArgumentsIn
arrayArgumentsOut

! Output result
FOR result REF ARRAY arrayArgumentsOut
PRINT "%" result
END_FOR

! Unload the dll


TK_APP_UNLOAD handle
§
TK_TASK_EXEC
Executes a task of a loaded Creo Toolkit dll.
Syntax
TK_TASK_EXEC handle<:in> "function" arrayInput<:in> arrayOutput<:in>
Arguments

handle
Variable which contains the dll handle.

function
Name of the function what should be called in the loaded dll. This
function requires the following signature:
extern "C" ProError __declspec(dllexport)
task_function(ProArgument* pArgumentsIn, ProArgument**
pArgumentsOut);

arrayInput
Name of the existing array which contains the input variables.
Allowed are variables of the types: integer, double, boolean, string
and reference.

arrayOutput
Name of the variable which will receive the output variables in an
array.
Error handling
The program execution will be canceled if executed task returns an
error value, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Load the Creo Toolkit dll
DECLARE_STRUCT TOOLKIT_DLL tkdll
tkdll.app_name="SampleProgram"
tkdll.exec_file = "lib:\\dlls\\$PRO_MACHINE_TYPE\\Sample.dll"
tkdll.text_dir = "lib:\\dlls"
tkdll.user_display = FALSE
TK_APP_LOAD tkdll handle

! Compose input array


DECLARE_ARRAY arrayArgumentsIn

DECLARE_VARIABLE STRING name


name = "sample"
ADD_ARRAY_ELEM arrayArgumentsIn name

DECLARE_VARIABLE DOUBLE value


value = 3.14
ADD_ARRAY_ELEM arrayArgumentsIn value

! Execute functions of the loaded dll


TK_TASK_EXEC handle "task_function" arrayArgumentsIn
arrayArgumentsOut

! Output result
FOR result REF ARRAY arrayArgumentsOut
PRINT "%" result
END_FOR

! Unload the dll


TK_APP_UNLOAD handle
§
TK_APP_UNLOAD
Unloads a Creo Toolkit dll.
Syntax
TK_APP_UNLOAD handle<:in>
Arguments

handle
Variable which contains the dll handle.
Error handling
The program execution will be canceled if the dll fails to stop,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Load the Creo Toolkit dll
DECLARE_STRUCT TOOLKIT_DLL tkdll
tkdll.app_name="SampleProgram"
tkdll.exec_file = "lib:\\dlls\\$PRO_MACHINE_TYPE\\Sample.dll"
tkdll.text_dir = "lib:\\dlls"
tkdll.user_display = FALSE
TK_APP_LOAD tkdll handle

! Compose input array


DECLARE_ARRAY arrayArgumentsIn

DECLARE_VARIABLE STRING name


name = "sample"
ADD_ARRAY_ELEM arrayArgumentsIn.name

DECLARE_VARIABLE DOUBLE value


value = 3.14
ADD_ARRAY_ELEM arrayArgumentsIn.value

! Execute functions of the loaded dll


TK_TASK_EXEC handle "SampleFunction" arrayArgumentsIn
arrayArgumentsOut

! Output result
FOR result REF ARRAY arrayArgumentsOut
PRINT "%" result
END_FOR

! Unload the dll


TK_APP_UNLOAD handle
§
About Commands for J-Link Applications
SmartAssembly offers to load and unload J-Link applications and to
run registered methods from them. These methods needs to be
registered in the following way:
com.ptc.pfc.pfcGlobal.GetProESession().RegisterTask();
The following commands are available to run J-Link applications:
JLINK_APP_LOAD — to load a J-Link application.
JLINK_TASK_EXEC — to execute a function from a J-Link application.
JLINK_APP_UNLOAD — to unload a J-Link application.
§
JLINK_APP_LOAD
Loads the J-Link application.
Syntax
JLINK_APP_LOAD [options] program<:in> handle<:out>
Arguments

options
The following options are available:
PERSISTENT — usually the J-Link is automatically stopped when the
handle variable is removed. Using this option allows to keep the
application also running when the SmartAssembly program file is
completely processed.

program
Name of the existing structure variable of type JLINK_APP_REGISTRY
with contains the information about the J-Link application which is
to be loaded.

handle
Name of the variable which will receive the handle of the loaded
application.
Error handling
The program execution will be canceled if the J-Link application was
not found or fails to start, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
! Load the J-Link application
DECLARE_STRUCT JLINK_APP_REGISTRY jlink_app_reg
link_app_reg.app_name="SampleProgram"
jlink_app_reg.java_app_classpath = "lib:\\appl\\bin"
jlink_app_reg.java_app_class = "de.buw.JLinkSample"
jlink_app_reg.text_dir = "lib:\\appl"
jlink_app_reg.user_display = TRUE
JLINK_APP_LOAD jlink_app_reg handle

! Compose input array


DECLARE_ARRAY arrayArgumentsIn

DECLARE_VARIABLE STRING name


name = "sample"
ADD_ARRAY_ELEM arrayArgumentsIn.name

DECLARE_VARIABLE DOUBLE value


value = 3.14
ADD_ARRAY_ELEM arrayArgumentsIn.value

! Execute methods of the J-Link application


JLINK_TASK_EXEC handle "SampleFunction" arrayArgumentsIn
arrayArgumentsOut

! Output result
FOR result REF ARRAY arrayArgumentsOut
PRINT "%" result
END_FOR

! Unload the J-Link application


JLINK_APP_UNLOAD handle
§
JLINK_TASK_EXEC
Executes a task of a loaded J-Link application.
Syntax
JLINK_TASK_EXEC handle<:in> "method" arrayInput<:in> arrayOutput<:in>
Arguments

handle
Variable which contains the J-Link handle.

function
Name of the method which should be called in the loaded J-Link
application. This method needs to be registered in J-Link via:
com.ptc.pfc.pfcGlobal.GetProESession().RegisterTask();

arrayInput
Name of the existing array which contains the input variables.
Allowed are variables of the types: integer, double, boolean, string
and reference.

arrayOutput
Name of the variable which will receive the output variables in an
array.
Error handling
The program execution will be canceled if executed task returns an
error value, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Load the J-Link application
DECLARE_STRUCT JLINK_APP_REGISTRY jlink_app_reg
link_app_reg.app_name="SampleProgram"
jlink_app_reg.java_app_classpath = "lib:\\appl\\bin"
jlink_app_reg.java_app_class = "de.buw.JLinkSample"
jlink_app_reg.text_dir = "lib:\\appl"
jlink_app_reg.user_display = TRUE
JLINK_APP_LOAD jlink_app_reg handle

! Compose input array


DECLARE_ARRAY arrayArgumentsIn

DECLARE_VARIABLE STRING name


name = "sample"
ADD_ARRAY_ELEM arrayArgumentsIn.name

DECLARE_VARIABLE DOUBLE value


value = 3.14
ADD_ARRAY_ELEM arrayArgumentsIn.value

! Execute methods of the J-Link application


JLINK_TASK_EXEC handle "SampleFunction" arrayArgumentsIn
arrayArgumentsOut

! Output result
FOR result REF ARRAY arrayArgumentsOut
PRINT "%" result
END_FOR

! Unload the J-Link application


JLINK_APP_UNLOAD handle
§
JLINK_APP_UNLOAD
Unloads a J-Link application.
Syntax
JLINK_APP_UNLOAD handle<:in>
Arguments

handle
Variable which contains the J-Link handle.
Error handling
The program execution will be canceled if the J-Link application
fails to stop, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Load the J-Link application
DECLARE_STRUCT JLINK_APP_REGISTRY jlink_app_reg
link_app_reg.app_name="SampleProgram"
jlink_app_reg.java_app_classpath = "lib:\\appl\\bin"
jlink_app_reg.java_app_class = "de.buw.JLinkSample"
jlink_app_reg.text_dir = "lib:\\appl"
jlink_app_reg.user_display = TRUE
JLINK_APP_LOAD jlink_app_reg handle

! Compose input array


DECLARE_ARRAY arrayArgumentsIn

DECLARE_VARIABLE STRING name


name = "sample"
ADD_ARRAY_ELEM arrayArgumentsIn.name

DECLARE_VARIABLE DOUBLE value


value = 3.14
ADD_ARRAY_ELEM arrayArgumentsIn.value

! Execute methods of the J-Link application


JLINK_TASK_EXEC handle "SampleFunction" arrayArgumentsIn
arrayArgumentsOut

! Output result
FOR result REF ARRAY arrayArgumentsOut
PRINT "%" result
END_FOR

! Unload the J-Link application


JLINK_APP_UNLOAD handle
§
About SmartAssembly Toolkit
SmartAssembly Toolkit is a Visual C++ 2005 development environment
for writing Pro/TOOLKIT programs with access to SmartAssembly
functions as well as reading and writing variables. It consists on a
library for linking and a header file which declares the function
prototypes.
This allows the development of high performance applications on
SmartAssembly and enables to write custom applications.
Inside SmartAssembly the following commands are available to launch
SmartAssembly Toolkit based programs:
TOOLKIT_APP_LOAD — to load a SmartAssembly Toolkit dll.
TOOLKIT_TASK_EXEC — to execute a function in a loaded SmartAssembly
Toolkit dll.
TOOLKIT_APP_UNLOAD — to unload a SmartAssembly Toolkit dll.
§
TOOLKIT_APP_LOAD
Loads SmartAssembly Toolkit dll.
Syntax
TOOLKIT_APP_LOAD program<:in> handle<:out>
Arguments

program
Name of the existing structure variable of type TOOLKIT_DLL with
contains the information about the dll which is to be loaded.

handle
Name of the variable which will receive the handle of the loaded
application.
Error handling
The program execution will be canceled if the dll was not found or
fails to start, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Load the SmartAssembly dll
DECLARE_STRUCT TOOLKIT_DLL tkdll
tkdll.app_name="SampleProgram"
tkdll.exec_file = "lib:\\dlls\\$PRO_MACHINE_TYPE\\Sample.dll"
tkdll.text_dir = "lib:\\dlls"
tkdll.user_display = FALSE
TOOLKIT_APP_LOAD tkdll handle

! Execute functions of the loaded dll


TOOLKIT_TASK_EXEC handle "SampleFunction"

! Unload the dll


TOOLKIT_APP_UNLOAD handle
§
TOOLKIT_TASK_EXEC
Executes a task of a loaded SmartAssembly Toolkit dll.
Syntax
TOOLKIT_TASK_EXEC handle<:in> "function"
Arguments

handle
Variable which contains the dll handle.

function
Name of the function what should be called in the loaded dll.
Error handling
The program execution will be canceled if executed task returns an
error value, unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Load the SmartAssembly dll
DECLARE_STRUCT TOOLKIT_DLL tkdll
tkdll.app_name="SampleProgram"
tkdll.exec_file = "lib:\\dlls\\$PRO_MACHINE_TYPE\\Sample.dll"
tkdll.text_dir = "lib:\\dlls"
tkdll.user_display = FALSE
TOOLKIT_APP_LOAD tkdll handle

! Execute functions of the loaded dll


TOOLKIT_TASK_EXEC handle "SampleFunction"

! Unload the dll


TOOLKIT_APP_UNLOAD handle
§
TOOLKIT_APP_UNLOAD
Unloads a SmartAssembly Toolkit dll.
Syntax
TOOLKIT_APP_UNLOAD handle<:in>
Arguments

handle
Variable which contains the dll handle.
Error handling
The program execution will be canceled if the dll fails to stop,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
! Load the SmartAssembly dll
DECLARE_STRUCT TOOLKIT_DLL tkdll
tkdll.app_name="SampleProgram"
tkdll.exec_file = "lib:\\dlls\\$PRO_MACHINE_TYPE\\Sample.dll"
tkdll.text_dir = "lib:\\dlls"
tkdll.user_display = FALSE
TOOLKIT_APP_LOAD tkdll handle

! Execute functions of the loaded dll


TOOLKIT_TASK_EXEC handle "SampleFunction"

! Unload the dll


TOOLKIT_APP_UNLOAD handle
§
About External Data Option Commands
Commands to access external data sources. These commands require the
external data license option. This option replaces the former ODBC
option.
Access to ODBC Databases — to send SQL commands via ODBC to SQL
database systems.
Access to FTP servers — to upload and download files to and from
FTP servers.
XML commands — to read, process and write XML data.
JSON commands — to read, process and write JSON data.
Web Service commands — to access external web services by RESTful
HTTP.
Windchill Info*Engine commands — to access the Windchill
Info*Engine.
§
About ODBC Commands
For using ODBC commands the external data license option is required
which replaces the former ODBC license option.
For connecting successfully to ODBC databases the appropriate data
source has to be installed locally via Start > Control Panel >
Administrative Tools > Data Sources (ODBC)
The following commands are available:
ODBC_CONNECT — to connect to a database.
ODBC_DISCONNECT — to disconnect from a database
ODBC_QUERY — to query database values.
ODBC_GET_TABLES — to retrieve the names of all tables in the
database.
ODBC_GET_TABLE_COUMNS — to retrieve the name of all columns in a
database table.
ODBC_GET_COLUMN_TYPE — to retrieve the type of a column.
ODBC_EXECUTE — to execute commands.
ODBC_COMMIT — to make changes persistent.
Additionally the following logical expression can be used:
ODBC_CONNECTED — to figure out if a connection to ODBC is already
established.
Note
Filtering queried values should be done inside the database for
performance reason. It is no good practice to query a large set of
values and filter out the required set inside the tab file.
§
ODBC_CONNECT
Database ODBC command to connect to a database.
Syntax
ODBC_CONNECT [options] "connection string"
Arguments

options
The following options are available:
USE_32BIT_DRIVER 32bitBOOL — uses a 32 bit driver for the 64 bit
application. Default is FALSE.
ERROR_MESSAGE variable — optional output variable for the error
message.

connection string
The connection string is specific for the database and the locally
configured data source. Any string expression is allowed.
Error handling
The program execution will be canceled if the ODBC command causes an
error, unless errors are handled by BEGIN_CATCH_ERROR.
Note
In case a ODBC connection is already established the command
disconnects and connects again. If you want to figure out whether the
connection to ODBC is already established use the logical expression
ODBC_CONNECTED in an IF statement.
Example
ODBC_CONNECT "DSN=COMPANY_DATABASE;UID=system;PWD=manager"
§
ODBC_DISCONNECT
Database ODBC command to disconnect from a database.
Syntax
ODBC_DISCONNECT
§
ODBC_QUERY
Database ODBC command to query values from a database.
Syntax
ODBC_QUERY [options]"query string" arrayResult<:out>
Arguments

options
the following options are available:
OPTIMIZE_NETWORK_TRAFFIC optimizeBOOL — optimizes the network
traffic in a way that larger TCP/IP packages are used. This is
currently not supported for 32bit driver mode. Default is FALSE.
ERROR_MESSAGE variable — optional output variable for the error
message.

query string
The query string contains the SQL command for retrieving information
from the database. Any string expression is allowed.

arrayResult
Array which will receive the queried values.
Error handling
The program execution will be canceled if the ODBC command causes an
error, unless errors are handled by BEGIN_CATCH_ERROR.
Example
ODBC_QUERY "SELECT name FROM equipment WHERE weight < 100"
arrayLightEquipment
FOR equipment REF ARRAY arrayLightEquipment
PRINT "Equipment: %" equipment
END_FOR
§
ODBC_GET_TABLES
Retrieves the names of all tables in the database.
Syntax
ODBC_GET_TABLES [options] arrayTableNames<:out>
Arguments

options
The following options are available.
DATABASE_NAME "name" — restrict the tables to the provided database
name.
DATABASE_SCHEMA "name" — restrict the tables to the provided scheme
name.
ERROR_MESSAGE variable — optional output variable for the error
message.

arrayTableNames
Array which will receive the names of the tables.
Error handling
The program execution will be canceled if the ODBC command causes an
error, unless errors are handled by BEGIN_CATCH_ERROR.
Example
ODBC_CONNECT "DSN=odbc_example"
ODBC_GET_TABLES arrayTables

FOR table REF ARRAY arrayTables


PRINT "------------------"
PRINT "%" table
PRINT "------------------"

ODBC_GET_TABLE_COLUMNS table arrayColumns

FOR column REF ARRAY arrayColumns


ODBC_GET_COLUMN_TYPE table column type
PRINT "% (%)" column type
END_FOR
END_FOR
ODBC_DISCONNECT
§
ODBC_GET_TABLE_COLUMNS
Retrieves the names of all columns in a database table.
Syntax
ODBC_GET_TABLE_COLUMNS [options]"table" arrayColumnNames<:out>
Arguments

options
The following options are available:
ERROR_MESSAGE variable — optional output variable for the error
message.

table
The table name. Any string expression is allowed.

arrayColumnNames
Array which will receive the names of the columns.
Error handling
The program execution will be canceled if the ODBC command causes an
error, unless errors are handled by BEGIN_CATCH_ERROR.
Example
ODBC_CONNECT "DSN=odbc_example"
ODBC_GET_TABLES arrayTables

FOR table REF ARRAY arrayTables


PRINT "------------------"
PRINT "%" table
PRINT "------------------"

ODBC_GET_TABLE_COLUMNS table arrayColumns

FOR column REF ARRAY arrayColumns


ODBC_GET_COLUMN_TYPE table column type
PRINT "% (%)" column type
END_FOR
END_FOR
ODBC_DISCONNECT
§
ODBC_GET_COLUMN_TYPE
Retrieves the type of a column.
Syntax
ODBC_GET_COLUMN_TYPE [options] "table" "column" type<:out>
Arguments

options
The following options are available:
ERROR_MESSAGE variable — optional output variable for the error
message.

table
The table name. Any string expression is allowed.

column
The column name. Any string expression is allowed.

type
Name of the variable which receives the type as a string values. The
following types are available: STRING, DOUBLE and INTEGER.
Error handling
The program execution will be canceled if the ODBC command causes an
error, unless errors are handled by BEGIN_CATCH_ERROR.
Example
ODBC_CONNECT "DSN=odbc_example"
ODBC_GET_TABLES arrayTables

FOR table REF ARRAY arrayTables


PRINT "------------------"
PRINT "%" table
PRINT "------------------"

ODBC_GET_TABLE_COLUMNS table arrayColumns

FOR column REF ARRAY arrayColumns


ODBC_GET_COLUMN_TYPE table column type
PRINT "% (%)" column type
END_FOR
END_FOR
ODBC_DISCONNECT
§
ODBC_EXECUTE
Database ODBC command to execute database commands. This is
typically used to insert values to a database.
Syntax
ODBC_EXECUTE [options] "execute string"
Arguments

options
The following options are available:
ERROR_MESSAGE variable — optional output variable for the error
message.

insert string
The execute string contains the SQL command to be executed in the
database. Any string expression is allowed.
Error handling
The program execution will be canceled if the ODBC command causes an
error, unless errors are handled by BEGIN_CATCH_ERROR.
Example
INSERT INTO equipment VALUES ('spring', 100, 50, 0.5)
§
ODBC_COMMIT
Database ODBC command to commit executed commands in a database.
This is required to make changes in the database persistent.
Syntax
ODBC_COMMIT [options]

options
The following options are available:
ERROR_MESSAGE variable — optional output variable for the error
message.
Note
This command is required to make changes in a database persistent.
ODBC_DISCONNECT automatically commits the changes from the session.
§
About FTP Commands
For using FTP commands the external data license option is required
which replaces the former ODBC license option.
The following commands are available:
FTP_CONNECT — to connect to a FTP server.
FTP_DISCONNECT — to disconnection from a FTP server.
FTP_UPLOAD_FILE — to upload a file to a FTP server.
FTP_DOWNLOAD_FILE — to download a file from a FTP server.
Additionally the following logical expression can be used:
FTP_CONNECTED — to figure out if a connection to a FTP server is
already available.
§
FTP_CONNECT
Connects to a FTP server.
Syntax
FTP_CONNECT [options] "server" "login" "password" [FTP_OPTION]
Arguments

options
The following options are available:
VERBOSE — logs information in the trail file.

sever name
Name of the FTP server to connect. Any string expression is allowed.

login
User name which should be used for the connection. Any string
expression is allowed. GET_AUTHENTICATION can be used to avoid that
the password has be encoded in clear text in the tab file.

password
Password which should be used for the connection. Any string
expression is allowed.

FTP_OPTION
Optional structure variable of type FTP_OPTION. This allows to
specify port and security settings.
Note
In case a FTP connection is already established the command
disconnects and connects again. If you want to figure out whether the
connection to the FTP server is already established use the logical
expression FTP_CONNECTED in an IF statement.
Example
GET_AUTHENTICATION ftp_account login password
FTP_CONNECT "ftp.my-company.com" login password
§
FTP_DISCONNECT
Disconnects from a FTP server.
Syntax
FTP_DISCONNECT
§
FTP_UPLOAD_FILE
To upload a file to the connected FTP server.
Syntax
FTP_UPLOAD_FILE [options] "file" "ftp_dir"
Arguments

options
The following options are available:
VERBOSE — logs information in the trail file.

file
Specify the file which should be uploaded to the FTP server.
According to the path specification it could be either in library, in
working directory or in any other location on the hard disk. Any
string expression is allowed.

ftp_dir
Directory on the FTP server to which the file should be uploaded.
Any string expression is allowed.
Example
GET_AUTHENTICATION ftp_account login password
FTP_CONNECT "ftp.my-company.com" login password
FTP_UPLOAD_FILE "file1.txt" "/incoming/user_data"
FTP_UPLOAD_FILE "lib:description.txt" "/incoming/user_data"
FTP_DISCONNECT
§
FTP_DOWNLOAD_FILE
To download a file from the connected FTP server.
Syntax
FTP_DOWNLOAD_FILE [options] "ftp_file" "dir"
Arguments

options
The following options are available:
VERBOSE — logs information in the trail file.

ftp_file
Specify the File from the FTP server which should be downloaded. Any
string expression is allowed.

dir
Directory on the hard disk to which the file should be downloaded.
According to the path specification it could be either in library or
in working directory or in any other location on the hard disk. Any
string expression is allowed.
Example
GET_AUTHENTICATION ftp_account login password
FTP_CONNECT "ftp.my-company.com" login password
FTP_DOWNLOAD_FILE "/incoming/user_data/file1.txt" "."
FTP_DOWNLOAD_FILE "/incoming/user_data/description.txt" "d:\\temp"
FTP_DISCONNECT
§
About XML Commands
For using XML commands the external data license option is required.
This replaces the former ODBC option.
The following commands are available:
XML_LOAD_DOCUMENT — to load a XML document from disk, http, or ftp.
XML_INIT_DOCUMENT — to initialize a XML document from string.
XML_DOCUMENT_TO_STRING — to convert an existing XML document to a
string.
XML_NEW_DOCUMENT — to create a new XML document.
XML_FORMAT_DOCUMENT — to format an existing XML document with
indentions and line breaks.
XML_SAVE_DOCUMENT — to save a XML document to disk.
XML_GET_NODE — to retrieve node from a XML document or from an
existing XML node.
XML_GET_SIBLING_NODE — to retrieve a sibling node from an existing
XML node.
XML_ADD_NODE — to add a new node as child of the XML document or of
a parent node.
XML_APPEND_NODES — to append nodes to a parent note in a XML
document.
XML_GET_NODES — to retrieve an array of nodes from a XML document
or from and existing XML node.
XML_GET_SIBLING_NODES — to retrieve an array of sibling nodes from
an existing XML node.
XML_GET_NODE_VALUE — to get the value of an exiting node.
XML_SET_NODE_VALUE — to set the value of an existing node.
XML_GET_NODE_TYPE — to get the type of a node.
XML_GET_NODE_NAME — to get the name of an attribute.
XML_GET_NODE_ATTRIBUTE — to retrieve one attribute from a node.
XML_ADD_NODE_ATTRIBUTE — to add an attribute to an existing node.
XML_GET_NODE_ATTRIBUTES — to retrieve an array of attributes from a
node.
XML_GET_ATTRIBUTE_NAME — to get the name of an attribute.
XML_GET_ATTRIBUTE_VALUE — to get the value of an attribute.
XML_COMPARE_NODES — to compare two nodes.
XML_QUERY_VALUES — to query values from a XML node or a document.
About XML
The following example will be used to explain the XML terms:

Example
<?xml version="1.0" encoding="utf-8"?>
<data>
<Parameter>
<name>sample</name>
<value>100.0</value>
<type>DOUBLE</type>
<owner>prt0001.prt</owner>
</Parameter>
<Comment id="1" type="info">This is an example</Comment>
</data>

Document structure
The first line of an XML document <?xml version="1.0" encoding="utf-
8"?> provides some information about text encoding and the XML
version. This is always the first line of an XML file. Every XML file
has exactly one main node. In this case it is the node data.

Nodes
Nodes names are enclosed by a less-than and a greater-than symbol for
example <data>. This introduces the start of the node. The node is
ended by the same name with a / symbol as prefix. In this case it is
</data>. Empty nodes can be written with trailing slash (e.g.
<data/>) A name can contain as well sub nodes and a node value.
A node can have the following types:
NODE_TEXT — the node has only a value.
NODE_COMPOUND — the node has child nodes, but no value.
NODE_COMPOUND_TEXT — the node has child nodes and a value.
NODE_EMPTY — the node is completely empty.

Attributes
A node can also contain attributes which follow the node name before
the greater-symbol like <Comment id="1">. The attribute consists of a
name (in this case id), and equal sign and a value which is enclosed
in quotes (in this case "1"). Attributes can be used as information
elements as well as for identification of one specific nodes in case
several has the same name. When querying for attributes, asterisks
can be used for name and value.

Accessing nodes by a path


Nodes can be addressed by the XPath convention.
Paths starting with an slash are starting from the root of the
document (e.g. /data/Parameter).
Other paths are relative to an existing node.
An asterisk can be used for multiple nodes (e.g.
/data/Parameter/*).
§
XML_LOAD_DOCUMENT
Loads a XML document from file, http or ftp connection.
Syntax
XML_LOAD_DOCUMENT "file name" XMLDocument<:out>
Arguments

file name
The file and path of the document Any string expression is allowed.

XMLDocument
Name of the variable for the XML document descriptor.
Error Handling
The program execution will be canceled if the XML document cannot be
retrieved, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The file name optionally includes the path and can also point to an
http or ftp connection. If no file extension is available, '.xml' is
assumed.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_LOAD_DOCUMENT "http://www.buw-soft.de/sample.xml" xmlDocument
§
XML_INIT_DOCUMENT
Initializes a XML document from string.
Syntax
XML_INIT_DOCUMENT "xmlString" XMLDocument<:out>
Arguments

xmlString
String which contains a complete XML document. Any string expression
is allowed.

XMLDocument
Name of the variable for the XML document descriptor.
Error Handling
The program execution will be canceled if the string does not contain
a valid XML document, unless errors are handled by BEGIN_CATCH_ERROR.
Example
GET_DESIGN_SERVER_VARIABLE "data" value
XML_INIT_DOCUMENT value xmlDocument
§
XML_DOCUMENT_TO_STRING
Converts an existing XML document to a string.
Syntax
XML_DOCUMENT_TO_STRING XMLDocument<:in> xmlString<:out>
Arguments

XMLDocument
Existing XML document.

xmlString
Name of the string variable which receives the content of the XML
document.
Error Handling
The program execution will be canceled if the XML document is not
found or not valid, unless errors are handled by BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_DOCUMENT_TO_STRING xmlDocument value
MESSAGE_BOX value
§
XML_NEW_DOCUMENT
Creates a new XML document which just includes the instruction line.
Syntax
XML_NEW_DOCUMENT XMLDocument<:out>
Arguments

XMLDocument
Name of the variable for the XML document descriptor.
Example
XML_NEW_DOCUMENT xmlDocument

XML_ADD_NODE xmlDocument "data" nodeData

XML_ADD_NODE nodeData "mdl_name" nodeMdlName


XML_SET_NODE_VALUE nodeMdlName "0815"
XML_ADD_NODE_ATTRIBUTE nodeMdlName "type" "prt"

XML_ADD_NODE nodeData "mdl_name" nodeMdlName


XML_SET_NODE_VALUE nodeMdlName "4711"
XML_ADD_NODE_ATTRIBUTE nodeMdlName "type" "asm"

XML_FORMAT_DOCUMENT xmlDocument
XML_SAVE_DOCUMENT xmlDocument "output.xml"
§
XML_FORMAT_DOCUMENT
Formats an existing XML document with indentions and line breaks.
Syntax
XML_FORMAT_DOCUMENT XMLDocument<:out>
Arguments

XMLDocument
Name of the variable for the XML document descriptor.
Error Handling
The program execution will be canceled if the XML document is not
found or not valid, unless errors are handled by BEGIN_CATCH_ERROR.
Example
XML_NEW_DOCUMENT xmlDocument

XML_ADD_NODE xmlDocument "data" nodeData

XML_ADD_NODE nodeData "mdl_name" nodeMdlName


XML_SET_NODE_VALUE nodeMdlName "0815"
XML_ADD_NODE_ATTRIBUTE nodeMdlName "type" "prt"

XML_ADD_NODE nodeData "mdl_name" nodeMdlName


XML_SET_NODE_VALUE nodeMdlName "4711"
XML_ADD_NODE_ATTRIBUTE nodeMdlName "type" "asm"

XML_FORMAT_DOCUMENT xmlDocument
XML_SAVE_DOCUMENT xmlDocument "output.xml"
§
XML_SAVE_DOCUMENT
Saves a XML document to disk.
Syntax
XML_SAVE_DOCUMENT XMLDocument<:in> "file name"
Arguments

XMLDocument
Existing XML document descriptor.

file name
The file and path of the document Any string expression is allowed.
Error Handling
The program execution will be canceled if the XML document descriptor
is not existing or the document can not be saved, unless errors are
handled by BEGIN_CATCH_ERROR.
Example
XML_INIT_DOCUMENT value xmlDocument
XML_SAVE_DOCUMENT xmlDocument "out.xml"
§
XML_GET_NODE
Retrieves a node from a XML document or from a parent node.
Syntax
XML_GET_NODE [options] node "node name" "attribute" XMLNode<:out>
Arguments

options
The following options are supported:
RECURSIVE — to search recursively

node
Existing XML node or document.

node name
Name of the node. This can include path information according the
XPath convention. Any string expression is allowed.

attribute
Name and value of the attribute separated by the equal sign. (e.g.
"id=\"18\" or "i*=\"*\"). Leave it empty to disregard attribute
information. Multiple attributes have to be separated by spaces
(e.g. "id=\"18\" number<\"25\"").

XMLNode
Name of the variable for the XML node descriptor.
Error Handling
The program execution will be canceled if the parent XML node or
document cannot be retrieved or is invalid, or if the new node cannot
be found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODE xmlDocument "/data/parameter" "" nodeParameter
XML_GET_NODE nodeParameter "name" "id=10" nodeName10
§
XML_GET_SIBLING_NODE
Retrieves a sibling of a XML node.
Syntax
XML_GET_SIBLING_NODE [options] node "sibling name" "attribute"
XMLNode<:out>
Arguments

options
The following options are supported:
SEARCH_FORWARD valueBOOL — search in forward direction. Default is
TRUE.

node
Existing XML node.

sibling name
Name of the sibling note. This can include path information according
the XPath convention. Any string expression is allowed.

attribute
Name and value of the attribute separated by the equal sign. (e.g.
"id=\"18\" or "i*=\"*\"). Leave it empty to disregard attribute
information. Multiple attributes have to be separated by spaces
(e.g. "id=\"18\" number<\"25\"").

XMLNode
Name of the variable for the XML node descriptor.
Error Handling
The program execution will be canceled if the XML node cannot be
retrieved or is invalid, or if the new node cannot be found, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODE xmlDocument "/data/parameter" "" xmlNodeParameter
XML_GET_SIBLING_NODE xmlNodeParameter"parameter" ""
xmlNodeNextParameter
§
XML_ADD_NODE
Adds a new node as child of the XML document or of a parent node.
Syntax
XML_ADD_NODE node "node name" XMLNode<:out>
Arguments

node
Existing XML node or document.

node name
Name of the new node. Any string expression is allowed.

XMLNode
Name of the variable for the XML node descriptor.
Error Handling
The program execution will be canceled if the parent XML node or
document cannot be retrieved or is invalid, or if the new node cannot
be found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
XML_NEW_DOCUMENT xmlDocument

XML_ADD_NODE xmlDocument "data" nodeData

XML_ADD_NODE nodeData "mdl_name" nodeMdlName


XML_SET_NODE_VALUE nodeMdlName "0815"
XML_ADD_NODE_ATTRIBUTE nodeMdlName "type" "prt"

XML_ADD_NODE nodeData "mdl_name" nodeMdlName


XML_SET_NODE_VALUE nodeMdlName "4711"
XML_ADD_NODE_ATTRIBUTE nodeMdlName "type" "asm"

XML_FORMAT_DOCUMENT xmlDocument
XML_SAVE_DOCUMENT xmlDocument "output.xml"
§
XML_APPEND_NODES
Adds one or multiple existing nodes as child of a parent node of a
XML document. The nodes which are added can be retrieved from another
document.
Syntax
XML_APPEND_NODES node_parent node_to_append | nodes_to_append
Arguments

node_parent
Existing XML node which is used as parent.

node_to_append | nodes_to_append
A single node or an array of nodes which should be appended.
Error Handling
The program execution will be canceled if the parent node or the
nodes which should be appended are not existing or if the result is
an invalid XML document, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample1.xml" docSample1
XML_LOAD_DOCUMENT "lib:sample2.xml" docSample2

XML_GET_NODE docSample1 "/data/values" "" nodeDoc1Values


XML_GET_NODES docSample2 "/data/values/*" "" arrayDoc2ValuesToAppend

XML_APPEND_NODES nodeDoc1Values arrayDoc2ValuesToAppend


§
XML_GET_NODES
Retrieves nodes from a XML document or from a parent node.
Syntax
XML_GET_NODES [options] node "node name" "attribute"
arrayXMLNodes<:out>
Arguments

options
The following options are supported:
RECURSIVE — to search recursively

node
Existing XML node or document.

node name
Name of the node. This can include path information according the
XPath convention. Any string expression is allowed.

attribute
Name and value of the attribute separated by the equal sign. (e.g.
"id=\"18\" or "i*=\"*\"). Leave it empty to disregard attribute
information. Multiple attributes have to be separated by spaces (e.g.
"id=\"18\" number<\"25\"").

arrayXMLNodes
Name of the array which should receive the for the XML node
descriptors.
Error Handling
The program execution will be canceled if the parent XML node or
document cannot be retrieved or is invalid, unless errors are handled
by BEGIN_CATCH_ERROR.
Note
The file name optionally includes the path and can also point to an
http or ftp connection. If no file extension is available, '.xml' is
assumed.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODES xmlDocument "/data/parameter/*" ""
arrayParameterChildNodes
§
XML_GET_SIBLING_NODES
Retrieves siblings of a XML node.
Syntax
XML_GET_SIBLING_NODES [options] node "sibling name" "attribute"
arrayXMLNodes<:out>
Arguments

options
The following options are supported:
SEARCH_FORWARD valueBOOL — search in forward direction. Default is
TRUE.

node
Existing XML node.

sibling name
Name of the sibling note. This can include path information according
the XPath convention. Any string expression is allowed.

attribute
Name and value of the attribute separated by the equal sign. (e.g.
"id=\"18\" or "i*=\"*\"). Leave it empty to disregard attribute
information. Multiple attributes have to be separated by spaces
(e.g. "id=\"18\" number<\"25\"").

arrayXMLNodes
Name of the array which should receive the for the XML node
descriptors.
Error Handling
The program execution will be canceled if the XML node cannot be
retrieved or is invalid, unless errors are handled by
BEGIN_CATCH_ERROR.
Note
The file name optionally includes the path and can also point to an
http or ftp connection. If no file extension is available, '.xml' is
assumed.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODES xmlDocument "/data/parameter" "" xmlNodeParameter
XML_GET_SIBLING_NODES xmlNodeParameter "parameter" ""
arrayNextSiblingParameters
§
XML_GET_NODE_VALUE
Gets the value of an existing node.
Syntax
XML_GET_NODE_VALUE node paramValue<:out>
Arguments

node
Existing XML node or document.

paramValue
Name of the parameter which will receive the value as string content.
Error Handling
The program execution will be canceled if the parent XML node or
document cannot be retrieved or is invalid, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODE "/data/parameter/name" "" nodeParameter
XML_GET_NODE_VALUE nodeParameter value
PRINT "%" value
§
XML_SET_NODE_VALUE
Sets the value of an existing node.
Syntax
XML_SET_NODE_VALUE node "value"
Arguments

node
Existing XML node or document.

value
String value for the node. Any string expression is allowed.
Error Handling
The program execution will be canceled if the XML node cannot be
retrieved or is invalid, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
XML_NEW_DOCUMENT xmlDocument

XML_ADD_NODE xmlDocument "data" nodeData

XML_ADD_NODE nodeData "mdl_name" nodeMdlName


XML_SET_NODE_VALUE nodeMdlName "0815"
XML_ADD_NODE_ATTRIBUTE nodeMdlName "type" "prt"

XML_ADD_NODE nodeData "mdl_name" nodeMdlName


XML_SET_NODE_VALUE nodeMdlName "4711"
XML_ADD_NODE_ATTRIBUTE nodeMdlName "type" "asm"

XML_FORMAT_DOCUMENT xmlDocument
XML_SAVE_DOCUMENT xmlDocument "output.xml"
§
XML_GET_NODE_TYPE
Gets the type of an existing node.
Syntax
XML_GET_NODE_TYPE node paramType<:out>
Arguments

node
Existing XML node or document.

paramType
Name of the parameter which will receive the type as string content.
See the available node types.
Error Handling
The program execution will be canceled if the parent XML node or
document cannot be retrieved or is invalid, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODE "/data/parameter/name" "" nodeParameter
XML_GET_NODE_TYPE nodeParameter type
PRINT "%" type
§
XML_GET_NODE_NAME
Gets the name of an existing node.
Syntax
XML_GET_NODE_NAME node paramName<:out>
Arguments

node
Existing XML node or document.

paramName
Name of the parameter which will receive the node name as string
content.
Error Handling
The program execution will be canceled if the parent XML node or
document cannot be retrieved or is invalid, unless errors are handled
by BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODE "/data/parameter/name" "" nodeParameter
XML_GET_NODE_NAME nodeParameter name
PRINT "%" name
§
XML_GET_NODE_ATTRIBUTE
Retrieves an attribute from an existing node.
Syntax
XML_GET_NODE_ATTRIBUTE node "name" XMLAttribute<:out>
Arguments

node
Existing XML node or document.

name
Name of the attribute. Any string expression is allowed.

XMLAttribute
Name of the variable for the XML attribute descriptor.
Error Handling
The program execution will be canceled if the XML node or document
cannot be retrieved or is invalid, or if the attribute cannot be
found, unless errors are handled by BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODE "/data/parameter" "" nodeParameter
XML_GET_NODE_ATTRIBUTE nodeParameter "id" attribute
PRINT "%" attribute
§
XML_ADD_NODE_ATTRIBUTE
Adds an attribute to an existing node.
Syntax
XML_ADD_NODE_ATTRIBUTE node "name" "value"
Arguments

node
Existing XML node or document.

name
Name of the attribute. Any string expression is allowed.

value
Value of the attribute. Any string expression is allowed.
Error Handling
The program execution will be canceled if the XML node cannot be
retrieved or is invalid, or if the attribute cannot be found, unless
errors are handled by BEGIN_CATCH_ERROR.
Example
XML_NEW_DOCUMENT xmlDocument

XML_ADD_NODE xmlDocument "data" nodeData

XML_ADD_NODE nodeData "mdl_name" nodeMdlName


XML_SET_NODE_VALUE nodeMdlName "0815"
XML_ADD_NODE_ATTRIBUTE nodeMdlName "type" "prt"

XML_ADD_NODE nodeData "mdl_name" nodeMdlName


XML_SET_NODE_VALUE nodeMdlName "4711"
XML_ADD_NODE_ATTRIBUTE nodeMdlName "type" "asm"

XML_FORMAT_DOCUMENT xmlDocument
XML_SAVE_DOCUMENT xmlDocument "output.xml"
§
XML_GET_NODE_ATTRIBUTES
Retrieves an array of attributes from an existing node.
Syntax
XML_GET_NODE_ATTRIBUTES node "name" arrayXMLAttributes<:out>
Arguments

node
Existing XML node or document.

name
Name of the attribute. Any string expression is allowed.

arrayXMLAttributes
Name of the variable for array which receives the XML attribute
descriptor.
Error Handling
The program execution will be canceled if the XML node or document
cannot be retrieved or is invalid, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODE "/data/parameter" "" nodeParameter
XML_GET_NODE_ATTRIBUTES nodeParameter "*" arrayAttributes
FOR attribute REF ARRAY arrayAttributes
PRINT "%" attribute
END_FOR
§
XML_GET_ATTRIBUTE_NAME
Gets the name of an existing attribute.
Syntax
XML_GET_ATTRIBUTE_NAME attribute paramName<:out>
Arguments

attribute
Existing XML attribute.

paramName
Name of the parameter which will receive the attribute name as string
content.
Error Handling
The program execution will be canceled if the XML attribute cannot be
retrieved or is invalid, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODE "/data/parameter" "" nodeParameter
XML_GET_NODE_ATTRIBUTES nodeParameter "*" arrayAttributes
FOR attribute REF ARRAY arrayAttributes
XML_GET_ATTRIBUTE_NAME attribute name
PRINT "%" name
END_FOR
§
XML_GET_ATTRIBUTE_VALUE
Gets the value of an existing node.
Syntax
XML_GET_ATTRIBUTE_VALUE attribute paramValue<:out>
Arguments

node
Existing XML attribute.

paramValue
Name of the parameter which will receive the attribute value as
string content.
Error Handling
The program execution will be canceled if the parent XML attribute
cannot be retrieved or is invalid, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_GET_NODE "/data/parameter" "" nodeParameter
XML_GET_NODE_ATTRIBUTES nodeParameter "*" arrayAttributes
FOR attribute REF ARRAY arrayAttributes
XML_GET_ATTRIBUTE_VALUE attribute value
PRINT "%" value
END_FOR
§
XML_COMPARE_NODES
Compares two XML nodes.
Syntax
XML_COMPARE_NODES [option] node1 node2 result<:out>
Arguments

option
The following options for comparing two nodes are available:

CASE_SENSITIVE argument BOOL — to determine if the comparison


should be case sensitive. Default is FALSE.

RECURSIVE argument BOOL — to determine if the comparison should


include child nodes. Default is TRUE.

INCLUDE_ATTRIBUTES argument BOOL — to determine if the comparison


should include attributes. Default is TRUE.

CONSIDER_ORDER argument BOOL — to determine if the comparison


should include the order of child nodes. Default is FALSE.

node1
Existing XML node.

node2
Existing XML node.

result
name of the boolean variable which receive the result.
Error Handling
The program execution will be canceled if the nodes cannot be
retrieved or are invalid, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
XML_LOAD_DOCUMENT "lib:sample1.xml" xmlDocument1
XML_LOAD_DOCUMENT "lib:sample2.xml" xmlDocument2
XML_GET_NODE xmlDocument1 "/" "" node1
XML_GET_NODE xmlDocument2 "/" "" node2
XML_COMPARE_NODES node1 node2 result
PRINT "%" result
§
XML_QUERY_VALUES
Queries values from a XML document or from a parent node.
Syntax
XML_QUERY_VALUES [options] node "node name" "attribute"
arrayValues<:out>
Arguments

options
The following options are supported:
RECURSIVE — to search recursively

node
Existing XML node or document.

node name
Name of the node. This can include path information according the
XPath convention. Any string expression is allowed.

attribute
Name and value of the attribute separated by the equal sign. (e.g.
"id=\"18\" or "i*=\"*\"). Leave it empty to disregard attribute
information.

arrayValues
Name of the array which should receive the queried values.
Error Handling
The program execution will be canceled if the parent XML node or
document cannot be retrieved or is invalid, unless errors are handled
by BEGIN_CATCH_ERROR.
Note
This command combines the XML_GET_NODES and the XML_GET_NODE_VALUE
command.
Example
XML_LOAD_DOCUMENT "lib:sample.xml" xmlDocument
XML_QUERY_VALUES "/data/parameter/*" "" arrayParameterValues

FOR value REF ARRAY arrayParameterValues


PRINT "%" value
END_FOR
§
About JSON Commands
The Java Script Object Notation (JSON) is an open-standard file
format for data interchange which is often used for network data
exchange by HTTP / REST. Similar like XML JSON allows to structure
data in human readable text format.
JSON data consists on the following data types:
string values
integer values
double values
boolean values
null values
objects
arrays

Simple object example


{
"mdlname" : "sample",
"mdltype": "prt",
"number": 4711
}
Objects are surrounded by curly brackets { } and contain key/value
pairs. While the keys are always strings, the value can consist on
all JSON data types. Keys and values are separated by a colon. Each
key/value pair is separated by a comma.

Simple array example


{
"children" : [
"sample1",
"sample2",
4711
]
}
Arrays are surrounded by square brackets [ ] and contain members all
valid data types. The members are separated by a comma.

Pointer notation
To specify the location of a value in an JSON document the pointer
notation is used. This specifies the location by a path.
The path for the JSON document is an empty string "". Object
members are specified by their name. Array elements are specified by
their index. Elements of the paths are separated by a slash / .
Therefor the path /children/2 points to the value 4711 of
the array example.
Comparison example for JSON vs XML
Below is a example how to structure the following BOM data in JSON or
in XML.

Example JSON
The following JSON example shows a simple BOM structure
{
"mdlname": "main",
"mdltype": "asm",
"components": [
{
"mdlname": "sub1",
"mdltype": "asm",
"components": [
{
"mdlname": "sample1",
"mdltype": "prt",
"components" : []
},
{
"mdlname": "sample2",
"mdltype": "prt",
"components" : []
}
]
},
{
"mdlname": "sample3",
"mdltype": "prt",
"components" : []
}
]
}
The pointer notation for the name of model sample2.prt is
/components/components/1/mdlname.

Example XML
The similar example in XML.
<?xml version="1.0" encoding="utf-8"?>
<component>
<mdlname>main</mdlname>
<mdltype>asm</mdltype>
<components>
<component>
<mdlname>sub1</mdlname>
<mdltype>asm</mdltype>
<components>
<component>
<mdlname>sample1</mdlname>
<mdltype>prt</mdltype>
<components/>
</component>
<component>
<mdlname>sample2</mdlname>
<mdltype>prt</mdltype>
<components/>
</component>
</components>
</component>
<component>
<mdlname>sample3</mdlname>
<mdltype>prt</mdltype>
<components/>
</component>
</components>
</component>
Commands
For using JSON commands the external data license option is required.
The following commands are available:
JSON_LOAD_DOCUMENT — to load a JSON document from file.
JSON_INIT_DOCUMENT — to initialize a JSON document from string.
JSON_DOCUMENT_TO_STRING — to convert an existing JSON document to
string.
JSON_NEW_DOCUMENT — to create a new empty JSON document.
JSON_SAVE_DOCUMENT — to save a JSON document to disk.
JSON_SET_OBJECT — to create an object in a JSON document by
specifying its path.
JSON_SET_ARRAY — to create an array in a JSON document by
specifying its path.
JSON_SET_VALUE — to create a value in a JSON document by specifying
its path and value.
JSON_SET_NULL — to create a null value in a JSON document by
specifying its path.
JSON_GET_TYPE — to retrieve the type of a JSON value.
JSON_GET_VALUE — to read a value form a JSON document by specifying
its path.
JSON_GET_OBJECT_MEMBERS — to retrieve the paths of all members of a
JSON object.
JSON_GET_ARRAY_ELEMS — to retrieve the paths of all elements of a
JSON array.
JSON_GET_ARRAY_SIZE — to retrieve the size of a JSON array.
JSON_GET_NEXT_ARRAY_ELEM — to retrieve a path to create the next
JSON array member.
JSON_COMPOSE_PATH — to compose the path based on the root path and
an additional path.
§
JSON_LOAD_DOCUMENT
Loads a JSON document from file.
Syntax
JSON_LOAD_DOCUMENT "file_name" JSONDocument<:out>
Arguments

file name
The file and path of the document Any string expression is allowed.

JSONDocument
Name of the variable for the JSON document descriptor.
Error Handling
The program execution will be canceled if the JSON document cannot be
retrieved, unless errors are handled by BEGIN_CATCH_ERROR.
Note
The file name optionally includes the path. If no file extension is
available, '.json' is assumed.
Example
JSON_LOAD_DOCUMENT "lib:bom.json" JSONDocument
JSON_DOCUMENT_TO_STRING JSONDocument JSONString
PRINT "%" JSONString
§
JSON_INIT_DOCUMENT
Initializes a JSON document from string.
Syntax
JSON_INIT_DOCUMENT "jsonString" JSONDocument<:out>
Arguments

jsonString
String which contains a complete JSON document. Any string expression
is allowed.

JSONDocument
Name of the variable for the JSON document descriptor.
Error Handling
The program execution will be canceled if the string does not contain
a valid JSON document, unless errors are handled by
BEGIN_CATCH_ERROR.
Example
WEBSERVCICE_CALL network_connection "GET"
"https://jsonplaceholder.typicode.com/post/1" http_header "" data_out
JSON_INIT_DOCUMENT data_out JSONDocument
JSON_SAVE_DOCUMENT JSONDocument "post1.json"
§
JSON_DOCUMENT_TO_STRING
Converts an existing JSON document to a string.
Syntax
JSON_DOCUMENT_TO_STRING JSONDocument<:in> JSONString<:out>
Arguments

JSONDocument
Existing JSON document descriptor.

jsonString
Name of the string variable which receives the content of the JSON
document.
Error Handling
The program execution will be canceled if the JSON document is not
found or not valid, unless errors are handled by BEGIN_CATCH_ERROR.
Example
JSON_LOAD_DOCUMENT "lib:bom.json" JSONDocument
JSON_DOCUMENT_TO_STRING JSONDocument JSONString
PRINT "%" JSONString
§
JSON_NEW_DOCUMENT
Creates a new empty JSON document.
Syntax
JSON_NEW_DOCUMENT JSONDocument<:out>
Arguments

JSONDocument
Name of the variable for the JSON document descriptor.
Example
!'Build the JSON document for the introduction example on the fly

JSON_NEW_DOCUMENT JSONDocument

! main.asm
JSON_SET_VALUE JSONDocument "/mdlname" "main"
JSON_SET_VALUE JSONDocument "/mdltype" "asm"
JSON_SET_ARRAY JSONDocument "/components"

! main.asm > sub1.asm


JSON_GET_NEXT_ARRAY_ELEM JSONDocument "/components" next_elem_level1
JSON_COMPOSE_PATH next_elem_level1 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sub1"
JSON_COMPOSE_PATH next_elem_level1 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "asm"
JSON_COMPOSE_PATH next_elem_level1 "components"
next_components_level1
JSON_SET_ARRAY JSONDocument next_components_level1

! sub1.asm > sample1.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument next_components_level1
next_elem_level2
JSON_COMPOSE_PATH next_elem_level2 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample1"
JSON_COMPOSE_PATH next_elem_level2 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_COMPOSE_PATH next_elem_level2 "components"
next_components_level2
JSON_SET_ARRAY JSONDocument next_components_level2

! sub1.asm > sample2.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument next_components_level1
next_elem_level2
JSON_COMPOSE_PATH next_elem_level2 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample2"
JSON_COMPOSE_PATH next_elem_level2 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_COMPOSE_PATH next_elem_level2 "components"
next_components_level2
JSON_SET_ARRAY JSONDocument next_components_level2

! main.asm > sample3.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument "/components" next_elem_level1
JSON_COMPOSE_PATH next_elem_level1 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample3"
JSON_COMPOSE_PATH next_elem_level1 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_DOCUMENT_TO_STRING JSONDocument JSONString
§
JSON_SAVE_DOCUMENT
Saves a JSON document to disk.
Syntax
JSON_SAVE_DOCUMENT JSONDocument<:in> "file name"
Arguments

JSONDocument
Existing JSON document descriptor.

file name
The file and path of the document Any string expression is allowed.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or the document can not be saved, unless
errors are handled by BEGIN_CATCH_ERROR.
Note
The file name optionally includes the path. If no file extension is
available, '.json' is assumed.
Example
WEBSERVCICE_CALL network_connection "GET"
"https://jsonplaceholder.typicode.com/post/1" http_header "" data_out
JSON_INIT_DOCUMENT data_out JSONDocument
JSON_SAVE_DOCUMENT JSONDocument "post1.json"
§
JSON_SET_OBJECT
Creates an object in a JSON document by specifying its path.
Syntax
JSON_SET_OBJECT JSONDocument "path"
Arguments

JSONDocument
Existing JSON document descriptor.

path
Path at which the object should be created. Any string expression is
allowed.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or the object could not be created at this
path, unless errors are handled by BEGIN_CATCH_ERROR.
Example
JSON_NEW_DOCUMENT JSONDocument

JSON_SET_OBJECT JSONDocument "/obj1"


JSON_SET_OBJECT JSONDocument "/obj1/obj2"
JSON_SET_VALUE JSONDocument "/obj1/obj2/firstname" "John"
JSON_SET_VALUE JSONDocument "/obj1/obj2/familyname" "Doe"
JSON_SET_NULL JSONDocument "/obj1/obj2/age"

JSON_DOCUMENT_TO_STRING JSONDocument JSONString


PRINT "%" JSONString
§
JSON_SET_ARRAY
Creates an array in a JSON document by specifying its path.
Syntax
JSON_SET_ARRAY JSONDocument "path"
Arguments

JSONDocument
Existing JSON document descriptor.

path
Path at which the array should be created. Any string expression is
allowed.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or the array could not be created at this
path, unless errors are handled by BEGIN_CATCH_ERROR.
Example
!'Build the JSON document for the introduction example on the fly

JSON_NEW_DOCUMENT JSONDocument

! main.asm
JSON_SET_VALUE JSONDocument "/mdlname" "main"
JSON_SET_VALUE JSONDocument "/mdltype" "asm"
JSON_SET_ARRAY JSONDocument "/components"

! main.asm > sub1.asm


JSON_GET_NEXT_ARRAY_ELEM JSONDocument "/components" next_elem_level1
JSON_COMPOSE_PATH next_elem_level1 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sub1"
JSON_COMPOSE_PATH next_elem_level1 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "asm"
JSON_COMPOSE_PATH next_elem_level1 "components"
next_components_level1
JSON_SET_ARRAY JSONDocument next_components_level1

! sub1.asm > sample1.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument next_components_level1
next_elem_level2
JSON_COMPOSE_PATH next_elem_level2 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample1"
JSON_COMPOSE_PATH next_elem_level2 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_COMPOSE_PATH next_elem_level2 "components"
next_components_level2
JSON_SET_ARRAY JSONDocument next_components_level2

! sub1.asm > sample2.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument next_components_level1
next_elem_level2
JSON_COMPOSE_PATH next_elem_level2 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample2"
JSON_COMPOSE_PATH next_elem_level2 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_COMPOSE_PATH next_elem_level2 "components"
next_components_level2
JSON_SET_ARRAY JSONDocument next_components_level2

! main.asm > sample3.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument "/components" next_elem_level1
JSON_COMPOSE_PATH next_elem_level1 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample3"
JSON_COMPOSE_PATH next_elem_level1 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_DOCUMENT_TO_STRING JSONDocument JSONString
§
JSON_SET_VALUE
Creates a value in a JSON document by specifying its path and value.
Syntax
JSON_SET_VALUE JSONDocument "path" value<:in>
Arguments

JSONDocument
Existing JSON document descriptor.

path
Path at which the value should be created. Any string expression is
allowed.

value
Value of type STRING, INTEGER, DOUBLE or BOOL. Any math expression or
string expression is allowed.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or the value could not be created at this
path, unless errors are handled by BEGIN_CATCH_ERROR.
Example
!'Build the JSON document for the introduction example on the fly

JSON_NEW_DOCUMENT JSONDocument

! main.asm
JSON_SET_VALUE JSONDocument "/mdlname" "main"
JSON_SET_VALUE JSONDocument "/mdltype" "asm"
JSON_SET_ARRAY JSONDocument "/components"

! main.asm > sub1.asm


JSON_GET_NEXT_ARRAY_ELEM JSONDocument "/components" next_elem_level1
JSON_COMPOSE_PATH next_elem_level1 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sub1"
JSON_COMPOSE_PATH next_elem_level1 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "asm"
JSON_COMPOSE_PATH next_elem_level1 "components"
next_components_level1
JSON_SET_ARRAY JSONDocument next_components_level1

! sub1.asm > sample1.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument next_components_level1
next_elem_level2
JSON_COMPOSE_PATH next_elem_level2 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample1"
JSON_COMPOSE_PATH next_elem_level2 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_COMPOSE_PATH next_elem_level2 "components"
next_components_level2
JSON_SET_ARRAY JSONDocument next_components_level2

! sub1.asm > sample2.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument next_components_level1
next_elem_level2
JSON_COMPOSE_PATH next_elem_level2 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample2"
JSON_COMPOSE_PATH next_elem_level2 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_COMPOSE_PATH next_elem_level2 "components"
next_components_level2
JSON_SET_ARRAY JSONDocument next_components_level2

! main.asm > sample3.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument "/components" next_elem_level1
JSON_COMPOSE_PATH next_elem_level1 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample3"
JSON_COMPOSE_PATH next_elem_level1 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_DOCUMENT_TO_STRING JSONDocument JSONString
§
JSON_SET_NULL
Creates a null value in a JSON document by specifying its path.
Syntax
JSON_SET_NULL JSONDocument "path"
Arguments

JSONDocument
Existing JSON document descriptor.

path
Path at which the null value should be created. Any string expression
is allowed.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or the null value could not be created at
this path, unless errors are handled by BEGIN_CATCH_ERROR.
Example
JSON_NEW_DOCUMENT JSONDocument

JSON_SET_OBJECT JSONDocument "/obj1"


JSON_SET_OBJECT JSONDocument "/obj1/obj2"
JSON_SET_VALUE JSONDocument "/obj1/obj2/firstname" "John"
JSON_SET_VALUE JSONDocument "/obj1/obj2/familyname" "Doe"
JSON_SET_NULL JSONDocument "/obj1/obj2/age"

JSON_DOCUMENT_TO_STRING JSONDocument JSONString


PRINT "%" JSONString
§
JSON_GET_TYPE
Retrieves the type of a JSON value.
Syntax
JSON_GET_TYPE JSONDocument "path" type<:out>
Arguments

JSONDocument
Existing JSON document descriptor.

path
Path to the value in the JSON document in pointer notation. Any
string expression is allowed.

type
String variable which receives the types of the JSON value.
The following types are available:
STRING — for a string value.
INTEGER — for an integer value.
DOUBLE — for a double value.
BOOL — for a boolean value.
NULL — for an empty value.
ARRAY — for an array. This is encapsulated by [ ... ] in the JSON
syntax.
OBJECT — for an object. This is encapsulated by { ... } in the JSON
syntax.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or the path does not exist, unless errors
are handled by BEGIN_CATCH_ERROR.
Example
JSON_LOAD_DOCUMENT "lib:bom.json" JSONDocument
JSON_GET_OBJECT_MEMBERS JSONDocument "/components/0" members

FOR member REF ARRAY members


JSON_GET_TYPE JSONDocument member type
JSON_GET_VALUE JSONDocument member value
PRINT "Path: % Type: % Value: %" member type value
END_FOR
§
JSON_GET_VALUE
Reads a value from a JSON document by specifying its path.
Syntax
JSON_GET_VALUE JSONDocument "path" value<:out>
Arguments

JSONDocument
Existing JSON document descriptor.

path
Path at which the value should be created. Any string expression is
allowed.

value
Variable which receives the value as STRING, INTEGER, DOUBLE or BOOL.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or the value could not be retrieves from
this path, unless errors are handled by BEGIN_CATCH_ERROR.
Example
JSON_LOAD_DOCUMENT "lib:bom.json" JSONDocument
JSON_GET_OBJECT_MEMBERS JSONDocument "/components/0" members

FOR member REF ARRAY members


JSON_GET_TYPE JSONDocument member type
JSON_GET_VALUE JSONDocument member value
PRINT "Path: % Type: % Value: %" member type value
END_FOR
§
JSON_GET_OBJECT_MEMBERS
Retrieves the paths of all JSON object members in an array.
Syntax
JSON_GET_OBJECT_MEMBERS JSONDocument "path" array<:out>
Arguments

JSONDocument
Existing JSON document descriptor.

path
Path at which the value should be created. Any string expression is
allowed.

array
Array variable which receives the paths of all object members.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or there is no object at the path
position, unless errors are handled by BEGIN_CATCH_ERROR.
Example
JSON_LOAD_DOCUMENT "lib:bom.json" JSONDocument
JSON_GET_OBJECT_MEMBERS JSONDocument "/components/0" members

FOR member REF ARRAY members


JSON_GET_TYPE JSONDocument member type
JSON_GET_VALUE JSONDocument member value
PRINT "Path: % Type: % Value: %" member type value
END_FOR
§
JSON_GET_ARRAY_ELEMS
Retrieves the paths of all JSON array elements in an array.
Syntax
JSON_GET_ARRAY_ELEMS JSONDocument "path" array<:out>
Arguments

JSONDocument
Existing JSON document descriptor.

path
Path at which the value should be created. Any string expression is
allowed.

array
Array variable which receives the paths of all array elements.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or there is no array at the path position,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
JSON_LOAD_DOCUMENT "lib:bom.json" JSONDocument
JSON_GET_ARRAY_ELEMS JSONDocument "/components" elements

FOR element REF ARRAY elements


JSON_GET_TYPE JSONDocument element type
PRINT "path: % Type: %" element type
END_FOR
§
JSON_GET_ARRAY_SIZE
Retrieves the number of all JSON array elements.
Syntax
JSON_GET_ARRAY_SIZE JSONDocument "path" size<:out>
Arguments

JSONDocument
Existing JSON document descriptor.

path
Path at which the value should be created. Any string expression is
allowed.

size
Variable which receives the number of all array elements.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or there is no array at the path position,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
JSON_LOAD_DOCUMENT "lib:bom.json" JSONDocument
JSON_GET_ARRAY_SIZE JSONDocument "/components" size

PRINT "% elements" size


§
JSON_GET_NEXT_ARRAY_ELEM
Retrieves path to create the next JSON array element.
Syntax
JSON_GET_NEXT_ARRAY_ELEM JSONDocument "path" path_element<:out>
Arguments

JSONDocument
Existing JSON document descriptor.

path
Path at which the value should be created. Any string expression is
allowed.

path_element
Variable which receives the path for the next array element.
Error Handling
The program execution will be canceled if the JSON document
descriptor is not existing or there is no array at the path position,
unless errors are handled by BEGIN_CATCH_ERROR.
Example
!'Build the JSON document for the introduction example on the fly

JSON_NEW_DOCUMENT JSONDocument

! main.asm
JSON_SET_VALUE JSONDocument "/mdlname" "main"
JSON_SET_VALUE JSONDocument "/mdltype" "asm"
JSON_SET_ARRAY JSONDocument "/components"

! main.asm > sub1.asm


JSON_GET_NEXT_ARRAY_ELEM JSONDocument "/components" next_elem_level1
JSON_COMPOSE_PATH next_elem_level1 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sub1"
JSON_COMPOSE_PATH next_elem_level1 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "asm"
JSON_COMPOSE_PATH next_elem_level1 "components"
next_components_level1
JSON_SET_ARRAY JSONDocument next_components_level1

! sub1.asm > sample1.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument next_components_level1
next_elem_level2
JSON_COMPOSE_PATH next_elem_level2 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample1"
JSON_COMPOSE_PATH next_elem_level2 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_COMPOSE_PATH next_elem_level2 "components"
next_components_level2
JSON_SET_ARRAY JSONDocument next_components_level2

! sub1.asm > sample2.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument next_components_level1
next_elem_level2
JSON_COMPOSE_PATH next_elem_level2 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample2"
JSON_COMPOSE_PATH next_elem_level2 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_COMPOSE_PATH next_elem_level2 "components"
next_components_level2
JSON_SET_ARRAY JSONDocument next_components_level2

! main.asm > sample3.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument "/components" next_elem_level1
JSON_COMPOSE_PATH next_elem_level1 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample3"
JSON_COMPOSE_PATH next_elem_level1 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_DOCUMENT_TO_STRING JSONDocument JSONString
§
JSON_COMPOSE_PATH
Composes the path based on the root path and an additional path.
Syntax
JSON_GET_NEXT_ARRAY_ELEM "path_root" "path_add" path<:out>
Arguments

path_root
Root path which should be used to compose the path. Any string
expression is allowed.

path_add
Addition to the root path to specify the complete path. Any string
expression is allowed.

path
Variable which receives the complete path.
Example
!'Build the JSON document for the introduction example on the fly

JSON_NEW_DOCUMENT JSONDocument

! main.asm
JSON_SET_VALUE JSONDocument "/mdlname" "main"
JSON_SET_VALUE JSONDocument "/mdltype" "asm"
JSON_SET_ARRAY JSONDocument "/components"

! main.asm > sub1.asm


JSON_GET_NEXT_ARRAY_ELEM JSONDocument "/components" next_elem_level1
JSON_COMPOSE_PATH next_elem_level1 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sub1"
JSON_COMPOSE_PATH next_elem_level1 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "asm"
JSON_COMPOSE_PATH next_elem_level1 "components"
next_components_level1
JSON_SET_ARRAY JSONDocument next_components_level1

! sub1.asm > sample1.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument next_components_level1
next_elem_level2
JSON_COMPOSE_PATH next_elem_level2 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample1"
JSON_COMPOSE_PATH next_elem_level2 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_COMPOSE_PATH next_elem_level2 "components"
next_components_level2
JSON_SET_ARRAY JSONDocument next_components_level2

! sub1.asm > sample2.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument next_components_level1
next_elem_level2
JSON_COMPOSE_PATH next_elem_level2 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample2"
JSON_COMPOSE_PATH next_elem_level2 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_COMPOSE_PATH next_elem_level2 "components"
next_components_level2
JSON_SET_ARRAY JSONDocument next_components_level2

! main.asm > sample3.prt


JSON_GET_NEXT_ARRAY_ELEM JSONDocument "/components" next_elem_level1
JSON_COMPOSE_PATH next_elem_level1 "mdlname" next_mdlname
JSON_SET_VALUE JSONDocument next_mdlname "sample3"
JSON_COMPOSE_PATH next_elem_level1 "mdltype" next_mdltype
JSON_SET_VALUE JSONDocument next_mdltype "prt"
JSON_DOCUMENT_TO_STRING JSONDocument JSONString
§
About Web Service Commands
There are different approaches for web services available like the
Simple Object Access Protocol (SOAP) architecture. In recent times
the Representational state transfer (REST) and in particular the
RESTful HTTP (REST based on HTTP) became very popular and available
for many system with a network API. Therefor the term web service
will be used as a synonym for the RESTful HTTP approach.
RESTful
The term REST in RESTful HTTP relates to the architecture properties:
Uniform identification of resources.
Statelessness.
"Uniform identifications" means that the name of a resource is build
up by a fixed scheme and "statelessness" indicates that there is no
precondition of previous operations.
HTTP
The HTTP protocol consists of sending a request message and receiving
a response message. Both messages include an URI, header information
and the information body.
The URI is build up by the following syntax:
<protocol>://<host>:<port>/<path>?<query>
With the parts:
protocol — which is either http or https.
host — host information where there the server is located (e.g.
www.buw-soft.de or localhost).
port — this information is optional. By default http is using port
80 and https is using port 443.
query — query parameter to restrict the search.

Examples:
https://example.com/employees/?
name=Doe&city=Boston;start=0;count=20
http://localhost:8000
Commands
For using web service commands the external data license option is
required.
The following commands are available:
WEBSERVICE_CALL — to send a web service request by the REST
architecture.
§
WEBSERVICE_CALL
Sends are web service request by the RESTful architecture style.
Syntax
WEBSERVICE_CALL network_connection<:in> "request_method" "uri"
http_header<:inout> "data_in" data_out<:out>
Arguments

network_connection
Structure variable of type NETWORK_CONNECTION which contains the
setup for the connection.

request_method
HTTP Request method for the REST call. Available types are:
GET — to retrieve data.
HEAD — to retrieve just the response header information.
POST — to send new data to the server.
PUT — to update existing data on the server.
DELETE — to delete data from the server.

uri
URI of the resource. For example:
https://jsonplaceholder.typicode.com/posts/1.

http_header
Structure variable of type HTTP_HEADER to define the request header
of the web service call and to receive the response header.

data_in
Data which should be send by the web service call. For the request
methods GET, HEAD and DELETE no data will be send.

data_out
Data which is received by the web service call. The data is always
encoded as string. The field response.content_type of HTTP_HEADER,
shows the type of the data. This could be for example JSON or XML
data.
Error handling
The program execution will be canceled if the web service fails,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
Binary data is encoded as a base64 string. This can be read or
written to file by BINARY_FILE_READ and BINARY_FILE_WRITE.
Example
! basic authentication method
DECLARE_STRUCT NETWORK_CONNECTION network_connection
DECLARE_STRUCT HTTP_HEADER http_header
http_header.request.login = "guest"
http_header.request.password = "guest"
WEBSERVICE_CALL network_connection "GET"
"https://jigsaw.w3.org/HTTP/Basic/" http_header "" dataOut
PRINT "response: %: %" http_header.response.response_code
http_header.response.response_phrase

! read information
WEBSERVICE_CALL network_connection "GET"
"https://jsonplaceholder.typicode.com/posts/1" http_header ""
data_out
PRINT "Result: %" data_out

! add information
JSON_LOAD_DOCUMENT "lib:test1.json" JSONDocument
JSON_DOCUMENT_TO_STRING JSONDocument data_in
WEBSERVICE_CALL network_connection "POST"
"https://jsonplaceholder.typicode.com/posts" http_header data_in
data_out
PRINT "Result: %" data_out

! modify information
JSON_DOCUMENT_TO_STRING JSONDocument data_in
WEBSERVICE_CALL network_connection "PUT"
"https://jsonplaceholder.typicode.com/posts/1" http_header data_in
data_out
PRINT "Result: %" data_out
! delete information
WEBSERVICE_CALL network_connection "DELETE"
"https://jsonplaceholder.typicode.com/posts/1" http_header ""
data_out
PRINT "Result: %" data_out
§
About Windchill Info*Engine Commands
For accessing the Windchill Info*Engine the external data license
option is required. Also it is the responsibility of the user to make
sure the proper PTC licenses are available which allow to use the
Windchill Info*Engine.
The following commands are available:
INFO_ENGINE_AUTHENTICATE — to authenticate a Windchill domain with
login and password via the password database.
INFO_ENGINE_QUERY — to query data from the Windchill Info*Engine.
§
INFO_ENGINE_AUTHENTICATE
Authenticates a Windchill domain with user and password information
via the password database. This authentication is valid for the
complete SmartAssembly session.
Syntax
INFO_ENGINE_AUTHENTICATE "windchill_url" "login" "password"
Arguments

windchill_url
URL to the Windchill domain. Any string expression is allowed.

login
Login which will be used for the authentication. Any string
expression is allowed.

password
Password which will be used for the authentication. Any string
expression is allowed.
Example
GET_AUTHENTICATION windchill_info_engine login pasword
INFO_ENGINE_AUTHENTICATE "http://buwnotevirtual2.buw-
soft.de/Windchill" login password
§
INFO_ENGINE_QUERY
To query data from a Windchill Info*Engine URL by passing information
via the query URL.
Syntax
INFO_ENGINE_QUERY [options] "windchill_query_url" result<:out>
Arguments

options
The following options are available:
VERBOSE — logs information in the trail file.
ERROR_MESSAGE variable — optional output variable for the error
message.

windchill_query_url
URL to query the desired information from Windchill domain. Any
string expression is allowed.

result
Name of the string variable which receives the queried information.
Example
GET_AUTHENTICATION windchill_info_engine login pasword
INFO_ENGINE_AUTHENTICATE "http://buwnotevirtual2.buw-
soft.de/Windchill" login password
INFO_ENGINE_QUERY "http://buwnotevirtual2.buw-
soft.de/Windchill/servlet/IE/tasks/com/buw/GetInformation.xml?
productName=sample" result

XML_INIT_DOCUMENT result xmlResult


XML_GET_NODE xmlResult "//information" "" xmlNodeInformation
XML_GET_NODE_VALUE xmlNodeInformation information
PRINT "%" information
§
About Commands for the SmartDesignServer
Commands which are only available for the SmartDesignServer.
GET_DESIGN_SERVER_VARIABLE — to retrieve a variable from the
SmartDesignServer job.
SEARCH_DESIGN_SERVER_VARIABLE_NAMES — to search for variable names
from the SmartDesignServer job.
GET_DESIGN_SERVER_INFO — to retrieve information about the
SmartDesignServer job.
§
GET_DESIGN_SERVER_VARIABLE
Retrieves a variable provided by the SmartDesignServer for the
current job.
Syntax
GET_DESIGN_SERVER_VARIABLE "varname" parameter<:out>
Arguments

varname
Name of the SmartDesignServer variable. Any string expression is
allowed.

parameter
Name for the parameter which should receive the content.
Example
GET_DESIGN_SERVER_VARIABLE "variable" paramVar1
§
SEARCH_DESIGN_SERVER_VARIABLE_NAMES
Searches for variable names from the SmartDesignServer job by a
search string.
Syntax
SEARCH_DESIGN_SERVER_VARIABLE_NAMES "search_string"
arrayVariableNames<:out>
Arguments

search_string
Name of the variables to search for. Any string expression is
allowed. Wildcards can be used for the search.

arrayVariableNames
Name of the array which receives the variable names
Example
SEARCH_DESIGN_SERVER_VARIABLE_NAMES "*" arrayVariableNames
FOR varName REF ARRAY arrayVariableNames
GET_DESIGN_SERVER_VARIABLE varName varValue
PRINT "% %" varName varValue
END_FOR
§
GET_DESIGN_SERVER_INFO
Retrieves information about the SmartDesignServer job.
Syntax
GET_DESIGN_SERVER_INFO "name" parameter<:out>
Arguments

name
Name of the SmartDesignServer information. Any string expression is
allowed.

parameter
Name for the parameter which should receive the content.
Note
Currently the following information is available:
version — Version flag for theXML scheme.
sender/name — Name of the sender who issued the job.
sender/familyname — Family name of the sender who issued the job.
sender/mailaddr — Mail address of the sender how issued the job.
job — Job number.
program — Job program.
Example
GET_DESIGN_SERVER_INFO "sender/name" paramName
GET_DESIGN_SERVER_INFO "sender/familyname" paramFamilyName
PRINT "Job issued by % %" paramName paramFamilyname
About the Graphical User Interface Block
The graphical user interface block is surrounded by the
BEGIN_GUI_DESCR and END_GUI_DESCR keywords. The commands are executed
in a loop. Each time the user enters a value, uses a selection button
or selects a table entry, all the commands are executed again. This
provides the functionality to evaluate searched values or conditional
elements according to user input.
The graphical user interface block offers commands to the following
topics.
User input — commands for requesting information from the user.
Searching — commands for searching references, parameters and
dimension values.
Models — commands for assembling, regenerating, removing and
modifying models.
Measurement — commands for measurement similar to the analysis
functionality in Creo Elements/Pro.
Retrieving information from Creo Elements/Pro — commands for
retrieving different types of information like names, types,
dependencies.
Write information to Creo Elements/Pro — commands for writing
information to Creo Elements/Pro models, features, and dimensions.
Data Handling — commands for data handling via program variables.
Arrays — commands for declaration and reading from arrays.
Output — commands for showing information for the user.
Graphics and Display — commands for modifying graphics and display
mode of a model.
Control structures — commands for applying conditional elements of
a program, launching the graphical user interface, debug support
and error handling.
Pro/PIPING — commands to read information from Pro/PIPING models.
Identifiers — commands to identify components and UDFs created by
the same program.
Interfaces — commands to interact with other programs.
Note
Parameter variables which have the same name as a Creo Elements/Pro
parameter or dimension will update the model before after the OK
button of the dialog was pressed.
About Commands for User Input
Commands for user input consist of selection buttons, entry boxes,
check boxes for yes / no information and radio buttons for selecting
one option out of a set.
The following commands are available:
USER_SELECT — to select a reference in Creo Elements/Pro and
storing the information to a variable of type reference.
USER_SELECT_OPTIONAL — to let the user decide if the selection is
required or not.
USER_SELECT_MULTIPLE — to select multiple of reference in Creo
Elements/Pro and storing the information to an array of references.
USER_SELECT_MULTIPLE_OPTIONAL — to let the user decide if the
multiple selection is required or not.
USER_INPUT_PARAM — to request a number or string input from the
user and storing the information to a variable of type parameter.
CHECKBOX_PARAM — to choose a yes / no information.
RADIOBUTTON_PARAM — to choose one option from a set of many
options.
USER_LIST_BOX — to show a list box in the graphical user interface.
USER_DROP_DOWN — to show a drop down box in the graphical user
interface.
USER_TEXT_BOX — to show a text box in the graphical user interface.
Note
For USER_SELECT commands and USER_INPUT_PARAM commands with flag
REQUIRED an input must be supplied, otherwise the OK button will be
disabled. If these commands are inside an non active IF block, they
are not considered.
USER_SELECT
Prompts the user to select a reference in the Creo Elements/Pro
model.
Syntax
USER_SELECT &type reference<:out> [options] ['tag']
Description

type
The specified reference type. In case different types are allowed,
these should be concatenated by a pipe symbol '|'. String variables
introduces by the ampersand symbol & can also be used. See also the
information about parameter related reference types.

reference
Name of the reference which should receive the information.

options
DISPLAY_ORDER value — sort order in the dialog.
ALLOW_RESELECT — to re-select existing references in the redefine
mode.
FILTER_MDL refMdl<:in> | arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_FEAT reffeat<:in> | arrayFeats<:in> — to restrict the
selection to the specified features
FILTER_GEOM ref<:in> | arrayRefs<:in> — to restrict the selection
to items which are related to the specified geometry.
FILTER_REF ref<:in> | arrayRefs<:in> — to restrict the selection to
specified items.
FILTER_IDENTIFIER "identifier" — to restrict the selection to items
with a component engine identifier. Use "*" to accept all
identifiers.
SELECT_BY_BOX — to allow selecting by boxes. This is limited to
geometrical items and does not work on drawings.
SELECT_BY_MENU — to allow selecting by menu.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the selection box in the image


at the given location.
tag
Optional tag, shown in graphical user interface.
Note
Use a pipe '|' symbol to concatenate different selection types. The
following types can currently not be connected, since they require a
special handling:
PART
ASSEMBLY
INTENT_EDGE
INTENT_SURFACE
Example
USER_SELECT POINT placement_point 1
USER_SELECT AXIS | PLANE placement_orientation 2
USER_SELECT_OPTIONAL
Prompts the user to select a reference in the Creo Elements/Pro
model. The selection could be skipped.
Syntax:
USER_SELECT_OPTIONAL &type reference<:out> [options] ['tag']
Description

type
The specified reference type. In case different types are allowed,
these should be concatenated by a pipe symbol '|'. String variables
introduces by the ampersand symbol & can also be used. See also the
information about parameter related reference types.

reference
Name of the reference which should receive the information.

options
DISPLAY_ORDER value — sort order in the dialog.
ALLOW_RESELECT — to re-select existing references in the redefine
mode.
FILTER_MDL refMdl<:in> | arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_FEAT reffeat<:in> | arrayFeats<:in> — to restrict the
selection to the specified features
FILTER_GEOM ref<:in> | arrayRefs<:in> — to restrict the selection
to items which are related to the specified geometry.
FILTER_REF ref<:in> | arrayRefs<:in> — to restrict the selection to
specified items.
FILTER_IDENTIFIER "identifier" — to restrict the selection to items
with a component engine identifier. Use "*" to accept all
identifiers.
SELECT_BY_BOX — to allow selecting by boxes. This is limited to
geometrical items and does not work on drawings.
SELECT_BY_MENU — to allow selecting by menu.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the selection box in the image


at the given location.
tag
Optional tag, shown in graphical user interface.
Note
Use a pipe '|' symbol to concatenate different selection types. The
following types can currently not be connected, since they require a
special handling:
PART
ASSEMBLY
INTENT_EDGE
INTENT_SURFACE
Example
USER_SELECT_OPTIONAL POINT placement_point 1
USER_SELECT_OPTIONAL AXIS | PLANE placement_orientation 2
§
USER_SELECT_MULTIPLE
Prompts the user to select an array of reference in the Creo
Elements/Pro model.
Syntax
USER_SELECT_MULTIPLE &type max_selINT array<:out> [options] ['tag']
Description

type
The specified reference type. In case different types are allowed,
these should be concatenated by a pipe symbol '|'. String variables
introduces by the ampersand symbol & can also be used. See also the
information about parameter related reference types.

max_sel
Maximum number of references to select. A negative number means an
arbitrary number of references can be selected.

array
Name of the array which should receive the references.

options
DISPLAY_ORDER value — sort order in the dialog.
ALLOW_RESELECT — to re-select existing references in the redefine
mode.
FILTER_MDL refMdl<:in>| arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_FEAT reffeat<:in> | arrayFeats<:in> — to restrict the
selection to the specified features
FILTER_GEOM ref<:in> | arrayRefs<:in> — to restrict the selection
to items which are related to the specified geometry.
FILTER_REF ref<:in> | arrayRefs<:in> — to restrict the selection to
specified items.
FILTER_IDENTIFIER "identifier" — to restrict the selection to items
with a component engine identifier. Use "*" to accept all
identifiers.
SELECT_BY_BOX — to allow selecting by boxes. This is limited to
geometrical items and does not work on drawings.
SELECT_BY_MENU — to allow selecting by menu.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the selection box in the image


at the given location.

tag
Optional tag, shown in graphical user interface.
Note
Use a pipe '|' symbol to concatenate different selection types. The
following types can currently not be connected, since they require a
special handling:
PART
ASSEMBLY
INTENT_EDGE
INTENT_SURFACE
Example
USER_SELECT_MULTIPLE POINT 2 arrayPoints 1
USER_SELECT_MULTIPLE AXIS | PLANE -1 arrayAxisOrPlaces ALLOW_RESELECT
FILTER_MDL refMdl 2
§
USER_SELECT_MULTIPLE_OPTIONAL
Prompts the user to select an array of reference in the Creo
Elements/Pro model. The selection could be skipped.
Syntax
USER_SELECT_MULTIPLE_OPTIONAL &type max_selINT array<:out> [options]
['tag']
Description

type
The specified reference type. In case different types are allowed,
these should be concatenated by a pipe symbol '|'. String variables
introduces by the ampersand symbol & can also be used. See also the
information about parameter related reference types.

max_sel
Maximum number of references to select. A negative number means an
arbitrary number of references can be selected.

array
Name of the array which should receive the references.

options
DISPLAY_ORDER value — sort order in the dialog.
ALLOW_RESELECT — to re-select existing references in the redefine
mode.
FILTER_MDL refMdl<:in>| arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_FEAT reffeat<:in> | arrayFeats<:in> — to restrict the
selection to the specified features
FILTER_GEOM ref<:in> | arrayRefs<:in> — to restrict the selection
to items which are related to the specified geometry.
FILTER_REF ref<:in> | arrayRefs<:in> — to restrict the selection to
specified items.
FILTER_IDENTIFIER "identifier" — to restrict the selection to items
with a component engine identifier. Use "*" to accept all
identifiers.
SELECT_BY_BOX — to allow selecting by boxes. This is limited to
geometrical items and does not work on drawings.
SELECT_BY_MENU — to allow selecting by menu.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the selection box in the image


at the given location.

tag
Optional tag, shown in graphical user interface.
Note
Use a pipe '|' symbol to concatenate different selection types. The
following types can currently not be connected, since they require a
special handling:
PART
ASSEMBLY
INTENT_EDGE
INTENT_SURFACE
Example
USER_SELECT_MULTIPLE_OPTIONAL POINT 2 arrayPoints 1
USER_SELECT_MULTIPLE_OPTIONAL AXIS | PLANE -1 arrayAxisOrPlaces
ALLOW_RESELECT FILTER_MDL refMdl 2
§
USER_COLLECT
Allows to select surface sets and edge or curve chains by the help of
the collection interfaces.
Syntax
USER_COLLECT &type &method array<:out> [options] ['tag']
Description

type
The specified collection type. String variables introduces by the
ampersand symbol & can also be used.

method
The specified collection methods. In case different methods are
allowed, these should be concatenated by a pipe symbol '|'. String
variables introduces by the ampersand symbol & can also be used.

array
Name of the array which should receive the references.

options
DISPLAY_ORDER value — sort order in the dialog.
ALLOW_RESELECT — to re-select existing references in the redefine
mode.
FILTER_MDL refMdl<:in>| arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_FEAT reffeat<:in> | arrayFeats<:in> — to restrict the
selection to the specified features
FILTER_REF ref<:in> | arrayRefs<:in> — to restrict the selection to
specified items.
FILTER_GEOM ref<:in> | arrayRefs<:in> — to restrict the selection
to items which are related to the specified geometry.
FILTER_IDENTIFIER "identifier" — to restrict the selection to items
with a component engine identifier. Use "*" to accept all
identifiers.
OPTIONAL — it is not required to select something.

INCLUDE_MULTI_CAD includeBOOL — to distinguish if UNITE models


could be selected. Default is FALSE.
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the selection box in the image


at the given location.
tag
Optional tag, shown in graphical user interface.
Example
USER_COLLECT SURFACE SURFACE_ALLOW_ALL arraySurfaces
USER_COLLECT EDGE CHAIN_ONE_BY_ONE | CHAIN_TAN_CHAIN arrayEdges
FILTER_MDL refMdl
USER_INPUT_PARAM
Entry field in graphical user interface.
Syntax
USER_INPUT_PARAM 'parameter_type' parameter<:out> [default value
DOUBLE] [options]
Description:

parameter_type
The specified parameter type.

parameter
Parameter name which will be created.

default value
An optional default value for the parameter.

options
DEFAULT_FOR parameter1 parameter2 ... — The content of this
parameter can be used as the default for other specified
parameters.
WIDTH value — An optional width for the entry field. By default the
field has a width of 10 characters.
DECIMAL_PLACES value — Optional decimal places for the input field.
If not specified the number of decimal places is defined through
the configuration option SHOW_DECIMAL_PLACES or the Creo
Elements/Pro option default_dec_places.
MODEL model — Specify to which model the parameter should belong.
If the user changes the dimension a Creo Elements/Pro parameter or
dimension of the same name will be changed in the model.
REQUIRED — Specifies that the user is forced to specify a value for
this field.
NO_UPDATE — prevents associated Creo Elements/Pro parameters or
dimension from being updated automatically after CONFIG_ELEM.
DISPLAY_ORDER value — sort order in the dialog.
MIN_VALUE value — specifies the lower limit for a numerical value.
MAX_VALUE value — specified the upper limit for a numerical value.
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the entry field in the image at


the given location.
Note
On redefinition the value is retrieved from internal parameters. If
the value should reflect an specific Creo Elements/Pro parameter or
dimension, use SEARCH_MDL_PARAM in assembly description block.
Example
USER_INPUT_PARAM DOUBLE P DEFAULT_FOR DM1
USER_INPUT_PARAM DOUBLE DM1
CHECKBOX_PARAM
Checkbox parameter in graphical user interface. A checkbox parameter
provides an option to the user which can be selected or un-selected.
Syntax
CHECKBOX_PARAM parameter_type parameter<:out> [options] ['tag']
Description

parameter_type
The specified parameter type.

parameter
Name of the parameter which will receive the value 0 or 1.

options
REQUIRED — Specifies that the user is forced to specify a value for
this field. This option is only useful for the parameter types
INTEGER and DOUBLE.
DISPLAY_ORDER value — sort order in the dialog.
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the checkbox in the image at


the given location.

tag
Optional additional text displayed in brackets.
Note
In case the user has enabled the checkbox, the parameter value is 1,
otherwise it is 0. If the value is initially set to a different value
for the types INTEGER and DOUBLE the third state of the checkbox will
show up.
Example
CHECKBOX_PARAM INTEGER WITH_HOLES
RADIOBUTTON_PARAM
Radio button in graphical user interface. A radio button provides a
list of options to the user while allowing to select exactly one of
those.
Syntax:
RADIOBUTTON_PARAM parameter_type parameter<:out> ['option1' 'option2'
... ] [options]
Description

parameter_type
The specified parameter type.

parameter
Name of the parameter which will receive the value of the selected
option.

options
REQUIRED — Specifies that the user is forced to select a value in
of the radio button box. In order to prevent an automatic selection
define the variable with an invalid value like -1.
DISPLAY_ORDER value — sort order in the dialog.
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the radio button in the image


at the given location.
Note
For the first option, the value of the parameter is 0, for the second
the value is 1, for the third the value is 2 and so on.
Example
RADIOBUTTON_PARAM INTEGER COLOR red green blue
IF COLOR == 0
...
ELSE_IF COLOR == 1
...
ELSE_IF COLOR == 2
...
END_IF
§
USER_LIST_BOX
Adds a list box to the graphical user interface. A list box provides
the functionality to select one or many items.
Syntax:
USER_LIST_BOX arrayValues<:in> arraySelectedIndices<:out> [options]
Description

arrayValues
Array with strings which are shown as items of the list box.

arraySelectedIndices
Array which receives the indices of the selected items of the list
box. The first item has the number 0.

options
MULTIPLE_SELECT valueBOOL — to determine if this is a single or
multiple selection list box. Default is FALSE for a single
selection list box.

DEFAULT valueINT | array — to set the default selected items as an


integer value or as an array of integer values. The first item in
the list has the number 0.

SORT valueBOOL — to determine if the input values should be sorted.


In this case the indices are preserved. Default is FALSE for non
sorting.

USE_INDEX variableINT — to store the selected index to a variable.


This is also used to update other graphical elements.
USE_INDICES array — to store multiple selected indices to an array.
This is also used to update other graphical elements.

USE_VALUE variableSTRING — to store the selected value to a


variable. This is also used to update other graphical elements.
USE_VALUES array — to store the multiple selected values to an
array. This is also used to update other graphical elements.

VISIBLE_LINES valueINT — specifies the number of visible lines in


the list box. In case there are less lines available the list box
will show all lines. By default 5 lines are visible.
SHOW_TITLE "title" — title of the list box. Default is an empty
string.
REQUIRED — Specifies that the user is forced to select a value in
of the list box.

DISPLAY_ORDER valueINT — sort order in the dialog.


WIDTH value — An optional width for the list box. By default the
list box width is adjusted to the content.
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the list box in the image at


the given location.
Note
The first item of the list box has the number 0.
Example
BEGIN_GUI_DESCR
USER_LIST_BOX ListBoxArrayIn SelectionArrayOut REQUIRED
MULTIPLE_SELECT TRUE SHOW_TITLE "items" DEFAULT arrayPresetSelections
END_GUI_DESCR

BEGIN_ASM_DESCR
DECLARE_ARRAY ListBoxArrayIn
ADD_ARRAY_ELEM ListBoxArrayIn "List item 1"
ADD_ARRAY_ELEM ListBoxArrayIn "List item 2"
ADD_ARRAY_ELEM ListBoxArrayIn "List item 3"
ADD_ARRAY_ELEM ListBoxArrayIn "List item 4"
ADD_ARRAY_ELEM ListBoxArrayIn "List item 5"
ADD_ARRAY_ELEM ListBoxArrayIn "List item 6"

DECLARE_ARRAY arrayPresetSelections
ADD_ARRAY_ELEM arrayPresetSelections 2
ADD_ARRAY_ELEM arrayPresetSelections 4

CONFIG_ELEM

GET_ARRAY_SIZE SelectionArrayOut nElems


DECLARE_VARIABLE INTEGER n 0
WHILE n < nElems
GET_ARRAY_ELEM SelectionArrayOut n elem
PRINT "%" elem

n++
END_WHILE

END_ASM_DESCR
§
USER_DROP_DOWN
Adds a drop down to the graphical user interface. A drop down
provides the functionality to select one item.
Syntax:
USER_DROP_DOWN arrayValues<:in> sel_indexINT<:out> [options]
Description

arrayValues
Array with strings which are shown as items of the list box.

sel_index
Variable of type integer which receives the index of the selected
item. The first item has the number 0.

options
DEFAULT valueINT — to set the default selected item as an integer
value. The first item in the list has the number 0.

SORT valueBOOL — to determine if the input values should be sorted.


In this case the indices are preserved. Default is FALSE for non
sorting.

USE_INDEX variableINT — to store the selected index to a variable.


This is also used to update other graphical elements.

USE_VALUE variableSTRING — to store the selected value to a


variable. This is also used to update other graphical elements.

VISIBLE_LINES valueINT — specifies the number of visible lines in


the drop down box. In case there are less lines available the list
box will show all lines. By default 5 lines are visible.
SHOW_TITLE "title" — title of the drop down box. Default is an
empty string.
REQUIRED — Specifies that the user is forced to select a value in
of the drop down box.

DISPLAY_ORDER valueINT — sort order in the dialog.


WIDTH value — An optional width for the drop down. By default the
width is adjusted to the content of the drop down.
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the drop down in the image at


the given location.
Note
The first item of the drop down box has the number 0.
Example
BEGIN_GUI_DESCR
USER_DROP_DOWN DropDownBoxArrayIn sel_index REQUIRED SHOW_TITLE
"items" DEFAULT 3
END_GUI_DESCR

BEGIN_ASM_DESCR
DECLARE_ARRAY DropDownBoxArrayIn
ADD_ARRAY_ELEM DropDownBoxArrayIn "List item 1"
ADD_ARRAY_ELEM DropDownBoxArrayIn "List item 2"
ADD_ARRAY_ELEM DropDownBoxArrayIn "List item 3"
ADD_ARRAY_ELEM DropDownBoxArrayIn "List item 4"
ADD_ARRAY_ELEM DropDownBoxArrayIn "List item 5"
ADD_ARRAY_ELEM DropDownBoxArrayIn "List item 6"

CONFIG_ELEM

PRINT "%" sel_index

END_ASM_DESCR
§
USER_TEXT_BOX
Adds a multi line text box the graphical user interface.
Syntax:
USER_TEXT_BOX variable<:out> [options]
Description

variable
Name of the variable of type STRING which will receive the entered
content.

options
VISIBLE_LINES valueINT — specifies the number of visible lines in
the text box. By default 7 lines are visible.

VISIBLE_COLUMNS valueINT — specifies the number of visible columns


in the text box. By default 15 columns are visible.
SHOW_TITLE "title" — title of the text box. Default is an empty
string.
REQUIRED — Specifies that the user is forced to enter text in the
text box.

DISPLAY_ORDER valueINT — sort order in the dialog.


TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the text box in the image at


the given location.
Note
The first item of the text box has the number 0.
Example
BEGIN_GUI_DESCR
USER_TEXT_BOX text REQUIRED SHOW_TITLE "Text Input" VISIBLE_LINES 10
VISIBLE_COLUMNS 32
END_GUI_DESCR

BEGIN_ASM_DESCR

CONFIG_ELEM

PRINT "%" text

END_ASM_DESCR
About Commands for Searching
Commands for searching references, parameters or dimension values in
Creo Elements/Pro and store the result to variables of the program.
The following commands are available:
SEARCH_MDL_REF — to search for a reference of a specific type in a
Creo Elements/Pro model
SEARCH_FEAT_PARAM — to search for a feature parameter in a Creo
Elements/Pro model.
SEARCH_MDL_PARAM — to search for a model parameter in a Creo
Elements/Pro model.
SEARCH_STAMP_REF — to search for a distinct stamping reference for
progressive dies design.
SEARCH_MDL_REF
Searches for a named reference in a Creo Elements/Pro model.
Syntax
SEARCH_MDL_REF model 'type' "search_string" [WITH_CONTENT ... ]
[WITH_IDENTIFIER ... ] reference<:out>
Description

model
The specified model.

type
The specified reference type.

search_string
This is the Creo Elements/Pro name of the reference to search for.
Any string expression is allowed.
If an asterisk * is specified any feature name is accepted. The first
found entity of the specified type is used.
Since features could be renamed by the user, the content of a string
parameter at the feature called BUW_OBJECT_ROLE is also accepted as
feature name. It is recommended to apply this parameter to avoid
problems on renaming.
Another technique is to identify a feature by its id. This could be
done by FID:number as search string. For example FID:9.
In case of the type DRAWING, any text expression will match. It will
always be searched for a drawing which has the same name as the
specified model.

WITH_CONTENT
An optional WITH_CONTENT clause can follow, to filter for specific
variable content.

WITH_IDENTIFIER
An optional WITH_IDENTIFIER / WITH_IDENTIFIER_NOT can follow to limit
the search results for a specific identifier.

reference<:out>
Name of the reference which should receive the information.
Example:
SEARCH_MDL_REF THIS CSYS assembling_csys
SEARCH_FEAT_PARAM
Searches for a specific parameter in a feature.
Syntax
SEARCH_FEAT_PARAM feature "search_string" [option] parameter<:out>
Arguments

feature
The specified feature.

search_string
Name of the Creo Elements/Pro parameter or dimension which should be
searched. Any string expression is allowed.

option
NO_UPDATE: prevents associated Creo Elements/Pro parameters or
dimension from being updated automatically after CONFIG_ELEM.
NO_DIM_SIGN — avoids to show up a minus sign for negative
regenerated dimensions.

parameter
Name for the parameter which should receive the content of the Creo
Elements/Pro parameter or dimension.
Example
! search feature parameter at the component feature.
SEARCH_FEAT_PARAM feature height
SEARCH_MDL_PARAM
Searches for a parameter or dimension with a specific name in an Creo
Elements/Pro model.
Syntax
SEARCH_MDL_PARAM model "search_string" [option] parameter<:out>
Arguments

model
The specified model.

search_string
Name of the Creo Elements/Pro parameter or dimension which should be
searched. Any string expression is allowed.

option
NOT_INHERITED — does not search for the parameter or dimension in
inherited models.
INHERITED — searches for parameter or dimension only in inherited
models.
NO_UPDATE — prevents associated Creo Elements/Pro parameters or
dimension from being updated automatically after CONFIG_ELEM.
NO_DIMENSION — avoids to search for dimension. This can be used for
performance reasons to prevent the search for dimensions in large
models.
INCLUDE_MASS_PROPS — check also for mass property parameters.
NO_DIM_SIGN — avoids to show up a minus sign for negative
regenerated dimensions.

parameter
Name for the parameter which should receive the content of the Creo
Elements/Pro parameter or dimension.
Note
If a variable remains undefined or not could be figured out by using
PARAM_VALID in an IF statement.
Example
SEARCH_MDL_PARAM THIS height dimension_height
SEARCH_STAMP_REF
Searches for a named surface in the selected models. The search is
done in z direction. Use this command to specify a tool plate at a
position
Syntax
SEARCH_STAMP_REF refLocation<:in> "surface_name" model [model2 ...]
reference<:out>
Arguments

refLocation
The previously selected reference to indicate the location.

surface_name
The Creo Elements/Pro surface name to search.

model1 model2 ...


Sequence of models roles that should be searched. Any string
expression is allowed. The role of a model is determined by the part
level string parameter BUW_OBJECT_ROLE.

reference
Reference which will receive the information.
Note
Usually the search direction is the standard z axis of the current
model. In case a coordinate system with the BUW_OBJECT_ROLE string
parameter with content MACHINING_CSYS is provided, the z axis of this
coordinate system is considered.
In case no name is provided to a upper or lower surface in Creo
Elements/Pro, the names TOP resp. BOTTOM are assumed.
In case on valid solid surface is found, also non solid surfaces are
considered. This could be useful if the surface is intersected at the
position. To find non solid surfaces by the command they must be
visible. If they are located on layers, make sure to show them by
SET_LAYER_STATUS.
Example
USER_SELECT POINT placement_point
SEARCH_STAMP_REF placement_point TOP CUT_PLATE BASE_PLATE PLATE_TOP
About Commands for Model Operations
Commands which are operating on models.
The following commands are available:
REGEN_MDL — to regenerate a model.
GET_MDL_NAME — to retrieve the name of a model.
GET_UNIT_LENGTH — to retrieve the unit for lengths.
GET_MATERIAL — to read the assigned material of a part.
GET_MATERIAL_PROPERTIES — to receive the properties of the
currently assigned materials.
SET_VARIED_ITEM_STATE — to set the value of a varied dimension or
parameter item for an inheritance model or a flexible component.
SET_VARIED_ITEM_VALUE — to insert a dimension, a parameter or a
feature as varied item for an inheritance model or a flexible
component.
REGEN_MDL
Regenerates an existing model.
Syntax
REGEN_MDL model
Arguments

model
The model to regenerate.
Example
REGEN_MDL THIS_59
GET_MDL_NAME
Retrieves name of a specified model.
Syntax
GET_MDL_NAME model parameter<:out>
Arguments

model
The specified model.

parameter
Name of the parameter which should receive the model name.
Example
USER_SELECT MODEL mdl
GET_MDL_NAME mdl mdlName
SHOW_PARAM STRING mdlName
GET_UNIT_LENGTH
Reads the unit system of a model.
Syntax
GET_UNIT_LENGTH model paramUnitLength<:out>
Arguments

model
Model from which the accuracy should be read according to model
specification.

paramUnitLength
Receives the string parameter MM or INCH.
Example
USER_SELECT MODEL mdl
GET_UNIT_LENGTH mdl paramUnitLength
§
GET_MATERIAL
Reads the assigned material of a part. In case no material is
assigned the result is an empty string.
Syntax
GET_MATERIAL model paramMaterial<:out>
Arguments

model
Model from which the assigned material should be read according the
model specification.

paramMaterial
Receives the assigned material as a string parameter.
Example
GET_MATERIAL THIS paramMaterial
§
GET_MATERIAL_PROPERTIES
Reads the properties of the assigned material of a part.
Syntax
GET_MATERIAL_PROPERTIES model material<:out>
Arguments

model
Model from which the assigned material should be read model
specification.

material
Structure variable of type MATERIAL which receives the material
properties.
Example
GET_MATERIAL_PROPERITES THIS material
§
SET_VARIED_ITEM_STATE
Sets the state of a varied item of an inheritance feature or a
flexible component. This function requires Pro/ENGINEER Wildfire 4 or
above.
Syntax
SET_VARIED_ITEM_STATE [options] model refFeature<:in> 'state'
Arguments

options
The following options are available:
INCLUDE_CHILDREN includeBOOL — determines if also the state of the
children of the specified feature should be set. Default is FALSE.

model
The flexible model for which the feature should be set. Models are
specified in the following manner.

refFeature
Existing reference to a varied item of an inheritance feature or a
flexible component.

state
SUPPRESSED — to suppress the feature.
RESUMED — to resume the feature.
Error handling
The program execution will be canceled if the model or the reference
is not existing, unless errors are handled by BEGIN_CATCH_ERROR.
Example
USER_SELECT FEATURE refFeature
SET_VARIED_ITEM_STATE refFeature refFeature SUPPRESSED
§
SET_VARIED_ITEM_VALUE
Sets the value of a varied item of an inheritance feature or a
flexible component. This function requires Pro/ENGINEER Wildfire 4 or
above.
Syntax
SET_VARIED_ITEM_VALUE model "item_name" valueSTRNUM
Arguments

model
The flexible model for which the feature should be set. Models are
specified in the following manner.

item_name
Name of the varied item. Any string expression is allowed. Also
wildcards are allowed to specify the instance name.

value
Value which should be set to the item Any string expression or math
expression is allowed.
Error handling
The program execution will be canceled if the model does not exist,
unless errors are handled by BEGIN_CATCH_ERROR.
Note
Due to a Pro/TOOLKIT but setting parameter as varied item is changing
the original parameter, but not the varied parameter.
Example
SET_FLEXIBLE_PREDEFINED mdl
SET_VARIED_ITEM_VALUE mdl "length" 100.0
About Commands for Measuring
Commands for measurement similar to the analysis functionality in
Creo Elements/Pro.
The following commands are available:
MEASURE_DISTANCE — to measure distances.
MEASURE_ANGLE — to measure angles.
MEASURE_RADIUS — to measure radii.
MEASURE_DIAMETER — to measure diameters.
MEASURE_LENGTH — to measure lengths.
MEASURE_AREA — to measure areas.
CALC_OUTLINE_PARAM — to measure center points, maximum extensions
and maximum coordinates.
NEXT_RAY_INTERSECTION — to find a solid surface in a specific
direction.
MEASURE_DISTANCE
Computes the distance between two specified references.
Syntax
MEASURE_DISTANCE [options] reference1<:in> reference2<:in>
parameter<:out>
Description

options
The following options are supported since:
ENABLE_CHECKBOX1 valueBOOL — corresponds to the checkbox in the
measure distance dialog related to the first reference. Default is
TRUE.

ENABLE_CHECKBOX2 valueBOOL — corresponds to the checkbox in the


message distance dialog related to the second reference. Default is
TRUE.
The options are effective since Creo 2.0 M190 / Creo 3.0 M070 / Creo
4.0 F000 or above. Before these versions they won't have impact on
the measuring results.

reference1
Name of an existing reference.

reference2
Name of an existing reference.

parameter
New parameter that receives the measured result.
Example
MEASURE_DISTANCE plane1 plane2 dist_plane1_plane2
MEASURE_ANGLE
Computes the angle between two specified references.
Syntax
MEASURE_ANGLE reference1<:in> [reference2<:in>] parameter<:out>
Description

reference1
Name of an existing reference.

reference2
Optional name of an existing reference.

parameter
New parameter that receives the measured result.
Note
If reference2 is not specified the angle of an arc could be measured.
Example
MEASURE_ANGLE plane1 plane2 angle_plane1_plane2
MEASURE_ANGLE cyl_surface angle_cyl_surface
MEASURE_RADIUS
Computes the radius of a specified reference.
Syntax
MEASURE_RADIUS reference1<:in> parameter<:out>
Description

reference1
Name of an existing reference.

parameter
New parameter that receives the measured result.
Example
MEASURE_RADIUS cylinder radius_cylinder
MEASURE_DIAMETER
Computes the diameter of a specified reference.
Syntax
MEASURE_DIAMETER reference1<:in> parameter<:out>
Description

reference1
Name of an existing reference.

parameter
New parameter that receives the measured result.
Example
MEASURE_DIAMETER cylinder diam_cylinder
MEASURE_LENGTH
Computes the length of a specified reference.
Syntax
MEASURE_LENGTH reference1<:in> parameter<:out>
Description

reference1
Name of an existing reference.

parameter
New parameter that receives the measured result.
Example
MEASURE_LENGTH edge length_edge
MEASURE_AREA
Computes the area of selected surface references.
Syntax
MEASURE_AREA reference<:in> | arrayReferences<:in> parameter<:out>
Description

reference | arrayReferences
Name of an existing surface reference or of an array of surface
references.

parameter
New parameter that receives the measured result.
Example
MEASURE_AREA surface area_surface
CALC_OUTLINE_PARAM
Calculates center and size of a model with respect to a coordinate
system and stores it in a parameter.
Syntax
CALC_OUTLINE_PARAM [options] referenceCsys<:in> option
parameter<:out>
Arguments

options
The following options are supported:

INCLUDE_NONSOLID valueBOOL — determines if non solid surfaces


should be includes. Default is FALSE.

INCLUDE_DATUMS valueBOOL — determines if datums should be included


in the calculation. Default is FALSE.

INCLUDE_FACETS valueBOOL — determines if facets should be included


in the calculation. Default is FALSE.

INCLUDE_CURVES valueBOOL — determines if curves should be included


in the calculation. Default is FALSE.

referenceCsys
Name of a reference coordinate system.

option
X_POS_CENTER — X coordinate of center point with respect to
coordinate system.
Y_POS_CENTER — Y coordinate of center point with respect to
coordinate system.
Z_POS_CENTER — Z coordinate of center point with respect to
coordinate system.
X_SIZE — Size of stamp reference part in x direction with respect
to coordinate system.
Y_SIZE — Size of stamp reference part in y direction with respect
to coordinate system.
Z_SIZE — Size of stamp reference part in z direction with respect
to coordinate system.
X_MAX — Maximum x value with respect to coordinate system.
Y_MAX — Maximum y value with respect to coordinate system.
Z_MAX — Maximum z value with respect to coordinate system.
X_MIN — Minimum x value with respect to coordinate system.
Y_MIN — Minimum y value with respect to coordinate system.
Z_MIN — Minimum z value with respect to coordinate system.

parameter
New parameter that receives the measured result.
Note
The model which is examined is the owner of the coordinate system.
Only solid geometry is regarded. Surfaces are not considered.
Example
USER_SELECT CSYS refCsys
CALC_OUTLINE_PARAM refCsys X_POS_CENTER position_in_x
§
NEXT_RAY_INTERSECTION
Finds a solid surface in a specific direction. By default the next
nearest surface is found. With the options below also other surfaces
can be determined.
Syntax
NEXT_RAY_INTERSECTION refMdl<:in> direction point<:in> vector<:in>
refFound<:out> [option]
Arguments

refMdl
Reference to an existing model in which the ray is send out.

direction
The following directions are supported:
POSITIVE — to search only in positive ray direction.
NEGATIVE — to search only in negative ray direction.
BOTH — to search in both ray directions.

point
Structure variable of type POINT specifies the start point of the
ray.

vector
Structure variable of type VECTOR specifies the start vector of the
ray.

refFound
Reference of the surface which was found.

option
The following options are supported:
FILTER_MDL refMdl<:in> | arrayMdls<:in> — to restrict the selection
to the specified model.
FILTER_ORIENT [filter_option] — the following filter options are
supported:
INTRUDING — only surfaces for which the ray is intruding are
considered.
EXTRUDING — only surfaces for which the ray is extruding are
considered.
INTRUDING_EXTRUDING — both orientations are considered. This is
the default option.
MAX_DISTANCE — Use the surface which is the most far away. By
default the nearest surface is used.
INNER_INTERSECTIONS — also consider inner intersections of a ray in
the one model.
Example
USER_SELECT SURFACE srf
GET_SURFACE_NORM NULL srf pos norm
NEXT_RAY_INTERSECTION ASSEMBLY POSITIVE pos norm FILTER_MDL srf
FILTER_ORIENT INTRUDING MAX_DISTANCE
About Commands for Retrieving Information
Commands for retrieving different types of information..
The following commands are available:
GET_REF_OWNER — to retrieve the owning model of a reference. For a
reference to a model, this is the model itself.
GET_REF_PARENT — to retrieve the parent of a reference.
GET_FEATURE_FROM_GEOM — to retrieve the feature which owns the
geometry item.
GET_REF_TYPE — to retrieve the type of a reference.
GET_SURFACE_NORM — to determine the normal vector on a surface.
GET_REF_OWNER
Gets the owner of a specified reference. For features and geometrical
entities the owner is the part or assembly which contains them. The
owner of a part or assembly is the model itself.
Syntax
GET_REF_OWNER reference<:in> referenceOwner<:out>
Arguments

reference
Name of an existing reference.

referenceOwner
Name of the reference which will receive the owner of the specified
reference.
Note
The difference to GET_REF_PARENT is, that GET_REF_OWNER searches for
the model which contains the reference.
Example
! Assumed placement_point is in part prt001 which is a component of
assembly asm0001
! The following line gets prt0001 as owner of the point
GET_REF_OWNER placement_point mdlOwner
! The following line gets asm0001 as parent model of the point
GET_REF_PARENT placement_point mdlParent
GET_REF_PARENT
Gets the parent of the owner of a specified reference.
Syntax
GET_REF_PARENT reference<:in> referenceParent<:out>
Arguments

reference
Name of an existing reference.

referenceParent
Name of the reference which will receive the parent of the specified
reference.
Note
The difference to GET_REF_OWNER is, that GET_REF_PARENT searches for
the model which contains the owner.
Example
! Assumed placement_point is in part prt001 which is a component of
assembly asm0001
! The following line gets prt0001 as owner of the point
GET_REF_OWNER placement_point mdlOwner
! The following line gets asm0001 as parent model of the point
GET_REF_PARENT placement_point mdlParent
GET_FEATURE_FROM_GEOM
Retrieves reference to a feature based on the specified reference to
a geometrical element (for example an edge, an axis etc.)
Syntax
GET_FEATURE_FROM_GEOM refGeom<:in> refFeature<:out>
Arguments

refGeom
Existing reference to a geometrical element in Creo Elements/Pro.

refFeature
Reference which will receive the feature which contains the
geometrical element.

Example
USER_SELECT CSYS geomCsys
GET_FEATURE_FROM_GEOM geomCsys featCsys
GET_REF_TYPE
Retrieve the type of a reference.
Syntax
GET_REF_TYPE reference<:in> parameter<:out>
Arguments

reference
Name of an existing reference.

parameter
Name of the parameter which should receive the information. The
content will be one of the reference types or UNKNOWN.
Example
USER_SELECT POINT | AXIS MY_REFERENCE
GET_REF_TYPE MY_REFERENCE type
§
GET_SURFACE_NORM
Determines the normal vector on a surface. If the surface was
selected, the normal vector is determined in the selection position.
Otherwise the center point is used.
Syntax
GET_SURFACE_NORM reference_origin<:in> reference_surface<:in>
posPoint<:out> normVector<:out>
Arguments

reference_origin
Determines the origin for measuring the point coordinates. The
following situations have to be regarded:
origin is a coordinate system
Point will be measured with respect to this coordinate system.
NULL
Point will be measured in local coordinates of the model to which
the point belongs to.
Any other reference
Point will be measured with respect to owner of the point in the
second argument.

reference_surface
Reference indicating a surface. Any other kind of reference will
cause an error.

posPoint
Name of the output variable of type POINT which will receive the
origin point on the surface of the norm vector.

posVector
Name of the output variable of type VECTOR which will receive the
norm vector.
Example
USER_SELECT SURFACE surf
GET_SURFACE_NORM NULL surf pnt direction
About Commands for Writing Information
Commands for writing information to Creo Elements/Pro models.
The following commands are available:
SET_MDL_PARAM — to create or modify a model parameter in Creo
Elements/Pro.
SET_MDL_PARAM
Updates a Creo Elements/Pro model parameter or dimension with a
specified value.
Syntax
SET_MDL_PARAM model "search_string" valueSTRNUM [option]
Arguments

model
The specified model.

search_string
Name of Creo Elements/Pro parameter or dimension which should be
searched. Any string expression is allowed. In case no parameter or
dimension is found a new parameter will be created for the specified
model.

value
Value which should be set to the Creo Elements/Pro parameter or
dimension. Any string expression or math expression is allowed.

option
NO_REGEN — prevent the model from being regenerated automatically.
NO_DIMENSION — avoid to search for dimension. This can be used for
performance reasons to prevent the search for dimensions in large
models.
NO_DIM_SIGN — a positive value does not changed the sign of a
negative regenerated dimension.
Note
When several parameters are updated, the option NO_REGEN prevents non
required regenerations. When the model should be regenerated the
command REGEN_MDL could be used.
Example
USER_INPUT_PARAM DOUBLE paramvalue_height
SET_MDL_PARAM THIS height paramvalue_height
About Commands for Data Handling
Commands for data handling via program variables.
The following commands are available:
DECLARE_VARIABLE — to declare a variable of type parameter.
INVALIDATE_REF — to invalidate a variable of type reference.
DECLARE_VARIABLE
Declaration of a new parameter variable. A standard value could be
specified.
Syntax
DECLARE_VARIABLE parameter_type parameter<:out> default_value STRNUM
Arguments

parameter_type
The specified parameter type.

parameter
Name for the parameter which should be declared.

default_value
Optional default value for the parameter. Depending on the parameter
type this could either be specified through a string expression or
through a math expression.
Note
The default value is only used if the parameter is not already
existing. This is especially useful for standard values in UDF
programs. On modification the standard values do not overwrite the
value of the created UDF.
Example
DECLARE_VARIABLE DOUBLE TEST_PARAM 12
INVALIDATE_REF
Invalidates an existing reference.
Syntax
INVALIDATE_REF reference<:in>
Arguments

reference
Name of an existing reference.
§
About Commands for Arrays
Commands to declare and read from arrays. Arrays are collections to
store an arbitrary number of elements.
The following commands are available:
DECLARE_ARRAY — to declare a variable of type array.
GET_ARRAY_SIZE — to retrieve the size of an array.
GET_ARRAY_ELEM — to retrieve an element of an array.
FIND_ARRAY_ELEM — to search for an element in an array.
§
DECLARE_ARRAY
Declares an array variable for storing variables.
Syntax
DECLARE_ARRAY array<:out>
Arguments

array
Name of the new array which will be created.
Example
DECLARE_ARRAY testArray
§
GET_ARRAY_SIZE
Determines the number of elements in an array.
Syntax:
GET_ARRAY_SIZE array<:in> parameter<:out>
Arguments

array
Name of an existing array.

parameter
Name of the parameter which should containing the number of elements
stored in the array.
Example
GET_ARRAY_SIZE testArray sizeTestArray
§
GET_ARRAY_ELEM
Retrieves a specific element of an array specified by the index
number and stores it in a variable.
Syntax
GET_ARRAY_ELEM array<:in> numberINT variable<:out>
Arguments

array
Name of an existing array.

number
Number of the element which should be received. Element numbers start
with 0 for the first element. Any math expression is valid to
calculate this number.

variable
Name of the variable which should contain the element after the
command is processed.
Example
GET_ARRAY_ELEM testArray 0 value
§
FIND_ARRAY_ELEM
Searches for an element in an array and returns the array index or -1
in case it was not found.
Syntax
FIND_ARRAY_ELEM array<:in> element<:in> index<:out>
Arguments

array
Name of an existing array.

element
Name of an existing variable or string or number value to search.

index
Name of the parameter which will receive the index.
Example
FIND_ARRAY_ELEM testArray "value 2" index
PRINT "Array index: %" index
About Commands for Information Output
Commands for Information Output contains images and parameter
information in the dialog box as well as information output in the
message area.
The following commands are available:
GLOBAL_PICTURE — to display images in the dialog box.
SUB_PICTURE — to display overlaying images.
SHOW_PARAM — to show parameter values in the dialog box.
PRINT — to show information in the message area.
CLEAR_MESSAGE_AREA — to clear the last line of the message area.
SHOW_HELP — to show information by clicking the help button.
CAPTION — to customize the caption line of the user dialog.
GLOBAL_PICTURE
Specifies an gif image to display in the dialog box. In case the
configuration option IMAGE_GRAPHICS is set to GDIPLUS, also bmp, jpeg
and tiff images can be used.
Syntax
GLOBAL_PICTURE "picture_file_name"
Description

picture_file_name
File name of the image. Any string expression is allowed.
Example
GLOBAL_PICTURE sample.gif
§
SUB_PICTURE
Specifies an overlaying gif image related to the global picture in
the dialog box. In case the configuration option IMAGE_GRAPHICS is
set to GDIPLUS, also bmp, jpeg and tiff images can be used.
Syntax
SUB_PICTURE "picture_file_name" posXINT posYINT
Description

picture_file_name
File name of the image. Any string expression is allowed.

posX
The horizontal position of the sub picture in pixels related to the
global picture. Any math expression is allowed.

posY
The vertical position of the sub picture in pixels related to the
global picture. Any math expression is allowed.
Example
GLOBAL_PICTURE sample.gif
SUB_PICTURE picture1.gif 100 100
SUB_PICTURE picture2.gif 200 100
SHOW_PARAM
Shows current value of the parameter in an information dialog box.
Syntax
SHOW_PARAM parameter_type parameter<:in> [options]
Description:

parameter_type
The specified parameter.

parameter
The existing parameter.

options
TOOLTIP "message" [IMAGE "image_name"] — shows the message as a
tooltip when the mouse is hovering over a control element.
Additionally an image can be displayed.

ON_PICTURE posXINT posYINT — places the text in the image at the


given location.
Example
SHOW_PARAM DOUBLE DM
PRINT
Output of text messages in the Creo Elements/Pro message area.
Syntax
PRINT [options] "format" [argument] [ argument ] ...
Arguments

options
The following options are available:
MESSAGE_SYMBOL "symbol" — determines the message symbol. Valid
symbols are NONE, PROMPT, INFO, WARNING, ERROR and CRITICAL.
Default is INFO.

format
The format is a text string. Every percentage sign '%' will be
replaced with content of the following arguments. In case the format
string contains spaces it should be placed in quotation marks
("..."). In case a percentage sign should be printed in the message
area, two consecutive percentage signs need to be specified: '%%'.

arguments
Number of arguments according to percentage sign in the format
string. The Arguments could be string, number or parameter expression
according to the rules for math equations and string expressions.
The following arguments are predefined:
__LINE__ — for the current line of the tab file.
Note
References could also be specified as arguments. In this case the
content of reference is shown.
Example
SEARCH_MDL_PARAM THIS "DIAMETER" paramDiameter
PRINT "Diameter is: %" paramDiameter
§
CLEAR_MESSAGE_AREA
Clears the message area. This is supported since Creo 3.0 M190, Creo
4.0 M080, Creo 5.0.3.0 and above.
Syntax
CLEAR_MESSAGE_AREA
Example
PRINT "last line"
CLEAR_MESSAGE_AREA
§
SHOW_HELP
Enables a help button in the graphical user interface. If the help
button is clicked the specified web page will be opened.
Syntax
SHOW_HELP [options] "web_page"
Arguments

options
The following options are supported:
EXTERNAL — to show the web page in the standard browser. If this
option is not set, the internal browser of Creo will be used.

web_page
Any web page which could be shown in the embedded browser. Any string
expression is allowed and all elements of the path specification
rules can be used.
Example
SHOW_HELP EXTERNAL www.google.de
SHOW_HELP "lib:sample.html"
§
CAPTION
Customizes the caption line of the user dialog.
Syntax
CAPTION "caption"
Arguments

caption
Caption line for the user dialog. Any string expression is allowed.
Example
CAPTION "This is a very special dialog"
§
About Commands for Graphics and Display
Commands for modifying graphics and display mode of a model.
The following commands are available:
SHOW_DIM — to display one dimension or an array of dimensions.
SHOW_DIMS — to display dimensions of a feature or model.
§
SHOW_DIMS
Shows one dimension or an array of dimensions.
Syntax
SHOW_DIM refDim<:in>| arrayDims<:in>
Arguments

refDim | arrayDim
Reference to a dimension or array of references to a dimension.
Note
This command is frequently used before a USER_SELECT statement with
selection type DIMENSION.
§
SHOW_DIMS
Shows dimensions of a specific feature or model.
Syntax
SHOW_DIMS refDimOwner<:in>
Arguments

refDimOwner
Reference to the dimension owner. This could be a feature or a model.
Note
This command is frequently used before a USER_SELECT statement with
selection type DIMENSION.
About Commands for Control Structures
Commands for applying conditional elements of a program and to launch
another script file.
The following commands are available:
IF — to execute a block of commands based on the evaluation of a
condition term.
CALL — to execute another script file.
INCLUDE — to include the graphical user interface block from
another script file.
BEGIN_TOPELEM_INFO — to use a block only as a main component, not
called by a component description block entry..
BEGIN_SUBCOMP_INFO — to use a block only as a sub component, called
by a component description block entry.
IF
Determines if a block of code is computed or not through evaluating a
condition term.
Syntax
IF condition term
Program code
Program code
...
ELSE_IF condition term
Program code
Program code
...
ELSE
Program code
Program code
...
END_IF
Arguments

IF condition term
If the condition term is evaluated as valid, the code in the
following lines will be executed up to the next ELSE_IF, ELSE or
END_IF statement.

ELSE_IF condition term


If the condition term is evaluated as valid and no previous condition
term in the same IF ... END_IF block was valid, the code in the
following lines will be executed up to the next ELSE_IF, ELSE or
END_IF statement.

ELSE
If no previous condition term in the same IF ... END_IF block was
valid, the code in the following lines will be executed up to the
END_IF statement.

END_IF
End of the IF block.
Note
Graphical elements for input like USER_SELECT, USER_SELECT_OPTIONAL,
USER_INPUT_PARAM, CHECKBOX_PARAM and RADIOBUTTON_PARAM will be grayed
out, if the are in an non active IF block. GLOBAL_PICTURE images will
not be displayed.
Example
RADIOBUTTON_PARAM INTEGER type A B C
IF type == 0
GLOBAL_PICTURE TYPE_A
ELSE_IF a < 30
GLOBAL_PICTURE TYPE_B
ELSE
GLOBAL_PICTURE TYPE_C
END_IF
§
CALL
Executes another script file by specifying the file name. The script
file execution starts in the graphical user interface block. That
means the assembly description block will not be executed.
Syntax
CALL "filename"
Description

filename
File name of the tab file which should be processed. In case no
extension is specified ".tab" will be appended automatically.
Note
The script file which should be called, must also be declared in the
corresponding sel_list.txt. Parent and child tab file share the same
variables. Every modification in one tab file is also visible in the
other tab file.
Example
CALL tab_file.tab
§
INCLUDE
Includes the graphical user interface block from another script file
by specifying the file name.
Syntax
INCLUDE "filename"
Description

filename
File name of the tab file which should be processed. Any string
expression is allowed. In case no extension is specified ".tab" will
be appended automatically.
Note
The script file which should be included, needs not to be declared in
the corresponding sel_list.txt. All variables from the main program
could be accessed and modified. All new created variables will be
accessible in the main program afterwards.
Example
INCLUDE tab_file.tab
BEGIN_TOPELEM_INFO
Distinguishes if a component description file is used as a main
component or as a sub component. Elements inside BEGIN_TOPELEM_INFO
... END_TOPELEM_INFO are only executed in case this component
description file is used as a main component. In case it is executed
because of a component description block entry, it will be ignored.
Syntax
BEGIN_TOPELEM_INFO
Program code
Program code
...
END_TOPELEM_INFO
Note
See BEGIN_SUBCOMP_INFO for commands which are only executed as sub
components.
BEGIN_SUBCOMP_INFO
Distinguishes if a component description file is used as a main
component or as a sub component. Elements inside BEGIN_SUBCOMP_INFO
... END_SUBCOMP_INFO are only executed in case this component
description file is used because of a component description block
entry.
Syntax
BEGIN_SUBCOMP_INFO
Program code
Program code
...
END_SUBCOMP_INFO
Note
See BEGIN_TOPELEM_INFO for commands which are only executed as main
components.
§
About Commands for Pro/PIPING
Commands for retrieving information from Pro/PIPING models. The
following commands are available:
GET_PIPELINE — to retrieve the pipeline feature of a model.
SEARCH_LINESTOCK_PARAM — to read linestock parameters from a
pipeline feature.
§
GET_PIPELINE
Retrieves the pipeline feature of a model.
Syntax
GET_PIPELINE refMdl<:in> refFeaturePipeline<:out>
Arguments

refMdl
Reference to an existing model.

refFeaturePipeline
Reference which will receive the pipeline feature.
Example
USER_SELECT MODEL mdl
GET_PIPELINE mdl pipeline
SEARCH_LINESTOCK_PARAM pipeline STOCKNO stock_numer
SEARCH_LINESTOCK_PARAM pipeline MATERIAL material
SEARCH_LINESTOCK_PARAM pipeline od outer_diameter
SHOW_PARAM STRING material
SHOW_PARAM DOUBLE stock_numer
SHOW_PARAM DOUBLE outer_diameter
§
SEARCH_LINESTOCK_PARAM
Searches for a linestock parameter of in a pipeline feature.
Syntax
SEARCH_LINESTOCK_PARAM refFeaturePipeline<:in> "name" parameter<:out>
Arguments

refFeaturePipeline
Reference to a pipeline feature.

name
Name of the linestock parameter. Any string expression is allowed.

parameter
Parameter which will receive the content of the linestock parameter.
Example
USER_SELECT MODEL mdl
GET_PIPELINE mdl pipeline
SEARCH_LINESTOCK_PARAM pipeline STOCKNO stock_numer
SEARCH_LINESTOCK_PARAM pipeline MATERIAL material
SEARCH_LINESTOCK_PARAM pipeline od outer_diameter
SHOW_PARAM STRING material
SHOW_PARAM DOUBLE stock_numer
SHOW_PARAM DOUBLE outer_diameter
§
About Commands for Identifiers
Components and UDFs created by the script language are marked by the
component / feature level string parameter CONNECT_EQUIP_IDENT_STR.
In case of identical content, the components and UDFs are considered
to be created by the same program and will be deleted together. When
a new program file is launched, the identifier is always set to a new
session identifier. The commands below provide support to assign
different identifiers in one tab program.
The following commands are available:
GET_IDENTIFIER_FROM_REF — to retrieve a identifier from a
reference.
Also the following reference types can be used in SEARCH_MDL_REF to
search for identifiers:
IDENTIFIER — to search for components and features with a specified
identifier.
IDENTIFIER_COMPONENT — to search for components with a specified
identifier.
IDENTIFIER_FEATURE — to search for feature with a specified
identifier.
§
GET_IDENTIFIER_FROM_REF
Retrieves a component engine identifier and stores the result in a
variable.
Syntax
GET_IDENTIFIER_FROM_REF ref<:in> ident<:out>
Arguments

ref
Name of the reference for which the identifier information should be
searched.

ident
Name of the variable which will receive the content of the component
engine identifier as string content.
Example
USER_SELECT MODEL refMdl
GET_IDENTIFIER_FROM_REF refMdl ident
About Commands for Interfaces
The following commands are available:
TOOLKIT_FUNCTION_CALL — to execute an exported function in a
running Pro/TOOLKIT dll.
TOOLKIT_TASK_EXEC — to execute a function of a SmartAssembly
Toolkit dll.
TK_TASK_EXEC — to execute a function of a Creo Toolkit dll.
JLINK_TASK_EXEC — to execute a function of a J-Link application.
TOOLKIT_FUNCTION_CALL
Creates a button which executes a function of another Pro/TOOLKIT dll
which is running as an auxiliary application.
Syntax
TOOLKIT_FUNCTION_CALL "dll name" "function name" ['tag'] [ARGUMENTS
variable1 variable2]
Arguments

dll name
Name of the dll. The extension '.dll' needs not be included..

function name
Name of the function with should be called inside the dll. The
function must be exported by the following prototype:
extern "C" ProError __declspec(dllexport) function(int nArguments,
TKVariable* pVariables)
'TKVariable' is defined by the following way:
enum TK_VARIABLE_TYPE
{
TK_VARIABLE_INTEGER,
TK_VARIABLE_DOUBLE,
TK_VARIABLE_STRING,
TK_VARIABLE_SELECTION,
};
struct TKVariable
{
TCHAR m_cName[PRO_COMMENT_SIZE];
union _Data
{
int m_nValue;
double m_dValue;
TCHAR m_cValue[PRO_COMMENT_SIZE];
select3d m_sel;
} m_data;
TK_VARIABLE_TYPE m_type;
bool m_bValid;
};

tag
Optional tag, shown in graphical user interface.

ARGUMENTS variable1 variable2


Optional Input/output variables of type parameter or reference.
Example
DECLARE_VARIABLE INT nValue
DECLARE_VARIABLE DOUBLE dValue
nValue = 1
TOOLKIT_FUNCTION_CALL "SampleApplication" "SampleFunction" 1
ARGUMENTS nValue dValue
PRINT "double value: %" dValue
§
TOOLKIT_TASK_EXEC
Creates a button which executes a task of a loaded SmartAssembly
Toolkit dll. The SmartAssembly Toolkit dll must be loaded in the
assembly description block. See About SmartAssembly Toolkit for more
information.
Syntax
TOOLKIT_TASK_EXEC handle<:in> "function" ['tag']
Arguments

handle
Variable which contains the dll handle.

function
Name of the function what should be called in the loaded dll.

tag
Optional tag, shown in graphical user interface.
Example
BEGIN_GUI_DESCR
TOOLKIT_TASK_EXEC handle "SampleFunction" 1
END_GUI_DESCR

BEGIN_ASM_DESCR
! Load the SmartAssembly dll
DECLARE_STRUCT TOOLKIT_DLL tkdll
tkdll.app_name="SampleProgram"
tkdll.exec_file = "lib:\dlls\$PRO_MACHINE_TYPE\Sample.dll"
tkdll.text_dir = "lib:\dlls"
tkdll.user_display = FALSE
TOOLKIT_APP_LOAD tkdll handle

! Execute functions of the loaded dll


CONFIG_ELEM

! Unload the dll


TOOLKIT_APP_UNLOAD handle
END_ASM_DESCR
§
TK_TASK_EXEC
Creates a button which executes a task of a loaded Creo Toolkit dll.
The Creo Toolkit dll must be loaded in the assembly description
block. See About Command for Toolkit applications for more
information.
Syntax
TK_TASK_EXEC handle<:in> "function" arrayInput<:in> arrayOutput<:in>
['tag']
Arguments

handle
Variable which contains the dll handle.

function
Name of the function what should be called in the loaded Creo Toolkit
dll.

arrayInput
Name of the existing array which contains the input variables.
Allowed are variables of the types: integer, double, boolean, string
and reference.

arrayOutput
Name of the variable which will receive the output variables in an
array.

tag
Optional tag, shown in graphical user interface.
Example
BEGIN_GUI_DESCR
TK_TASK_EXEC handle "SampleFunction" arrayInputArguments
arrayOutputArguments 1
END_GUI_DESCR

BEGIN_ASM_DESCR
! Load the Creo Toolkit dll
DECLARE_STRUCT TOOLKIT_DLL tkdll
tkdll.app_name="SampleProgram"
tkdll.exec_file = "lib:\\dlls\\$PRO_MACHINE_TYPE\\Sample.dll"
tkdll.text_dir = "lib:\\dlls"
tkdll.user_display = FALSE
TK_APP_LOAD tkdll handle

! Compose input array


DECLARE_ARRAY arrayArgumentsIn

DECLARE_VARIABLE STRING name


name = "sample"
ADD_ARRAY_ELEM arrayArgumentsIn name

DECLARE_VARIABLE DOUBLE value


value = 3.14
ADD_ARRAY_ELEM arrayArgumentsIn value

! call the graphical user interface


CONFIG_ELEM

! Output result
FOR result REF ARRAY arrayArgumentsOut
PRINT "%" result
END_FOR
! Unload the dll
TK_APP_UNLOAD handle
END_ASM_DESCR
§
JLINK_TASK_EXEC
Creates a button which executes a task of a loaded J-Link
application. The J-Link application must be loaded in the assembly
description block. See About Commands for J-Link Applications for
more information.
Syntax
JLINK_TASK_EXEC handle<:in> "method" arrayInput<:in> arrayOutput<:in>
['tag']
Arguments

handle
Variable which contains the J-Link handle.

method
Name of the method what should be called in the loaded J-Link
application. This method needs to be registered in J-Link via:
com.ptc.pfc.pfcGlobal.GetProESession().RegisterTask();

arrayInput
Name of the existing array which contains the input variables.
Allowed are variables of the types: integer, double, boolean, string
and reference.

arrayOutput
Name of the variable which will receive the output variables in an
array.

tag
Optional tag, shown in graphical user interface.
Example
BEGIN_GUI_DESCR
JLINK_TASK_EXEC handle "SampleFunction" arrayArgumentsIn
arrayArgumentsOut 1
END_GUI_DESCR

BEGIN_ASM_DESCR
! Load the J-Link application
DECLARE_STRUCT JLINK_APP_REGISTRY jlink_app_reg
link_app_reg.app_name="SampleProgram"
jlink_app_reg.java_app_classpath = "lib:\\appl\\bin"
jlink_app_reg.java_app_class = "de.buw.JLinkSample"
jlink_app_reg.text_dir = "lib:\\appl"
jlink_app_reg.user_display = TRUE
JLINK_APP_LOAD jlink_app_reg handle

! Compose input array


DECLARE_ARRAY arrayArgumentsIn

DECLARE_VARIABLE STRING name


name = "sample"
ADD_ARRAY_ELEM arrayArgumentsIn.name

DECLARE_VARIABLE DOUBLE value


value = 3.14
ADD_ARRAY_ELEM arrayArgumentsIn.value

! call the graphical user interface


CONFIG_ELEM

! Output result
FOR result REF ARRAY arrayArgumentsOut
PRINT "%" result
END_FOR

! Unload the J-Link application


JLINK_APP_UNLOAD handle
END_ASM_DESCR
About the Table Description Block.
The table description block is surrounded by the BEGIN_TAB_DESCR and
END_TAB_DESCR keywords. It contains data values which are used to
configure the component. Only the first table is evaluated. In case
the evaluation requires to evaluate a sub table, this is displayed.
In case the associated component contains a parameter or dimension of
the same name, this will be updated after committing the OK button of
the dialog.
Auto selection
Lines of a table are selected automatically if there is exactly one
valid choice. In case the tables belong to different scrip files,
connected via a component description block, no auto selection is
provided to execute the sub component description file.
The following table option can modify this behaviour:
NO_AUTOSEL — to specify that no auto selection should be done.
Note
Table content cells are separated by a tabulator. This is required
since a table can contain empty cells and spaces are allowed.
Parameter variables which have the same name as a Creo Elements/Pro
parameter or dimension will update the model before after the OK
button of the dialog was pressed.
Commands
The following commands are available:
INCLUDE — to include the table description block from another script
file.
Data Table Example
The following example shows a table with sub tables to select
diameter and length from a table. In this situation the available
lengths vary with the selected diameter. The values are stored to the
parameter variables DIA and LEN. Since the entry fields are also
connected to these parameters they are updated after the user
selected a table row.
Dialog
Script file
Data cells are separated by tabulators. In this example the character
'»' symbolized the use of a tabulator.

BEGIN_GUI_DESCR
USER_INPUT_PARAM DOUBLE DIA
USER_INPUT_PARAM DOUBLE LEN
END_GUI_DESCR

BEGIN_TAB_DESCR

BEGIN_TABLE DIA Diameter


SEL_STRING DIA LEN MDL_NAME_1
STRING DOUBLE SUBTABLE STRING
10»10.0»LEN_10_15»SAMPLE_10x
15»15.0»LEN_10_15»SAMPLE_15x
20»20.0»LEN_20_25»SAMPLE_20x
25»25.0»LEN_20_25»SAMPLE_25x
30»30.0»LEN_30_40»SAMPLE_30x
35»35.0»LEN_30_40»SAMPLE_35x
40»40.0»LEN_30_40»SAMPLE_40x
END_TABLE

BEGIN_TABLE LEN_10_15 Length


SEL_STRING LEN MDL_NAME_2
STRING DOUBLE STRING
80»80.0»80
100»100.0»100
120»120.0»120
END_TABLE

BEGIN_TABLE LEN_20_25 Length


SEL_STRING LEN MDL_NAME_2
STRING DOUBLE STRING
100»100.0»100
120»120.0»120
140»140.0»140
END_TABLE

BEGIN_TABLE LEN_30_40 Length


SEL_STRING LEN MDL_NAME_2
STRING DOUBLE STRING
120»120.0»120
140»140.0»140
160»160.0»160
END_TABLE

END_TAB_DESCR

BEGIN_ASM_DESCR
CONFIG_ELEM
END_ASM_DESCR
Data Table Syntax
Syntax
'Table
BEGIN_TABLE TABLE_IDENTIFIER
name'
[TABLE_OPTION option]
SEL_STRING parameter parameter ...
STRING data type data type ...
text line 1 value 11 value 12 ...
text line 2 value 21 value 22 ...
... ... ... ...
END_TABLE
Description

first line
Obligatory keyword BEGIN_TABLE to start the table definition. The
keyword BEGIN_SUBTABLE can also be used, but it is non longer
required to mark a table as a sub table.
The TABLE_IDENTIFIER is used to provide an identifier for a table.
This is important in case of using sub tables via the SUBTABLE
keyword.
Optional table name. In case it is not specified, the
TABLE_IDENTIFIER will be used as name.

second line
This line is optional to specify table options. It starts with the
keyword TABLE_OPTION. The options are following in the same line.
Valid options are:
NO_AUTOSEL — to specify that no auto selection should be done.
NO_FILTER — to specify that no filtering should occur.
DEPEND_ON_INPUT — to update the table selections with respect to
parameters of the graphical user interface.
INVALIDATE_ON_UNSELECT — to invalidate associated parameters of a
table, when the table selection is removed.
SHOW_AUTOSEL — to specify that automatically selected tables should
be displayed.
FILTER_RIGID — to specify that any non valid value is hidden.

FILTER_ONLY_COLUMN columnINT — to declare are column just to be


used for filtering, but not to populate variables. The column
starts numbering with 0 for the first column after the visible one.

FILTER_COLUMN columnINT — to filter just for the content of a


specific column. The column starts numbering with 0 for the first
column after the visible one.

TABLE_HEIGHT columnsINT — to specify the number of visual columns.


The default is 12.
ARRAY — to read the table content from arrays. In this case all
column entries after the forth line are supposed to be array
variables.
third line
This line contains the variable which should receive the selected
data. In the first column the keyword SEL_STRING is obligatory. This
indicates that the first column contains the information which will
be displayed in the table.

forth line
This line contains the data types of the variables. The first cell
must have the data type STRING, since this information shows up in
the table dialog.
The following data type are available:
STRING — to specify a variable of type string parameter.
DOUBLE — to specify a variable of type double parameter.
INTEGER— to specify a variable of type integer parameter.
BOOL— to specify a variable of type boolean parameter.
SUBTABLE— to specify a sub table which has to be evaluated.
SUBCOMP— to specify a sub component which has to be evaluated.
CONFIG_DELETE_IDS— to delete Creo Elements/Pro models with the
specified component ids. The identifiers are separated by a
space.
CONFIG_STATE— to determine by a boolean value if a data set is
selectable.
In some situations it is useful to specify an undefined value, for
example if no sub table should be evaluated in this case. Therefore
the keyword NO_VALUE or just an empty cell can be used.

following lines
The following lines contains the data. All columns are separated by
tabulators, since spaces are valid content. This also means that no
leading tabulators should be applied..

last line
The last line contains the keyword END_TABLE to end the table
definition. The keyword END_SUBTABLE can also be used, but it is non
longer required to mark a table as a sub table.
Note
Table fields may contain spaces. Therefore, the fields are
separated by tabulators.
Table fields called MDL_NAME or MDL_NAME_1, MDL_NAME_2,and so forth
are used to configure the component name in case of option part or
asm in sel_list.txt. Family table instances can by set by use of
the Creo Elements/Pro convention: instance<generic>. Nested family
table instances are specified in the following manner:
instance<generic1><generic2>...<generic_top>.
Undefined data fields could be specified by the value NO_VALUE.
Data Table Processing
Only the first data table is processed. The other tables will only be
considered if they are connected by a SUBTABLE entry.
For evaluating a table the following rules are used.
If only one table line is available, it is selected automatically.
The current content of parameter variables is considered as a
filter mechanism. This behaviour can be changed by the table option
NO_AUTOSEL. In this case a line has also to be selected if only one
choice is possible.
If data type SUBTABLE is in the table, the specified sub table is
processed.
If data type SUBCOMP is in the table, the specified component
description block is processed.
Example

If the line with diameter 20 in table DIA is selected, the row LEN is
configured as sub table LEN_20_25. This sub table is executed and the
user has to select the appropriate length 100, 120 or 140. After this
all required tables are evaluated. Since MDL_NAME_1 and MDL_NAME_2
have been specified, the component name will be renamed. In case of
LEN = 120 the new model name is SAMPLE_20x120.
§
INCLUDE
Includes the table description block from another script file by
specifying the file name. The INCLUDE command should not be written
inside a BEGIN_TABLE ... END_TABLE block.
Syntax
INCLUDE "filename"
Description

filename
File name of the tab file which should be processed. Any string
expression is allowed. In case no extension is specified ".tab" will
be appended automatically.
Note
The script file which should be included, needs not to be declared in
the corresponding sel_list.txt.
Example
INCLUDE tab_file.tab
About the Component Description Block
The component description block is surrounded by the BEGIN_COMP_DESCR
and END_COMP_DESCR keywords. This is processed if a table of the
table description block is evaluated which contains the component
description.
Component Description Syntax
Syntax
BEGIN_SUBCOMP SUBCOMP_IDENTIFIER component ids
name of parameter name of parameter
INPUT_PARAM variable in main variable in sub
component. component.
name of reference name of reference
INPUT_REFERENCE variable in main variable in sub
component. component.
... ... ...
CONFIG_SUBCOMP file name
name of parameter name of parameter
OUTPUT_PARAM variable in main variable in main
component component.
name of reference name of reference
OUTPUT_REFERENCE variable in main variable in main
component component.
... ... ...
END_SUBCOMP
Description

SUBCOMP_IDENTIFIER
Identifier for sub component. This identifier is used inside a table.

component ids:
Creo Elements/Pro ids of component feature. In case more component
ids have to be specified, these should be separated by spaces.

INPUT_PARAM
Imports parameter variable contents from the main component to the
sub component.

INPUT_REFERENCE
Imports reference variable contents from the main component to the
sub component.

CONFIG_SUBCOMP
Specifies the file name of sub component

OUTPUT_PARAM
Exports parameter variable contents from the sub component to the
main component.

OUTPUT_REFERENCE
Exports reference variable contents form the sub component to the
main component.
Component Description Processing
A component table describes the relationship between main and sub
components. Inside the main component there is a table parameter of
the type SUBTABLE. This invokes the component description.
Example

If the line with value 2 is selected the component description SUB1


launches sub_comp1.tab for the component with id 100 and the
component description SUB2 launches sub_comp2.tab for the components
101 and 103. Inside sub_comp1.tab the parameters d1 and d2 have the
value from param1 and param2 of the main component. After
sub_comp2.tab is finished param3 in the main component contains the
value of dia in sub_comp1.tab. The similar mechanism for parameter
variable import and export is applied to sub_comp2.tab.
About the Dependency Description Block
The dependency description block is surrounded by the BEGIN_DEP_DESCR
and END_DEP_DESCR keywords
In case additional files or Creo Elements/Pro models which are not
dependent from the main component should be retrieved in session or
stored to the local project directory, the dependency description
could be used.
All files to be copied needs to be listed with file extension as
separate lines in the BEGIN_DEP_DESCR ... END_DEP_DESCR block. Creo
Elements/Pro version numbers need not to be specified. In case of
Creo Elements/Pro models further dependencies will be established.
Example
BEGIN_DEP_DESCR
sample.mfg
sample.doc
END_DEP_DESCR
Description
Creo Elements/Pro manufacturing model sample.mfg is copied together
will included workpieces, reference models etc. Additionally the Word
document sample.doc is copied to the local project directory.
Specify Model
Several commands of description language need to specify a Creo
Elements/Pro model. This could be done either directly by the use of
a key word or by specification of a reference which is owned by the
model (for example, an edge, a surface, and so forth.).
Example for specification through reference:
In the following example refPoint could be used to indicate the model
which contains the selected point.
USER_SELECT POINT refPoint
SEARCH_MDL_REF refPoint PLANE XY refXY
Syntax direct specification:
THIS: indicates the component part or assembly which is associated
with the tab file. In case of a UDF program, THIS specifies the
project model at the very beginning. When a UDF is inserted, THIS
will be updated to the model which received the UDF.
THIS_ + component number: indicates a sub component of this. The
number is specifying the component id. In case sub-sub-components
are described, the component ids are separated by dots '.'.
ASSEMBLY: indicates the target assembly. This is the current model
before the tab file is launched.
PART : indicates the target part. This is the current model before
tab file is launched. The keyword is mainly used for udf programs.
COMP_FEAT: indicates the component feature of the assembled
component. This specification could only be used after a component
was assembled.
Example

Component Ids for library sub components


The figure above shows component ids of a library component.
THIS: indicates COMPONENT.ASM
THIS_1: indicates SUB_COMPONENT1.ASM
THIS_1.1: indicates PART1.PRT
THIS_1.2: indicates PART2.PRT
THIS_2: indicates SUB_COMPONENT_2.ASM
THIS_2.1 indicates PART3.PRT
THIS_2.2: indicates PART4.PRT
Some commands allow the specification of more that one component (for
example FOR REF INTERF_MDL). In this case a underscore '_' is used to
separate component paths. For example THIS_2.1_2.2 indicates
PART3.PRT and PART4.prt.
PART is only supplied for avoiding confusion of the user. In fact
ASSEMBLY and PART are synonyms. Both are indicating the model which
was current before the tab file was launched.
Specification via reference
A model could also be specified via reference. After selecting a
reference via:
USER_SELECT SURFACE ref_surface
The expression ref_surface could be used to specify the model which
is owning the surface.
Specify Model Type
The following model types are available:
PART
ASSEMBLY
DRAWING
LAYOUT
DWGFORM
MFG
REPORT
MARKUP
DIAGRAM
UNKNOWN
Specify Creo Elements/Pro Feature
Features can either be specified by an existing reference, or through
the keyword COMP_FEAT. This is the last assembled component for part
or assembly programs. In case of udf program, this can alos be the
latest inserted UDF.
Specify Creo Elements/Pro Model Name
In case of renaming a model to a specific name it is often required
to create a specific name based on project shortcut, consecutive
number and content of parameters. The following syntax is available
for this:
# — to use the project short cut of the project.
* — to use the consecutive number. In case the consecutive number
should contain a minimum number of digits use one asterisk per
digit.
*[value] — use the value in brackets as starting number for the
next consecutive number
&(variable) — use the content of the variable.
&([number] variable) — use the content of the variable and specify
the number of digits.
&(variable | value) — use variable if defined. If the variable is
not defined, use the standard value.
$ — place holder for the current model name.
Example
For the examples the project short should be "proj" and it is assumed
that the first available consecutive number is not already in use.
The following variables should exist:
var1 of type DOUBLE with value 12.345.
var2 of type STRING with value "sample".
Format string Result
#-name-* proj-name-1
#-&(var2)-** proj-sample-01
#-&(var1)-**[10] proj-12_345-10
#-&([3]var2)-* proj-sam-1
#-&(var2|something)-* proj-sample-1
#-&(var3|something)-* proj-something-1
Specify File Path
Files used by script programs could be placed with respect to
different locations — either the library or the current working
directory. The following rules explain how to express the correct
path.
File names without any paths are always expected in the current
working directory.
example: sample.txt
Single dots '.' are ignored unless they are in the very first
position. In this case they indicated the current working
directory.
example: .\sample.txt
Paths could be added to specify parent or child directories.
example: ..\sample.txt or subdir\sample.txt
Furthermore the following key words for paths are supported:
lib: — for files which are located in the library path:
If a backslash follows after the colon, the path starts on the root
of the library directory
example lib:\sample.txt or lib:\common\sample.txt
In case no backslash is used, the path starts relatively to the
position of the current tab file:
example: lib:sample.txt, lib:..\sample.txt or
lib:subdir\sample.txt
working_dir:for files with are located relative to the working
directory:
example: working_dir:sample.txt
wtpub: — for files which are located in the Windchill common space:
If a slash follows after the colon, the file is searched in the
specified path in the common space.
example: wtpub://server/Product/my_product/file.txt.
If no slash follows after the colon, the file is searched in the
complete common space.
example: wtpub:file.txt.
wtws: — for files which are located in a Windchill workspace.
If a slash follows after the colon, the file is searched in the
specified workspace.
example: wtws://server/my_workspace/file.txt.
If no slash follows after the colon, the file is searched in the
current workspace.
example: wtws:file.txt
ilcs: — for files which are located in the Intralink 3.4 common
space.
If a slash follows after the colon, the file is searched in the
specified path in the common space.
example: ilcs://server/Product/my_product/file.txt.
If no slash follows after the colon, the file is searched in the
complete common space.
example: ilcs:file.txt.
ilws: — for files which are located in the Intralink 3.4 workspace:
If a slash follows after the colon, the file is searched in the
specified workspace.
example: ilws://server/my_workspace/file.txt.
If no slash follows after the colon, the file is searched in the
current workspace.
example: ilws:file.txt.
Note
While paths are not case sensitive and could be written in upper and
lower characters, the keywords lib:, wtpub:, wtws:, ilcs: and ilws:
must be written in lower cases. Paths or sub paths could be
described by using environment variables.
example $temp\sample.txt
Warning
A common pitfall is to include single backslashes in a path which are
recognized as escape sequences (e.g \t). It is required to use double
backslashes or a verbatim string.
In order to specify the following path:
c:\temp\example
You have to use double backslashes:
path = "c:\\temp\\example"
or use the verbatim string specifier @:
path = @"c:\temp\example"
Specify Parameter Type
The following parameter types are available:
STRING
DOUBLE
INTEGER
BOOL — which is either TRUE or FALSE.
NOTE— The type NOTE can be used to create a parameter for Note ids.
It can be used to create a parameter of type note by
CREATE_MDL_PARAM. Also if the parameter is searched, the command
GET_PARAM_TYPE will show this type.
§
Specify Map Type
The following map types are available:
STRING
DOUBLE
INTEGER
Specify Reference Types
The following reference types are available:
ANNOTATION — all kind of annotations like annotation dimensions,
notes, symbols, geometric tolerances, surface finishes and set
datum tags.
ANNOTATION_DIMENSION — annotation dimensions.
ANNOTATION_ELEMENT — annotations elements.
ASSEMBLY — assembly.
AXIS — datum axis.
AXIS_FACE — datum axis, surface or datum plane.
AXIS_POINT — datum axis or datum point.
COMPONENT — any component model.
COMPOSITE_CURVE — any composite curve.
COMPOSITE_CURVE_PARAM — searches for a composite curve with a
specific parameter.
COMPONENT_MODEL_PARAM — searches for a component model with a
specific model parameter.
COMPONENT_PARAM — searches for a component model with a specific
component parameter.
CSYS — coordinate system.
CSYS_AXIS — coordinate system axis.
CSYS_AXIS_X — coordinate system x-axis.
CSYS_AXIS_Y — coordinate system y-axis.
CSYS_AXIS_Z — coordinate system z-axis.
CURVE — datum curve.
CURVE_END — datum curve end.
CURVE_PARAM — searches for a curve with a specific parameter.
CURVE_START — datum curve start.
DATUM_TAG — datum tag.
DIMENSION — all kind of dimensions. Use ANNOTATION_DIMENSION and
SOLID_DIMENSION to distinguish the types.
DRAWING — search a drawing of the same name as the model.
DRAWING_ENTITY — drawing entities (sketched elements). Search name
is the id.
DRAWING_GTOL — drawing geometric tolerances.
DRAWING_NOTE — drawing notes.
DRAWING_SYMBOL — drawing symbols.
DRAWING_TABLE — selection filter for drawing tables. Search name is
the id.
DRAWING_VIEW — drawing views.
DRAWING_VIEW_AXIS — drawing view axis.
EDGE — edge.
SOLID_EDGE — only solid edges.
CONVEX_EDGE — only convex edges.
CONCAVE_EDGE — only concave edges.
EDGE_END — edge end.
EDGE_PARAM — searches for an edge with a specific parameter.
EDGE_START — edge start.
EXPLODE_STATE — explode state.
FACE — surface or datum plane.
FEATURE — any feature.
FEATURE_PARAM — searches for a feature with a specific parameter.
FEATURE_TYPE — searches for a feature with a specific feature type.
GTOL — geometric tolerance. Search name is the id.
IDENTIFIER — searches for a component or feature with a specific
identifier.
IDENTIFIER_COMPONENT — searches for a component with a specific
identifier.
IDENTIFIER_FEATURE — searches for a feature with a specific
identifier.
INTENT_EDGE — intent edges.
INTENT_SURFACE — intent surfaces.
LAYOUT —layout.
LAYER — layer. This type can be searched, but not selected.
MODEL — part or assembly.
MODEL_COMPONENT_PARAM — searches for a model with a specific
component parameter.
MODEL_PARAM — searches for model with a specific model parameter.
NOTE — assembly or part note.
PART — part.
PLANE — datum plane.
POINT — datum point.
QUILT — surface quilt.
QUILT_PARAM — searches for a quilt with a specific parameter.
QUILT_SURFACE — single surface of a quilt.
SOLID_DIMENSION — solid dimensions which are no annotations.
SOLID_SURFACE — only solid surfaces.
SURFACE — solid or quilt surface.
CONVEX_SURFACE — only convex surfaces.
CONCAVE_SURFACE — only concave surfaces.
SMT_BEND_SURFACE — only sheetmetal bend surfaces.
SURFACE_PARAM — searches for a surface with a specific parameter.
SURFACE_TYPE — searches for a surface of a specific type.
SURFFINISH — solid model surface finish.
SYMBOL — solid model symbol.
BODY — solid body. This is only supported in Creo Parametric 7.0
and above.
FID — number: specifies feature by ID (e.g. FID:4 is feature if id
4, FID_10.20:4 is feature with id 4 in sub component with the ids
10 and 20).
GID — number: specifies geometry by ID (e.g. FID:4 is datum plane
with id 4, GID_10.20:4 is datum plane with the id 4 in the sub
component with the ids 10 and 20).
ID — number: specifies a solid dimension, layer, symbol, note or
geometric tolerance by ID. (e.g. ID:4, ID_10.20:4).

WITH_IDENTIFIER | WITH_IDENTIFIER_NOT "identifier"


This option can be used to filter search results according to an
identifier. The following example shows a typical way of use:
IF ELEM_REDEFINE
GET_IDENTIFIER ident
SEARCH_MDL_REF ASSEMBLY MODEL "*sample*" WITH_IDENTIFIER ident
refSample
END_IF
Parameter related types
Parameter related types require an additional search string. This
affects the following reference types:
COMPONENT_MODEL_PARAM
COMPONENT_PARAM
COMPOSITE_CURVE_PARAM
CURVE_PARAM
EDGE_PARAM
FEATURE_PARAM
MODEL_COMPONENT_PARAM
MODEL_PARAM
QUILT_PARAM
SURFACE_PARAM
For these type the parameter content can additionally be specified by
WITH_CONTENT | WITH_CONTENT_NOT clause.

WITH_CONTENT | WITH_CONTENT_NOT content_type content_value


This is an optional clause for the parameter searching types
COMPONENT_MODEL_PARAM, COMPONENT_PARAM, COMPOSITE_CURVE_PARAM,
CURVE_PARAM, EDGE_PARAM, FEATURE_PARAM, MODEL_COMPONENT_PARAM,
MODEL_PARAM, QUILT_PARAM and SURFACE_PARAM.
Content_type and content_value are specifying which content has to be
searched. Content_type is an parameter type and content value the
searched value or string. In case of content type BOOL, INTEGER or
DOUBLE this value could be computed according the rules for math
equations. For content type STRING this could be any string
expression.
Commands supported in the assembly description block:
CHECK_COMMON_FEAT_PARAM
CHECK_COMMON_MDL_PARAM
DELETE_FEAT_PARAM
DELETE_MDL_PARAM
SEARCH_MDL_REF
SEARCH_MDL_REFS
USER_SELECT
USER_SELECT_OPTIONAL
USER_SELECT_MULTIPLE
USER_SELECT_MULTIPLE_OPTIONAL
Commands supported in the GUI description block:
SEARCH_MDL_REF
USER_SELECT
USER_SELECT_OPTIONAL
USER_SELECT_MULTIPLE
USER_SELECT_MULTIPLE_OPTIONAL

Example
USER_SELECT FEATURE_PARAM "sample*" WITH_CONTENT STRING "*project*"
Specify Surface Type
The following geometrical surface types are available:
PLANE — Flat surface
CYL — Cylindrical surface
CONE — Cone surface
TORUS — Torus surface
COONS — coons patch surface
SPLINE —spline surface
FILLET — fillet surface
RULED_SRF — ruled surface
REV_SRV — General surface or revolution
TABCYL — Tabulated cylinder surface
B_SPLINE — B-Spline surface
FOREIGN — Foreign surface
CYL_SPLINE — Cylindrical spline surface
SPL2DER — Second derivative spline surface.
Specify Surface Setup Type
The following setup surface types are available:
QUILT_SURFACE — Single surface of a quilt.
SOLID_SURFACE — Solid surface.
DATUM— Datum plane.
To following expressions can be used as selection filters:
SURFACE — for QUILT_SURFACE or SOLID_SURFACE.
FACE — for QUILT_SURFACE, SOLID_SURFACE or PLANE.
Note
The GET_REF_TYPE command for all surface types will always return
"SURFACE" as result. Use GET_SURFACE_SETUP_TYPE for retrieving
detailed information of the surface setup.
Specify Sheetmetal Surface Type
he following geometrical surface types are available:
NON_SMT_SURFACE — the surface is not a sheet metal surface.
SIDE_FACE — side surface of a sheet metal part.
GREEN_FACE — green surface of a sheet metal part.
WHITE_FACE — white surface of a sheet metal part.
Specify Curve Type
The following curve types are available:
LINE
ARC
SPLINE
COMP_CURVE
Specify Edge Type
The following edge types are available:
LINE
ARC
SPLINE
Specify Mechanism Type
The following mechanism types are available:
RIGID
PIN
SLIDER
CYLINDER
PLANAR
BALL
WELD
BEARING
GENERAL
6DOF
SLOT
USER_DEFINED
Specify Paper Size
The following types for paper size are available:
A
A0
A1
A2
A3
A4
B
C
D
E
F
VARIABLE_SIZE
Specify Constraints
Constraints are written in following manner:
TYPE [reference_asm<:in> reference_component<:in>] [offsetDOUBLE]
[options]
The first argument is the constraint type. Any string expression
could be used for this.
If the constraint requires placement references, the reference to
the assembly and the reference to the component are following.
Offset value, it case the constraint type requires it.
Additional options for each constraint.
Available constraint types
ALIGN reference_asm<:in> reference_component<:in>
Aligns the references coincident.
ALIGN_FLIP reference_asm<:in> reference_component<:in>
Aligns the references coincident. In case the component could not
be assembled, a MATE constraint is used instead.

ALIGN_OFF reference_asm<:in> reference_component<:in> offsetDOUBLE


Aligns the references with an offset. Any math expression is
allowed to specify the offset.
ALIGN_OFF_FLIP reference_asm<:in> reference_component<:in>
offsetDOUBLE
Aligns the references with an offset. Any math expression is
allowed to specify the offset. In case the component could not be
assembled, a MATE_OFF constraint is used instead.
ALIGN_ORIENT reference_asm<:in> reference_component<:in>
Aligns the references with orientation.
ALIGN_ANGLE_OFF reference_asm<:in> reference_component<:in> angle
Fix rotation of aligned edges by specifying angle for align
constraint. Any math expression is allowed to specify the angle.
ALIGN_ANGLE_OFF_FLIP reference_asm<:in> reference_component<:in>
offsetDOUBLE
Fix rotation of aligned edges by specifying angle for align
constraint. Any math expression is allowed to specify the angle. In
case the component could not be assembled, a MATE_ANGLE_OFF
constraint is used instead.
INSERT reference_asm<:in> reference_component<:in>
Inserts one surface in another.
MATE reference_asm<:in> reference_component<:in>
Mates the references coincident.
MATE_FLIP reference_asm<:in> reference_component<:in>
Mates the references coincident. In case the component could not be
assembled, a ALIGN constraint is used instead.

MATE_OFF reference_asm<:in> reference_component<:in> offsetDOUBLE


Mates the references with an offset. Any math expression is allowed
to specify the offset.
MATE_OFF_FLIP reference_asm<:in> reference_component<:in>
offsetDOUBLE
Aligns the references with an offset. Any math expression is
allowed to specify the offset. In case the component could not be
assembled, a ALIGN_OFF constraint is used instead.
MATE_ORIENT reference_asm<:in> reference_component<:in>
Mates the references with orientation.
MATE_ANGLE_OFF reference_asm<:in> reference_component<:in>
offsetDOUBLE
Fix rotation of aligned edges by specifying angle for mate
constraint. Any math expression is allowed to specify the angle.
MATE_ANGLE_OFF_FLIP reference_asm<:in> reference_component<:in>
offsetDOUBLE
Fix rotation of aligned edges by specifying angle for mate
constraint. Any math expression is allowed to specify the angle. In
case the component could not be assembled, a ALIGN_ANGLE_OFF
constraint is used instead.
ORIENT reference_asm<:in> reference_component<:in>
Aligns the references with orientation. Synonym for ALIGN_ORIENT.
ORIENT_FLIP reference_asm<:in> reference_component<:in>
Aligns the references with orientation. In case the component could
not be assembled, a MATE_ORIENT constraint is used instead.
PNT_ON_LINE reference_asm<:in> reference_component<:in>
Places a point on a line.
PNT_ON_SRF reference_asm<:in> reference_component<:in>
Places a point on a surface.
EDGE_ON_SRF reference_asm<:in> reference_component<:in>
Places an edge on a surface.
CSYS reference_asm<:in> reference_component<:in>
Aligns two coordinate systems.
TANGENT reference_asm<:in> reference_component<:in>
Makes two surfaces tangent.
FIX
Locate component at the current location.
DEFAULT
Locate component at the default location.
PACKAGED
Locate component without any placement constraint.
EDIT_CONSTRAINTS
Shows up the assembly constraints interface and allows to add.
modify and remove further constraints.
BULK
Locate bulk items without any placement constraint.

New constraint types since Creo Parametric:


CENTERED reference_asm<:in> reference_component<:in>
Centers two coordinate systems.
LINE_NORMAL reference_asm<:in> reference_component<:in>
Orients edges and axis normal to each other.
LINE_COPLANAR reference_asm<:in> reference_component<:in>
Orients edges and axis coplanar to each other.
LINE_PARALLEL reference_asm<:in> reference_component<:in>
Orients edges and axis parallel to each other.

LINE_OFF reference_asm<:in> reference_component<:in> offsetDOUBLE


Aligns edge and axis with an offset.
PNT_OFF reference_asm<:in> reference_component<:in>
Aligns two points with an offset.
INSERT_NORMAL reference_asm<:in> reference_component<:in>
Inserts one surface normal to each other.
INSERT_PARALLEL reference_asm<:in> reference_component<:in>
Inserts one surface parallel to each other.
PNT_ON_LINE_OFF reference_asm<:in> reference_component<:in>
offsetDOUBLE
Places a point on a line with an offset.
PNT_ON_SRF_OFF reference_asm<:in> reference_component<:in>
offsetDOUBLE
Places a point on a surface with an offset.
EDGE_ON_SRF_OFF reference_asm<:in> reference_component<:in>
offsetDOUBLE
Places an edge on a surface with an offset.
EDGE_ON_SRF_ANGLE_OFF reference_asm<:in> reference_component<:in>
offsetDOUBLE
Aligns an edge on a surface with an angle.
EDGE_ON_SRF_NORMAL reference_asm<:in> reference_component<:in>
Orients an edge normal to a surface.
LINE_ANGLE_OFF reference_asm<:in> reference_component<:in>
offsetDOUBLE
Orients edges and axis coplanar to each other with an angle.
EDGE_ON_SRF_PARALLEL reference_asm<:in> reference_component<:in>
Makes an edge parallel to surface.
SRF_NORMAL reference_asm<:in> reference_component<:in>
Orients one surface normal to another.
Additional constraint options:
The following options are available:
ACTIVE activeBOOL — sets the state of the constraint to active or
not active.
Note
Only one of the flip constraints (ALIGN_FLIP, ALIGN_OFF_FLIP,
ALIGN_ANGLE_OFF_FLIP, MATE_FLIP, MATE_OFF_FLIP, MATE_ANGLE_OFF_FLIP,
ORIENT_FLIP) is regarded. In case multiple flip constraints are
specified, the last one is used.
If no placement constraint at all is specified the user will be asked
for constraints. Use constraint PACKAGED to avoid this.
Specify Constraint Sets
Constraint sets are defined in the following manner:
BEGIN_CONSTRAINT_SET [MECHANISM mechanismType] [ACTIVE activeBOOL]
CONSTRAINT 1
CONSTRAINT 2
...
END_CONSTRAINT_SET
Arguments

MECHANISM mechanismType
Optional mechanism declaration.

ACTIVE activeBOOL
Sets the state of the constraint to active or not active.

Constraints
Multiple constraints can be defined. More information is in the
chapter how to specify constraints.
Note
Empty constraint sets without any constraints are disregarded.
Example
BEGIN_CONSTRAINT_SET MECHANISM PIN ACTIVE TRUE
ALIGN asmPin compPin
END_CONSTRAINT_SET
Specify UDF Constraints
The following UDF constraints types are available:
UDF_INSTANCE "instance name"
Create UDF family table instance with name "instance name".
In the structure UDF_CONSTRAINT the following fields are used: type
and name.
UDF_REF 'symbol name' reference <:in>
Assigns an reference as UDF reference with name "symbol name".
In the structure UDF_CONSTRAINT the following fields are used:type,
name and reference_in.

UDF_DIM 'symbol name' value DOUBLE


Assigns a dimension as UDF variable dimension with name "symbol
name".
In the structure UDF_CONSTRAINT the following fields are used:
type, name and value.

UDF_DIM_ANGLE 'symbol name' value DOUBLE


Assigns an angular dimension as UDF variable dimension with name
"symbol name". This command is only required if mixed units should
be used and a conversion between metric and inch values should be
avoided for angular dimensions. In all other cases UDF_DIM could be
used instead.
In the structure UDF_CONSTRAINT the following fields are used:
type, name and value.

UDF_PARAM 'param name' value DOUBLE


Assigns a parameter as UDF variable parameter with the name "param
name". Before Pro/ENGINEER Wildfire 4.0 this option does not have
any effect.
In the structure UDF_CONSTRAINT the following fields are used:
type, name and value.

UDF_UNIT_PARAM 'param name' value DOUBLE


Assigns a parameter as UDF unit sensitive variable parameter with
the name "param name". This command is only required, if mixed
units should be used and a conversion between metric and inch
values should be calculated. Before Pro/ENGINEER Wildfire 4.0 this
option does not have any effect.
In the structure UDF_CONSTRAINT the following fields are used:
type, name and value.

UDF_NUMBER 'symbol name' value INT


Assigns an integer parameter as UDF variable dimension with name
"symbol name". This is typically used for patterns inside an UDF.
In the structure UDF_CONSTRAINT the following fields are used:
type, name and value.
UDF_EXP_PARAM 'symbol name' [parameter<:out>]
Exports an UDF parameter or dimension as parameter which is
accessible after the UDF was created. In case the optional name of
the parameter was not defined the "symbol name" is used as name for
the new parameter.
In the structure UDF_CONSTRAINT the following fields are used:
type, name and optional output_name.

UDF_EXP_REF reference<:out> ref_type value INT


Exports an UDF reference by specifying type and feature number in
the created group. The feature number starts with 0 for the first
feature.
In the structure UDF_CONSTRAINT the following fields are used:
type, name, ref_type, output_name and value.
UDF_EXP_DIM_REF reference<:out> 'dimension_name'
Exports an UDF dimension as reference.
In the structure UDF_CONSTRAINT the following fields are used:
type, name and output_name.
UDF_EXP_DIM_NAME parameter<:out> 'dimension_name'
Exports symbolic name associated with UDF dimension as parameter.
This parameter could be used for example to create relations
accessing dimensions created by the UDF.
In the structure UDF_CONSTRAINT the following fields are used:
type, name and output_name.

UDF_REORDER_NR value INT


Reorders the UDF group after creation to a specified position. The
command REORDER_FEATURES provides more flexibility for reordering.
In the structure UDF_CONSTRAINT the following fields are used: type
and value.
UDF_CHECK_FOR_SURFACE_FEATURES group_menber1 INT [group_member2 INT
..]
The command accepts an arbitrary number of group members. Each
specified member is checked if it creates solid surfaces. In case
no solid surface is created the UDF is removed. The feature
numbering starts with 0. In case of a negative number, all group
members are considered.
Use this command to avoid material cuts which do not remove
geometry.
In the structure UDF_CONSTRAINT the following fields are used: type
and array_check_for_surface_features.
UDF_ORIENTATION orient
Specified orientation suggestions for the UDF. Valid values are
FLIP, NO_FLIP and INTERACTIVE. Specified constraints are evaluated
due to their ordering. Orientations which are not specified will be
handled as standard orientations. In most cases UDFs could be
created without specifying the orientations.
In the structure UDF_CONSTRAINT the following fields are used: type
and orientation.
Passing multiple FLIP / NO_FLIP orientations, is currently not
working reliable since there is a known Creo/TOOLKIT limitation.
See PTC article CS258027 for more information.
UDF_INTERSECTION * | reference<:in>|array_references<:in>
[visibility mode]
Specifies intersections for assembly level cuts. They could either
be specified by a reference for each model, by an array of
references or by an asterisk '*' which indicates that the
intersections are updated automatically.
Optionally the visibility mode for assembly cuts can bet set as
ASSEMBLY_LEVEL or PART_LEVEL. In case no mode is set,
ASSEMBLY_LEVEL is default.
In the structure UDF_CONSTRAINT the following fields are used:
type, intersection, intersection_level and automatic_intersection.
UDF_DEFAULT_BODY reference<:in>
Specifies the default body which should be used for the UDF.
In the structure UDF_CONSTRAINT the following fields are used:
type, and reference_in.
Specify Names by Wildcards
In case of searching for references, names could be specified by the
specific wildcard symbols asterisk '*' and question mark '?'.
Asterisk '*': is a wildcard for any number of characters — also for
zero characters.
Question mark '?': is a wildcard for exactly one character.
Examples
The name example_model matches to the following expressions:
*ample*
??ample_model
*example_model*
example*_model
but it does not match to the expressions:
?example_model
example?_model
Specify Simplified Representation Type
Standard simplified representations are specified by their type.
Use MASTER for master representation.
Use DEFAULT for default representation.
Use GRAPHICS for symbolic representation.
Use GEOMETRY for geometry representation.
Use SYMBOLIC for graphics representation.
Use BOUNDBOX for a bounding box representation since Pro/ENGINEER
Wildfire 5.0.
Use DEFAULT_ENVELOPE for a default envelope representation since
Creo Parametric 1.0.
Use LIGHT_GRAPHICS for a light graphics representation since Creo
Parametric 1.0.
User defined representations are specified by their name. Any string
expression could be used for this.
Specify Simplified Default Representation Action
User defined representations have a default action, which is one of
the following:
INCLUDE — for the master representation. All non specified
components are resumed.
EXCLUDE — all non specified components are suppressed.
GEOMETRY — for the geometry representation.
GRAPHICS — for the graphics representation.
DEFAULT_ENVELOPE — for the default envelope representation.
LIGHT_GRAPHICS — for the light graphics representation.
Specify Style Type
Standard styles are specified by their type.
Use MASTER for master style.
Use DEFAULT for default style.
User defined stlyes are specified by their name. Any string
expression could be used for this.
§
Specify Array Indices
More dimensional arrays could be build up by adding arrays as element
to another array. For several commands it is important to have a
technique to access a sub array directly. This is possible by the use
of array indices.
Indices are build up by a number in brackets. In case more than one
index is required, everyone is surrounded by brackets.
Example for one dimensional index: [0]
Example for two dimensional index: [0][1]
Indices could be specified by number, but also by a math expression.
Note
Array indices start with 0 for the first element.
Example
The following example shows the index [2][1].
Specify Fonts
Font names in Creo Elements/Pro can have internal different names as
they show up in the user interface for example when setting the note
properties on drawings.
build in fonts: are tagged with the Creo Elements/Pro logo. The
name which appears in the user dialog can be used to specify this
font.
true type fonts: are tagged with the symbol for true type fonts.
Their display name is different from the font name. The font name
could be found in: <Creo Elements/Pro>\text or <Creo
Elements/Pro>\text\fonts.
Translation table for true type fonts
The following table helps to find the right true type font to the
displayed font name:
Display name True Type Font Display Name True Type Font

Microstyle Extended
Blueprint MT bluprnt microexb
Bold
Blueprint MT
bluprntb Neograph MT neograph
Bold
CG Omega cgomg SackersEnglishScript sackengs
CG Omega Bold cgomgbd CG Century Schbk schlbk
CG Omega Bold CG Century Schbk
cgomgbi schlbkb
Italic Bold
CG Omega CG Century Schbk
cgomgit schlbkbi
Italic Bold Italic
CG Century Schbk
CG Times cgtime schlbki
Italic
CG Times Bold cgtimebd Shannon shanno
CG Times Bold
cgtimebi Shannon Bold shannob
Italic
CG Times
cgtimeit Shannon Extra Bold shannoeb
Italic
Garamond garamd Shannon Oblique shannoo
Garamond Bold garamdb Sparton One Two MT spart12
Garamond Bold Sparton One Two MT
garamdbi spart12b
Italic Bold
Garamond
garamdi Sparton Four MT sparton4
Italic
Garph Graphic gargra Symbol symbol
Garph Graphic CG Trimumvirate
gargrabi triin
Bold Italic Inserat
Garph Graphic
gargrabl CG Trimumvirate trium
Black
Garph Graphic gargrai CG Trimumvirate Bold triumb
CG Trimumvirate Bold
Grotesque MT grotesq triumbi
Italic
Grotesque MT CG Trimumvirate
grotesqb triumcb
Bold Condensed Bold
Microstyle CG Trimumvirate
microex triumi
Extended Italic
Specify Line Fonts
Line fonts can be applied to curves and composite curves. The
following line fonts are available:
SOLIDFONT
DOTFONT
CTRLFONT
PHANTOMFONT
DASHFONT
CTRLFONT_S_L
CTRLFONT_L_L
CTRLFONT_S_S
DASHFONT_S_S
PHANTOMFONT_S_S
CTRLFONT_MID_L
INTMIT_LWW_HIDDEN
PDFHIDDEN_FONT
DOT_CTRL_FONT
Specify Screen Location
The following screen location definitions are available:
TOP_LEFT — defines the upper left corner of the screen.
TOP_CENTER — defines the horizontal center position on the upper
edge of the screen.
TOP_RIGHT — defines the upper right corner of the screen.
CENTER_LEFT — defines the vertical center on the left side of the
screen.
CENTER — defines the center position of the screen.
CENTER_RIGHT — defines the vertical center of the right side of the
screen.
BOTTOM_LEFT — defines the lower left corner of the screen.
BOTTOM_CENTER — defines horizontal center position on the lower
edge of the screen.
BOTTOM_RIGHT — defines the lower right corner of the screen.
§
Specify Collection Type
To select surface sets or curve and edge chains the following
collection types are available:
SURFACE — to select surface sets.
INTENT_SURFACE — to select intent surface sets.
EDGE — to select edge chains.
CURVE — to select curves.
§
Specify Collection Method
When selecting collections the following methods could be used.
For surface sets:
SURFACE_ALLOW_ALL — use the standard settings for collecting
surface sets.
SURFACE_DISALLOW_QLT — disallows to select quilt surfaces.
SURFACE_DISALLOW_SLD — disallows to select solid surfaces.
SURFACE_DONT_MIX — allows either solid or quilt surfaces, but not
both types.
SURFACE_SAME_SRF_LST — only allows to select surfaces from the same
model.
SURFACE_DISALLOW_INTEND — disallows to select intent surfaces.
For edge and curve chains:
CHAIN_ALLOW_ALL — allows all options.
CHAIN_ONE_BY_ONE — allows one-by-one selection.
CHAIN_TAN_CHAIN — allows to select tangent chains.
CHAIN_CURVE_CHAIN — allows to select curve chains.
CHAIN_BNDRY_CHAIN — allows to select boundary loops.
CHAIN_SURF_CHAIN — allows to select surface chains.
CHAIN_INTENT_EDGE — allows to select intent edges.
CHAIN_FROM_TO — allows to select from-to chains.
§
Specify Leader Arrow Type
The following arrow types for leaders are supported:
ARROW_HEAD
DOT
FILLED_DOT
NO_ARROW
CROSS
SLASH
INTEGRAL
BOX
FILLED_BOX
DOUBLE_ARROW
TARGET
LEFT_HALF
RIGHT_HALF
TRIANGLE
AUTOMATIC
§
Specify Feature Dependency
The following feature dependencies are supported for date sharing
features:
DEPENDENT — Since Creo 3.0 this option is called Automatic Update
in the user interface.
INDEPENDENT — Since Creo 3.0 this option is called Manual Update in
the user interface.
NO_DEPENDENCY — This option is new for Creo 3.0. In previous
versions INDEPENDENT will be used instead.
§
Specify Feature Update Notification
The feature update notification can only be set since 3.0 in case the
Creo license option 332 Update_Control is available.
NOTIFICATION_OFF— Since Creo 3.0 this option is called Automatic
Update in the user interface.
NOTIFICATION_ON— Since Creo 3.0 this option is called Manual Update
in the user interface.
Specify Structures
Structures are collections of variables which a specific name. Each
variable is a element of the structure and could have any of the
existing variable types. To access a element of the structure a dot
'.' is required.
The following structures are available:
POINT — the point structure contains the elements x, y and z for
the different directions.
x — parameter of type double.
y — parameter of type double.
z — parameter of type double.
UV_PARAM — the uv parameter structure contains the elements u and v
for 2d uv coordinates on surfaces, edges or curves. For edge and
curve parameterization, only the u parameter is used.
u — parameter of type double.
v — parameter of type double.
LINE — the line structure describes a line by two points.
pnt_from — structure of type POINT for the start point.
pnt_to — structure of type POINT for the end point.
ARC — the arc structure describes an arc by start-, end- and center
point and radius
pnt_from — structure of type POINT for the start point.
pnt_to — structure of type POINT for the end point.
pnt_center — structure of type POINT for the center point.
radius — for the radius.
AXIS — the axis structure describes an axis by origin and direction
vector.
origin — structure of type POINT for the axis origin.
direction — structure of type VECTOR for the direction.
VECTOR— the vector structure contains the elements x, y and z for
the different directions.
x — parameter of type double.
y — parameter of type double.
z — parameter of type double.
BOX — the box structure contains the upper and lower coordinates of
the a box.
x1 — parameter for the lower x coordinate.
y1 — parameter for the lower y coordinate.
z1 — parameter for the lower z coordinate.
x2 — parameter for the upper x coordinate.
y2 — parameter for the upper y coordinate.
z2 — parameter for the upper z coordinate.
MATRIX — the matrix structure contains the elements m11 to m34 of a
3x4 matrix (3 rows, 4 columns).
m11 — matrix element of type double, first row, first column.
m12 — matrix element of type double, first row, second column.
m13 — matrix element of type double, first row, third column.
m14 — matrix element of type double, first row, forth column.
m21 — matrix element of type double, second row, first column.
m22 — matrix element of type double, second row, second column.
m23 — matrix element of type double, second row, third column.
m24 — matrix element of type double, second row, forth column.
m31 — matrix element of type double, third row, first column.
m32 — matrix element of type double, third row, second column.
m33 — matrix element of type double, third row, third column.
m34 — matrix element of type double, third row, forth column.
FRACTION — the fraction structure contains the results of a
fraction calculation as numbers and as a string.
integer — the integer number of a fraction.
remainder — the remainder of a fraction.
denominator — the denominator of a fraction.
fraction_string — the string of a fraction.
TEXT_MATCH — the text match structure contains position, length and
the found text from a regular expression pattern. Also specified
sub matches are contained.
position — position of the found text in the searched string.
Default is 0.
length — length of the found text in the searched string. Default
is 0.
text — found text in the searched string. Default is an empty
string.
array_sub_matches — array of sub matches. The elements are of
type TEXT_SUB_MATCH.
TEXT_SUB_MATCH — the text sub match structure contains position,
length and the found text from a sub match of a regular expression
pattern.
position — position of the found text of a sub match in the
searched string. Default is 0.
length — length of the found text of a sub match in the searched
string. Default is 0.
text — found text of a sub match in the searched string. Default
is an empty string.
COLOR — the color structure contains the elements red, green and
blue for color specification.
red — parameter of type double. Range is 0 to 255. Default is 0.
green — parameter of type double. Range is 0 to 255. Default is
0.
blue — parameter of type double. Range is 0 to 255. Default is 0.
COLOR_PROPS — the color properties.
color — structure of type COLOR.
color_intensity — parameter of type double. Range is 0 to 100.
Default is 90.
color_ambient — parameter of type double. Range is 0 to 100.
Default is 90.
highlight_color — structure of type COLOR.
highlight_shininess — parameter of type double. Range is 0 to
100. Default is 50.
highlight_intensity — parameter of type double. Range is 0 to
100. Default is 80.
reflection — parameter of type double. Range is 0 to 100. Default
is 90.
transparency — parameter of type double. Range is 0 to 100.
Default is 0.
name — variable of type string contains the name of the color.
This is supported only for Creo 2.0 and above. Default is an
empty string.
Note: name relates to the material_name in the appearance.dmt file.
This does not show up in the Creo appearance manager.
label— variable of type string contains the label of the color.
This is supported only for Creo 2.0 and above. Default is an
empty string.
Note: label relates to the material_label in the appearance.dmt
file. In the Creo appearance manager this is shown as name.
description — variable of type string contains the description of
the color. This is supported only for Creo 2.0 and above. Default
is an empty string.
keywords — variable of type string contains the keywords of the
color. This is supported only for Creo 2.0 and above. Default is
an empty string.
TEXTURE_PROPS — the texture properties.
bump — string variable for the image name used for bump mapping.
color_texture — string variable for the image name used for
texture mapping.
decal —string variable for the image name used for decal.
TEXTURE_PLACEMENT_PROPS —the texture placement properties.
scale_x — variable of type double for scaling of the texture in x
direction. Default is 0.
scale_y — variable of type double for scaling of the texture in y
direction. Default is 0.
pos_x — variable of type double for positioning of the texture in
x direction. Default is 0.
pos_y — variable of type double positioning of the texture in y
direction. Default is 0.
rotate — variable of type double rotation of the texture. Default
is 0.
flip_vertical — variable of type boolean for flipping the texture
in vertical direction. Default is FALSE.
flip_horizontal — variable of type boolean for flipping the
texture in horizontal direction. Default is FALSE.
TEXT_COLOR — the structure for text colors defined by name or by
rgb values.
by_name — boolean value configuring if a color is defined by
name. Default is TRUE.
color_name — string value in case the color is defined by name.
Valid names are GEOMETRY, HIDDENLINE, SKETCH, CURVE, QUILT,
MANUFACTURING_VOLUME, SHEETMETAL, DATUM, LETTER,
PRIMARY_HIGHLIGHT, SECONDARY_HIGHLIGHT and EDGE_HIGHLIGHT.
Default is LETTER.
color_rgb — structure of type COLOR in case the color is defined
by rgb values.
TEXT_STYLE — the structure for text style information.
height — double value for height. Use -1.0 for the default value.
Default is -1.0.
thickness — double value for thickness. Use -1.0 for the default
value. Default is -1.0. Use 0.23 for bold formatting.
width_factor — double value for the width factor. Use -1.0 for
the default value. Default is -1.0.
slant_angle — double value for the slant angle. Default is 0.0.
Use 15.0 for italic formatting.
underline — boolean value for underlining. Default is FALSE.
horz_justification — string value for the horizontal
justification. Values are LEFT, CENTER, RIGHT and DEFAULT.
Default is DEFAULT.
vert_justification — string value for the vertical justification.
Values are TOP, MIDDLE, BOTTOM and DEFAULT. Default is DEFAULT.
angle — double value for angle. Default is 0.0.
color — structure of type TEXT_COLOR defining the color.
mirror — boolean value for mirroring. Default is FALSE.
font — string variable for the font. Only used for notes. Default
is an empty string.
INTERFERENCE — the interference structure contains the elements
model1 and model2 for the colliding models and volume for the
interference volume.
model1 — reference to the first model.
model2 — reference to the second model.
volume — parameter of type double.
CLEARANCE — the clearance structure contains the results of a
clearance calculation between two references.
result— boolean variable contains the information whether the
clearance could be calculated. This is false for example if a
part has no geometry.
distance — double variable contains the distance of the two
references.
interference — boolean variable contains the information whether
there is an intersection or not.
interf_volume — double variable contains the interference volume.
pnt_in_ref1 — structure of type POINT for the closest point in
the model of ref1.
pnt_in_ref2 — structure of type POINT for the closest point in
the model of ref2.
RAY_INTERSECTION — the ray_intersection structure contains the
following elements:
model — reference to the model which is intersected by the ray.
surface_in — reference to the surface in which the ray intrudes.
surface_out — reference to the surface in which the ray extrudes.
pnt_in — structure of type POINT for the intrusion point.
pnt_out — structure of type POINT for the extrusion point.
distance — distance between intrusion and extrusion point.
CONTOUR — the contour structure contains information about the
traversal orientation and the contour edges.
type— type of the contour. Either INTERNAL or EXTERNAL.
array_edges — array of references to the edges.
TRANSFORMATION — the transformation between two models or
coordinate systems:
trans_x — parameter of translation in x direction.
trans_y— parameter of translation in y direction.
trans_z — parameter of translation in z direction.
rot_x — parameter of rotation around the x axis.
rot_y — parameter of rotation around the y axis.
rot_z — parameter of rotation around the z axis.
MDLCHECK_OPTION — options for a ModelCHECK analysis.
show_results — boolean parameter determines whether the result is
displayed in the browser. Default is TRUE.
graphics — boolean parameter determines whether model check
should be processed in interactive model with graphics or not.
Default is TRUE.
config_dir — string parameter determines the location of the
configuration directory. In case it is empty the default
configuration directory is used.
The config_dir must not include the directory "config". Default
is empty.
output_dir — string parameter determines the location of the
output directory. In case it is empty, the default output
directory is used. Default is empty.
MDLCHECK_RESULT — results of a ModelCHECK analysis.
num_errors — integer parameter receives the number of errors
after the ModelCHECK analysis was performed.
num_warnings — integer parameter receives the number of warning
after the ModelCHECK analysis was performed.
mdl_saved — boolean parameter receives the information whether
the model was saved during the ModelCHECK analysis.
DRAWING_OPTIONS — the options of a drawing:
All drawing options are supported. Numbers are of type double. All
other options are encoded as strings.
MDL_DTL_OPTIONS — the detail option of a solid model:
All model detail options are supported. All values are encoded as
strings.
FEMMESH_OPTION — the options for exporting finite element mesh
files.
mesh_type — type of the mesh. Default is SOLID_MESH
SOLID_MESH — mesh solid parts using tetrahedral solid mesh
elements.
SHELL_MESH — shell mesh using triangular or quadrangular mesh
elements. This type is designed for meshing surfaces.
MIXED_MESH — mesh models with a mixture of shell and tetrahedral
mesh elements.
QUILT_MESH — a mesh for any simple or advanced shell
idealizations created for quilt surfaces.
BOUNDARY_MESH — a shell mesh of triangular or quadrilateral
elements on the model's exterior surfaces.
BAR_MESH — a bar mesh for one dimensional idealizations.
shell_type — type of the shell element. For a solid mesh this
type is ignored. Default is SHELL_MESH_TRIANGLE.
SHELL_MESH_TRIANGLE — for triangle meshes.
SHELL_MESH_QUADRANGLE — for quadrangle meshes.
quilt_ref_arr — array of quilt surface references
analysis — type of the analysis. Default is ANALYSIS_STRUCTURAL.
ANALYSIS_STRUCTURAL — structural analysis, including stress,
strain, thermal stress, and displacement.
ANALYSIS_MODAL — modal analysis, including the constraint sets
applied to the model.
ANALYSIS_THERMAL — thermal analysis, including temperature, heat
flux, and heat gradient.
elem_shape — type of the element for the solver. Default is
MIDPNT_LINEAR.
MIDPNT_LINEAR — linear elements are used for the analysis. This
includes corner nodes, straight edges, and planar faces.
MIDPNT_PARABOLIC — parabolic elements are used for the analysis.
MIDPNT_PARABOLIC_FIXED — the excessively curved edges of solid
and shell mesh parabolic elements are slightly straightened and
then used for analysis.
solver — type of the solver. Default is FEAS_NASTRAN.
FEAS_NEUTRAL — use neutral solver.
FEAS_ANSYS — use ANSYS solver.
FEAS_NASTRAN — use NASTRAN solver.
FEAS_ABAQUS — use ABAQUS solver.
csys_ref — coordinate system.
aux_csys_ref_arr — additional coordinate systems.
UNIT_SYSTEM — properties of a unit system in a model.
name — string variable to define the name of the unit system.
Default is an empty string.
is_mlt — boolean variable to distinguish between mass-length-time
(MLT) and Force-length-time (FLT) systems. Default is TRUE for an
MLT system.
mass — string variable to define the mass unit. Default is lbm.
All mass unit types defined in the model can be used.
force — string variable to define the force unit. Default is lbf.
All force unit types defined in the model can be used.
length — string variable to define the length unit. Default is
in. All length unit types defined in the model can be used.
time — string variable to define the time unit. Default is sec.
All time unit types defined in the model can be used.
MATERIAL — material properties.
name — name of the material.
young_modulus — double variable. Default is 0.0.
poisson_ratio — double variable. Default is 0.0.
shear_modulus — double variable. Default is 0.0.
mass_density — double variable. Default is 1.0.
therm_exp_coef — double variable. Default is 0.0.
therm_exp_ref_temp — double variable. Default is 0.0.
struct_damp_coef — double variable. Default is 0.0.
stress_lim_tension — double variable. Default is 0.0.
stress_lim_compress — double variable. Default is 0.0.
stress_lim_shear — double variable. Default is 0.0.
therm_conductivity — double variable. Default is 0.0.
emissivity — double variable. Default is 0.0.
specific_heat — double variable. Default is 0.0.
hardness — double variable. Default is 0.0.
condition — double variable. Default is 0.0.
init_bend_y_factor — double variable. Default is 0.0.
bend_table — double variable. Default is 0.0.
MASS_PROPERTIES — material properties from Analysis > Model
Analysis > Model Mass Properties.
volume — the solid volume, parameter of type double.
surface_area — the area of all surfaces, parameter of type
double.
density — the density, parameter of type double.
mass — the mass, parameter of type double.
center_of_gravity — center of gravity as structure of type
VECTOR.
coor_sys_inertia — inertia matrix a structure of type MATRIX.
This value does not show up in Creo Elements/Pro.
coor_sys_inertia_tensor — inertia tensor concerning the specified
coordinate system as structure of type MATRIX.
cg_inertia_tensor — inertia tensor concerning the center of
gravity as structure of type MATRIX.
principal_moments — principal moments of inertia as structure of
type VECTOR.
principal_axes — principal axis as structure of type MATRIX.
EXT_REF — properties of feature dependencies.
mdl_from — reference to model which owns the dependency.
feature_from — reference to feature which owns the dependency.
mdl_to — reference to model which is the dependency target.
feature_to — reference to feature which is the dependency
target.
item_to — reference to geometry item which is the dependency
target.
state — string parameter of the dependency state. See
GET_REF_STATE for possible values.
TOOLKIT_DLL — properties for a Pro/TOOLKIT dll similar to the
content of protk.dat files.
app_name — name of the application as string parameter. This will
appear in the auxiliary application dialog if user_display is
set.
exec_file — path to the application as string parameter including
the dll name.
text_dir — path to the text directory as string parameter. The
directory "text" should be a child of this path.
user_display — boolean parameter TRUE or FALSE to specify if the
application is listed as auxiliary application.
JLINK_APP_REGISTRY — properties for a J-Link application similar to
the content of protk.dat files.
app_name — name of the application as string parameter. This
will appear in the auxiliary application dialog if user_display
is set.
java_app_class — fully qualified package and name of a Java class
as string parameter. This class contains the J-Link applications
start and stop methods.
java_app_classpath — path to the J-Link class as string
parameter.
java_app_start — name of the start method as string parameter.
Default is start.
java_app_stop — name of the stop method as string parameter.
Default is stop.
text_dir — path to the text directory as string parameter. The
directory "text" should be a child of this path.
user_display — boolean parameter TRUE or FALSE to specify if the
application is listed as auxiliary application.
COPY_GEOMETRY_OPTION — properties for creating a copy geometry
feature.
external — boolean parameter for internal or external placement.
Default is FALSE.
use_published_geometry — boolean parameter determines if a
published geometry or geometry references should be used. Default
is TRUE.
local_placement_csys — reference to local coordinate system for
placement. Only used for external copy geoms. If not defined,
default placement is used.
external_placement_csys — reference to external coordinate system
for placement. Only used for external copy geoms. If not defined,
default placement is used.
references — array of geometry references. Only used if
use_published_geometry is set to FALSE.
bodies — array of body references for Creo 7.0 and above. Only
used if use_published_geometry is set to FALSE.
ref_published_geometry — reference to a published geometry
feature. Only used if use_published_geometry is set to TRUE.
dependent — boolean parameter for dependency. Default is TRUE.
This variable is only used in case geometry_update is an empty
string.
geometry_update — string variable for new dependency. Valid
values are listed in the feature dependency specification. In
case of an empty string the variable dependent is used. Default
is an empty string.
Note: Until Creo 2.0 a copy geometry feature could be dependent
or independent. Therefor a boolean value was sufficient to define
the dependency. Since Creo 3.0 there are more options and
therefor the new geometry_update variable was added. The old
dependent is only used in case the variable geometry_update is
empty.
update_notification — string variable for the update notification
in case of a manual update. Valid values are listed in the
feature update notification specification. Default is
NOTIFICATION_OFF.
Note: This option in only regarded in case of Creo 3.0, when the
geometry_update is set to INDEPENDENT and the Creo license option
332 - Update_Control is available. Otherwise the option is
disregarded.
SHRINKWRAP_OPTION — properties for creating a shrink wrap feature.
external — boolean parameter for internal or external placement.
Default is FALSE.
collection_method — string variable for the collection method of
the surface subset. Valid values are OUTER_SHELL, AUTO_COLLECT
and MANUAL_COLLECT. Default is OUTER_SHELL.
external_mdl — reference to external model. Only used for
external shrink wraps.
local_placement_csys — reference to local coordinate system for
placement. Only used for external shrink wraps. If not defined,
default placement is used.
external_placement_csys — reference to external coordinate system
for placement. Only used for external shrink wraps. If not
defined, default placement is used.
quality — integer parameter for quality of the shrink wrap.
Default is 1.
fill_holes — boolean parameter determines if holes should be
filled. Default is FALSE.
collect_quilts — boolean parameter determines if quilts should be
collected. Default is FALSE.
skip_surf_size — integer parameter for small surfaces threshold.
Set it to 0 for all surfaces. Default is 0.
solidify — boolean variable determines if the resulting geometry
should be solidified. Default is FALSE.
dependent — boolean parameter for dependency. Default is TRUE.
This variable is only used in case geometry_update is an empty
string.
geometry_update — string variable for new dependency. Valid
values are listed in the feature dependency specification. In
case of an empty string the variable dependent is used. Default
is an empty string.
Note: Until Creo 2.0 a copy geometry feature could be dependent
or independent. Therefor a boolean value was sufficient to define
the dependency. Since Creo 3.0 there are more options and
therefor the new geometry_update variable was added. The old
dependent is only used in case the variable geometry_update is
empty.
included_components — array of included components. In case the
array is empty all further components are used.
included_surfaces — array of included surfaces on components
which are not included.
excluded_surfaces — array of excluded surfaces on components
which are included..
included_datums — array for included datums.
GENERAL_MERGE_OPTION — properties for creating a merge or an
inheritance feature.
external — boolean parameter for internal or external placement.
Default is FALSE.
copy_datums — boolean parameter determines if datum elements
should be copied. Default is FALSE.
add_material — boolean parameter determines if material should be
added or removed. Default is TRUE.
merge — boolean parameter determines if a merge or a inheritance
feature should be created. Default is FALSE.
dependent — boolean parameter for dependency. Default is TRUE.
This variable is only used in case geometry_update is an empty
string.
geometry_update — string variable for new dependency. Valid
values are listed in the feature dependency specification. In
case of an empty string the variable dependent is used. Default
is an empty string.
Note: Until Creo 2.0 a copy geometry feature could be dependent
or independent. Therefor a boolean value was sufficient to define
the dependency. Since Creo 3.0 there are more options and
therefor the new geometry_update variable was added. The old
dependent is only used in case the variable geometry_update is
empty.
smt_cut — boolean parameter determines if a sheet metal cut
should be created. This option is only used if case of a sheet
metal source model and if add_material is set to FALSE. Default
is TRUE.
use_smt_driving — boolean parameter determines if the sheet
metal cut should be created based on the driving surface. Default
is TRUE.
VARIED_ITEM — members of a varied item.
type — string variable for the type of the varied item. Valid
types are FEATURE, PARAMETER and DIMENSION. Default is FEATURE.
reference — reference to the varied item in case of type FEATURE
and DIMENSION and of to its owner in case of type PARAMETER.
name — string variable for the name. Only used for the types
DIMENSION and PARAMETER. For the type DIMENSION the name is used
read only. Default is an empty string.
XSEC_OPTION — properties for creating a cross section.
use_offset — boolean variable if the cross section should include
an offset. Default is FALSE.
offset — double variable for the offset. Default is 0.0.
axis — string variable for direction of the offset. Only required
in case of using an coordinate system as section references.
Valid values are AXIS_X, AXIS_Y and AXIS_Z. Default is AXIS_X.
model_option — string variable defining which models should be
included. Valid values are INCLUDE_ALL, INCLUDE_SELECTED and
EXCLUDE_SELECTED. Default is INCLUDE_ALL.
models — array of references to models for being in- or excluded.
Depending on the model_option setting.
include_quilts — boolean variable if quilts should be included.
Default is FALSE.
flip — boolean variable if the cross section should be created in
the opposite direction. Default is FALSE.
ref_section — reference for the section which could be a plane, a
surface, a coordinate system or a coordinate system axis. This
member is only used when reading the cross section information.
CONSTRAINT
index — index of the constraint
type — type of the constraint. Default is DEFAULT.
assembly_ref — assembly reference of the constraint.
component_ref — component reference of the constraint.
offset — double parameter for the offset of the constraints.
Default is 0.0.
active — boolean parameter if the constraint is active. Default
is TRUE.
CONSTRAINT_SET
index — index of the constraint set.
mechanism — mechanism type of the constraint set. Default is
USER_DEFINED.
array_constraints — array of constraints. The elements are
CONSTRAINT structures.
active — boolean parameter if the constraint set is active.
Default is TRUE.
UDF_CONSTRAINT
type — udf constraint type. String parameter.
name — used for instance name, symbol name or dimension name.
String parameter.
reference_in — used as input reference for UDF_REF and
UDF_DEFAULT_BODY.
ref_type — used from UDF_EXP_REF. String parameter.
output_name — name for output reference or output parameter from
UDF_EXP_PARAM, UDF_EXP_REF, UDF_EXP_DIM_REF and UDF_EXP_DIM_NAME.
String parameter.
value — used from UDF_DIM, UDF_DIM_ANGLE, UDF_NUMBER, UDF_EXP_REF
and UDF_REORDER_NR. Integer or double value. Default is 0.
orientation — used from UDF_ORIENTATION. String parameter.
intersection — used from UDF_INTERSECTION. Variable is a
reference.
intersection_level — used from UDF_INTERSECTION. String variable
should be either ASSEMBLY_LEVEL or PART_LEVEL. Default is
ASSEMBLY_LEVEL.
automatic_intersection — used from UDF_INTERSECTION. Boolean
parameter. Default is FALSE.
array_check_for_surface_features — used from
UDF_SURFACE_FEATURES. Array of integers. Default is empty.
UDF_DATA
references — map of references. Key of the map is the reference
name as string variable. Value is the reference type as string
variable.
var_dims — map of variable dimensions. Key of the map is the
variable dimension name as string variable. Value is the default
content of the variable dimension.
var_params — map of variable parameters. Key of the map is the
variable parameter name as string variable. Value is the default
content of the parameter.
instances — array of instance names as string variables.
MAIL_ADDR — mail address with name and address.
name — name which shows up as recipients name as string (e.g.
Peter Smith)
mail_addr — email address as string (e.g. smith@mycompany.com)
MAIL_OPTION — required information for sending a mail.
server — name of the mail server as string (e.g
mail.mycompany.com).
port — port number of the SMTP service as integer. Default is 25.
security — connection security of the SMTP server as string.
Possible values are NONE, STARTTLS and SSL. Default is NONE.
html — boolean parameter determines if the mail should be
declared as html format or as plain text. Default is FALSE.
timeout — timeout for the mail server in seconds as integer.
Default is 30.
login — login for the mail server as string. In case this field
remains empty the SMTP server will be connected without
credentials.
password — password for the mail server as string.
sender — name of the sender (e.g. Achim Schön)
sender_mail_addr — mail address of the sender (e.g. achim@buw-
soft.de)
subject — subject of the mail as string.
message — message of the mail as string.
footer — footer of the mail as string.
reply_to_addrs — array of reply-to addresses MAIL_ADDR structure.
recipients — array of mail recipients MAIL_ADDR structure.
cc_recipients — array of mail cc recipients MAIL_ADDR structure.
bcc_recipients — array of mail bcc recipients MAIL_ADDR
structure.
attachments — array of the file names for attachments.
FTP_OPTION
port — port number of the FTP service as integer. Default is 21.
security — connection security of the FTP service. Possible
values are FTP, SFTP and FTPS. Default is FTP.
TEXT — information about text and font of a string in Creo
Elements/Pro.
text — the text which is formatted by a specific font
font_name — name of the font.
MAP_ELEM — information about key and value of a map element
key — integer, double or string parameter containing the key
information.
value — variable containing the data of the map element.
CHECKIN_LOCATION
model — reference to the model for which the location should be
set. Default is NULL.
location — location where this model should be saved. Default is
empty.
cabinet — cabinet for which the check-in process should be
processed. Default is Products. Use Libraries for a library in
Windchill.
CHECKIN_OPTION
default_location — default location where all models should be
saved unless there is not a location set for it. Default is
empty.
cabinet — cabinet for which the check-in process should be
processed. Default is Products. Use Libraries for a library in
Windchill.
array_locations — array for model locations of type
CHECKIN_LOCATION.
baseline_name — name of the baseline. If empty no baseline will
be created. Default is empty.
baseline_location — location of the baseline. If empty the
default location is used. Default is empty.
baseline_lifecycle — string parameter determines lifecycle of the
baseline. If empty the default lifecycle will be used. Default is
empty.
keep_checked_out — boolean parameter determines if the model
should stay checked out. Default is FALSE.
include_drawings — boolean parameters determines if associated
drawings should also be checked in. Default is FALSE.
auto_resolve — string parameter determines if incomplete objects
should be resolved automatically. Valid options are
NO_AUTO_RESOLVE, UPDATE and IGNORE. Default is NO_AUTO_RESOLVE.
This option is only used for Pro/ENGINEER Wildfire 4 and above.
upload_only — boolean parameter determines if the model should
only be uploaded, but not checked in. Default is FALSE. This
option is only used for Pro/ENGINEER Wildfire 4 and above.
CHECKIN_WORKSPACE_LOCATION
file— name of the file and extension for which the location
should be set. Default is empty.
location — location where this model should be saved. Default is
empty.
cabinet — cabinet for which the check-in process should be
processed. Default is Products. Use Libraries for a library in
Windchill.
CHECKIN_WORKSPACE_OPTION
default_location — default location where all models should be
saved unless there is not a location set for it. Default is
empty.
cabinet — cabinet for which the check-in process should be
processed. Default is Products. Use Libraries for a library in
Windchill.
array_locations — array for model locations of type
CHECKIN_LOCATION.
baseline_name — name of the baseline. If empty no baseline will
be created. Default is empty.
baseline_location — location of the baseline. If empty the
default location is used. Default is empty.
baseline_lifecycle — string parameter determines lifecycle of the
baseline. If empty the default lifecycle will be used. Default is
empty.
keep_checked_out — boolean parameter determines if the model
should stay checked out. Default is FALSE.
auto_resolve — string parameter determines if incomplete objects
should be resolved automatically. Valid options are
NO_AUTO_RESOLVE, UPDATE and IGNORE. Default is NO_AUTO_RESOLVE.
This option is only used for Pro/ENGINEER Wildfire 4 and above.
upload_only — boolean parameter determines if the model should
only be uploaded, but not checked in. Default is FALSE. This
option is only used for Pro/ENGINEER Wildfire 4 and above.
AUDIT_TRAIL
line — string parameter contains the complete information line.
item_name — string parameter contains the model name.
host — string parameter contains the host name.
user — string parameter contains the user name.
time — string parameter contains the time of change.
SMT_BEND_SURFACE_PROPS
radius — double parameter receives the radius of the bend
surface.
angle — double parameter receives the angle of the bend surface.
length — double parameter receives the length of the bend
surface.
bend_upwards — boolean parameter receives the information if the
bend surface is orients upwards.
SMT_FORM_OPTION — properties for creating a sheetmetal form as
punch or die.
punch — boolean value determines if a punch or die form is
created. Default is TRUE for the punch.
merge — boolean value determines if the form is created by merge
or by inheritance. Default is TRUE for the merge option.
side_offset — boolean value determines if the form should be
oriented to the offset direction. Default is FALSE.
geometry_update — string variable for the dependency. Valid
values are listed in the feature dependency specification.
Default is DEPENDENT.
die_shape_surfaces — array of surfaces which define the die
pocket geometry. This array is only used if punch is set to
FALSE.
round_non_placement_edges — boolean value determines if the non
placement edges should be rounded. Default is FALSE.
round_placement_edges — boolean value determines if the placement
edges should be rounded. Default is FALSE.
round_radius — double value determines the round radius if the
round_placement_edges is enabled. Default is 1.0.
round_inside — boolean value determines if the radius is an inner
or an outer radius if the round_placement_edges is enabled.
Default is TRUE for the inner radius.
excluded_surfaces — array of surfaces which should be excluded.
trim_edges — boolean value determines if a finishing operation
should be applied. Default is FALSE.
DTM_PNT_OFFSET_CSYS
array_points — array for point coordinates of type POINT.
offset_csys — reference to the point coordinate system.
type — String variable to define the point type. Valid types are
CARTESIAN, CYLINDRICAL and SPHERICAL. Default is CARTESIAN.
with_dims — boolean variable determines if dimensions should be
created or not. Default is FALSE.
COMB_VIEW_PROPS — structure for definition of combined views
orientation — string variable for the orientation. An empty
string means no orientation is specified. Default is empty.
simp_rep — string variable for the simplified representation. An
empty string means no simplified representation is specified.
Default is empty.
style — string variable for the style. An empty string means no
style is specified. Default is empty.
cross_section — string variable for the cross section. An empty
string means no cross section is specified. Default is empty.
exclude_clipped_components — boolean variable if clipped
components should be excluded. Default is FALSE.
explode — string variable for the explode. An empty string means
no explodes specified. Default is empty.
show_exploded — boolean variable if the explode show be
displayed. Default is FALSE.
layer — string variable for the layer state. An empty string
means no layer states specified. Default is empty.
EXPLODE_OPTION
type — type of the explode option. Value types are TRANSLATE and
ROTATE. Default is TRANSLATE.
direction— structure of type VECTOR for the translation or
rotation direction.
center — structure of type POINT for the rotation center.
value — double variable which contains the translation or
rotation value. Default is 0.0.
array_components — array of references to the components which
are included in the explode option. Default is an empty array.
ANNOTATION_PLANE_OPTION
type — type of the annotation plane. Valid types are REFERENCE,
NAMED_VIEW, FLAT_TO_SCREEN_SCREEN_COORD,
FLAT_TO_SCREEN_GEOM_COORD. Default is NAMED_VIEW.
view_name — (used for type NAMED_VIEW) string variable which
contains the name of the view which is used for the annotation
plane.
ref_plane — (used for type REFERENCE) reference to a datum plane
or a plane solid surface which is used for the annotation plane.
ANNOTATION_DIM_OPTION
ref_dim — boolean values defines if it is a reference dimension.
Default is FALSE.
annotation_plane — reference to the annotation plane.
array_references — array of placement references.
array_dim_sense — array of with elements of type DIMENSION_SENSE
to describe the dimension senses. For each reference one sense
can be supplied. In case no sense definitions is available, the
default sense will be used.
dimension_type — variable of type string for the type of the
dimension. Valid values are LINEAR, RADIUS, DIAMETER and ANGLE.
Default is LINEAR. This type is only used for reading the
properties of an existing dimension. It it is not required for
creating the dimension.
orient — is a hint for the orientation. Valid values are
VERTICAL, HORIZONTAL, SLANTED, ELLIPSE_RAD1, ELLIPSE_RAD2,
ARC_ANGLE, ARC_LENGTH, LINE_TAN_CRV_PNT, RADIAL_DISTANCE and
NONE. Default is NONE.
placement_pos — variable of type POINT for the dimension
position.
ANNOTATION_ELEMENT_REF_OPTION — structure for the description of an
annotation element reference.
reference — reference of the annotation element.
type — string variable for the type. Valid types are STANDARD,
SURFACE and CHAIN. Default is STANDARD.
strong — boolean variable to determine if the reference is strong
or weak. Default is TRUE.
description — string variable for the description. Default is an
empty string.
DIMENSION_SENSE
type — type of dimension sense. Valid values are POINT,
SPLINE_POINT, TANGENT_INDEX, TANGENT, ANGLE, PNT_ANGLE and NONE.
Default is NONE.
sense — string value of dimension sense. Depends on the type.
For types POINT and PNT_ANGLE the valid values are END1, END2,
CENTER, MIDPT and NONE.
For type TANGENT the valid values are LEFT0, RIGHT0, LEFT1,
RIGHT1 and NONE.
For the types SPLINE_PNT and TANGENT_INDEX the valid value is a
number as string value.
angle_sense — variable of type DIMENSION_ANGLE_SENSE for angular
dimension sense. Only used for the types ANGLE and PNT_ANGLE.
orient — is a hint for the orientation. Valid values are
VERTICAL, HORIZONTAL, SLANTED, ELLIPSE_RAD1, ELLIPSE_RAD2,
ARC_ANGLE, ARC_LENGTH, LINE_TAN_CRV_PNT, RADIAL_DISTANCE and
NONE. Default is NONE.
DIMENSION_ANGLE_SENSE
is_first — Boolean value, indicating that the angle starts from
this entity. Must be set only for one entity. Default is FALSE.
should_flip — boolean value to flip the entity direction to
measure the angle. Default is FALSE.
pic_vec_dir — boolean values. Default is FALSE.
SYMBOL_OPTION — define symbols for drawings and solid models.
Options used only for symbols in solid models:
flat_to_screen — boolean variable determines if the symbol is
created flat to the screen. Default is FALSE.
screen_location — boolean variable determines if a flat to screen
placed symbol in a solid model is placed on screen location or on
model location. Default is TRUE for the screen location.
named_orientation — boolean variable determines if a name
orientation is used as annotation plane. Default is TRUE.
view_orientation — name of the view which is used for the
orientation for symbols in a solid model. This is only used, if
flat_to_screen is set to FALSE and named_orientation is set to
TRUE. In case the view is not available, the standard view is
used. Default is an empty string.
ref_orientation — reference to a plane which should be used as
annotation plane. This is only used, if flat_to_screen is set to
FALSE and named_orientation is set to FALSE. In case the
reference is not valid, the standard view is used.
dir_orientation — variable of type VECTOR. This is only used, if
flat_to_screen is set to FALSE and named_orientation is set to
FALSE.
Options used for symbols on drawing and in solid models:
copy_symbol — copies the symbol even if a symbol of the same name
is already available to use multiple symbols with the same name
but different definitions. Default is FALSE.
height — double value determines the height of the drawing
symbol. 0.0 means the default height is used. Default is 0.0.
angle — double value determines the angle of the drawing symbol.
Default is 0.0.
placement_type — string value which determines the symbol
placement. The following placement types are supported. FREE,
ON_ENTITY, NORM_ENTITY, WITH_LEADER and OFFSET (only for drawing
annotation). Default is FREE.
placement_ref — reference for placement. This is used in case of
ON_ENTITY, NORM_ENTITY, and OFFSET.
placement_pos — variable of type POINT for the symbol position.
This is used in case of FREE and WITH_LEADER.
array_leaders — array of type ATTACH_LEADER to determine the
leaders.
path — string variable for path of the symbol instance. This
information is only used in case the command does not specify the
path directly in the command. Default is an empty string.
NOTE_OPTION — define notes for drawings and solid models.
Options used only for notes in solid models:
flat_to_screen — (used only for notes in solid models) boolean
variable determines if the note is created flat to the screen.
Default is FALSE.
screen_location — (used only for notes in solid models) boolean
variable determines if a flat to screen placed note in a solid
model is placed on screen location or on model location. Default
is TRUE for the screen location.
named_orientation — (used only for notes in solid models) boolean
variable determines if a name orientation is used as annotation
plane. Default is TRUE.
view_orientation — (used only for notes in solid models) name of
the view which is used for the orientation for notes in a solid
model. This is only used, if flat_to_screen is set to FALSE and
named_orientation is set to TRUE. In case the view is not
available, the standard view is used. Default is an empty string.
ref_orientation — (used only for notes in solid models) reference
to a plane which should be used as annotation plane. This is only
used, if flat_to_screen is set to FALSE and named_orientation is
set to FALSE. In case the reference is not valid, the standard
view is used.
dir_orientation — (used only for notes in solid models) variable
of type VECTOR. This is only used, if flat_to_screen is set to
FALSE and named_orientation is set to FALSE.
Options used only for notes on drawings:
view — reference to the drawing view to which the note is related
to. NULL in case the note is not related to a view. Default is
NULL.
sheet — number of the drawing sheet. This is only used in case
view is set to NULL. Default is 1 for the first drawing sheet.
array_note_lines — array of type NOTE_LINE for note lines. In
case no note line is provided, the member text as for notes in
solid models will be used.
Options used by notes on drawings and in solid models:
text — string variable for the note text. Default is an empty
string. For notes on drawings the array_note_lines array has
priority.
text_style — structure variable of type TEXT_STYLE for the note
format information. For notes on drawings the text style
information in array_note_lines has priority for font, height,
thickness, slant_angle and underline.
placement_type — string value which determines the note
placement. The following placement types are supported. FREE,
ON_ITEM, WITH_LEADER, TANGENT_LEADER, NORM_LEADER,
TANGENT_LEADER, OFFSET (only for drawing annotations) and NONE
(for notes in drawing tables). Default is FREE.
placement_ref — reference for placement. This is used in case of
ON_ENTITY, NORM_ENTITY, and OFFSET.
placement_pos — variable of type POINT for the note position.
This is used in case of FREE and WITH_LEADER. In case of a flat
to screen placement, the coordinates are related to the window
with x position between 0 and 1000 and y position between 0 and
835.
array_leaders — array of type ATTACH_LEADER to determine the
leaders.
NOTE_LINE
array_note_texts — array of type NOTE_TEXT to define different
text segments of a note line.
NOTE_TEXT
text — string variable for the note text. Default is an empty
string.
text_style — structure variable of type TEXT_STYLE to define the
style. This style defines the members font, height, thickness,
slant_angle and underline. All other style properties are
obtained from the text_style member of the NOTE_OPTION structure.
ATTACH_LEADER — define leaders for note and symbols.
placement_type — string value which determines the symbol
placement. The following placement types are supported. FREE and
ON_ENTITY. Default is FREE.
placement_ref — reference for placement. This is used in case of
ON_ENTITY.
placement_pos — variable of type POINT for the symbol position.
This is used in case of FREE.
arrow_type — string variable to define the type of the leader
arrow. Valid types are listed in the leader arrow type
specification. Default is AUTOMATIC. This type can only be used
for symbols and notes on drawings.
SURFACE_FINISH — define surface finishes for solid models.
name — string variable for name of the surface finish. In case
this is an empty string, the standard name is used. Default is an
empty string.
symbol_options — structure variable of type SYMBOL_OPTION to
define the symbol.
value — double variable for the surface finish value. Default is
32.0.
DRW_TABLE_FORMAT — format specification of a drawing table cell.
auto_adjust_method — adjusts the height of the cell column
automatically. This value is only used for Creo 1 and above.
Default is FALSE.
font — string value for the text font. Default is an empty
string.
height — double value for the text height. Default is -1 for the
standard height.
horizontal — string value for the horizontal alignment which is
ether DEFAULT, LEFT, CENTER or RIGHT. Default is DEFAULT.
slant — double value for the slant angle. Default is 0.0.
thickness — double value for the thickness. Default is -1 for the
standard value.
vertical — string values for the horizontal alignment which is
either DEFAULT, TOP, MIDDLE to BOTTOM. Default is DEFAULT.
width_factor — double value for the width factor. Default is -1
for the standard width factor.
wrap_text — boolean value indicates if the cell text is wrapped.
This option is only set for Creo 4.0 M070 / Creo 5.0.2.0 and
above. Default is FALSE.

Example
DECLARE_STRUCT POINT pnt
pnt.x = 100
pnt.y = 200
pnt.z = 300
PDF Option Structure
Structures are collections of variables which a specific name. Each
variable is a element of the structure and could have any of the
existing variable types. To access a element of the structure a dot
'.' is required.
PDF_OPTION — the options for exporting PDF files.
General options
sheets — specifies which sheets should be exported.
CURRENT or 0 — only the current sheet should be exported.
ALL or 1 — all sheets should be exported. This is default.
RANGE or 2 — a range of sheets should be exported.
sheet_range — specified the range of sheets which should be
exported as a string value.
The string should separate single pages or ranges by commas.
Ranges are connected by a hyphen. Valid examples are "1", "1,3",
"1-2" and "1,3-5". An empty string exports all sheets. By default
the string is empty. Until Pro/ENGINEER Wildfire 4 only the first
range is considered.
raster_dpi — specifies output resolution.
Resolution between 100 and 600. 300 is default.
color_depth — specifies the output color.
COLOR or 0 — specifies color output. This is default.
GRAY or 1 — specifies grayscale output.
MONO or 2 — specifies monochrome output.
hiddenline_mode — specifies style for the hidden line mode.
DASHED or 0 — specifies dashed hidden lines. This is default.
SOLID or 1— specifies solid hidden lines.
use_pentable — specifies if a pen table should be used. This
option is only supported for Pro/ENGINEER Wildfire 4 and above.
TRUE or 1 — pen table will be used.
FALSE or 0 — does not use a pen table.
pentable_file — specifies which pen table file will be used in
case use_pentable is activated. This option is only supported for
Pro/ENGINEER Wildfire 4 and above.
Name and path of the pen table to use.
linecap — specifies the cap style for line ends.
BUTT — uses default line ends.
ROUND — uses round line ends.
PROJECTING_SQUARE — uses projected square line ends.
linejoin — specifies how to join line ends.
MITER — uses default joins.
ROUND — uses round joins.
BEVEL — uses bevel joins.
launch_viewer — specifies if the Acrobat Reader will be launched.
TRUE or 1 — launches the viewer.
FALSE or 0 — does not launch the viewer. This is default.
Content options
layer_mode — specifies which layer information should be
exported.
ALL or 0 — exports visible layers and entities. This is default.
VISIBLE or 1 — exports only visible layers.
NONE or 2 — exports only visible entities.
param_mode — specifies if model parameters should be exported as
meta data.
ALL or 0 — exports drawing and model parameters. This is default.
DESIGNATED or 1 — exports only designates model parameters.
NONE or 2 — exports no model parameters.
bookmark_zones — specifies if bookmarks for drawing zones should
be created.
TRUE or 1 — creates bookmarks for drawing zones. This is default.
FALSE or 0 — does not create bookmarks for drawing zones.
bookmark_views — specifies if bookmarks for drawing views should
be created.
TRUE or 1 — creates bookmarks for drawing views. This is default.
FALSE or 0 — does not create bookmarks for drawing views.
bookmark_sheets — specifies if bookmarks for drawing sheets
should be created.
TRUE or 1 — creates bookmarks for drawing sheets. This is
default.
FALSE or 0 — does not create bookmarks for drawing sheets.
bookmark_flag_notes — specifies if bookmarks for drawing flag
notes should be created.
TRUE or 1 — creates bookmarks for flag notes. This is default.
FALSE or 0 — does not create bookmarks for drawing flag notes.
use_true_type_fonts — use TrueType fonts or stroke fonts
0 — to stroke all fonts.
1 — to use TrueType fonts. This is default.
2 —to stroke only the non TrueType fonts.
searchable_text — to make stroked text searchable.
TRUE or 1 — to make in stroked text searchable. This is default.
FALSE or 0 — to make stroked text non-searchable.
hyperlinks — specifies if hyperlinks will be exports as text or
as link.
TRUE or 1 — exports hyperlinks as links. This is default.
FALSE or 0 — exports hyperlinks as text.
Security options
password — password required for opening the PDF.
Any text. Default is empty.
restrict_operations — specifies if any restrictions to the PDF
document should be applied.
TRUE or 1 — activates restrictions.
FALSE or 0 — does not concern any restrictions. This is default.
allow_printing — specifies if the document can be printed.
TRUE or 1 — enables the printing functionality. This is default.
FALSE or 0 — disables the printing functionality.
allow_printing_mode — specifies the output resolution.
HIGH_RES or 0 — specifies high resolution. This is default.
LOW_RES or 1 — specifies low resolution.
allow_mode — enables to set the security settings for the PDF
document.
NONE or 0 — user will not be able to change the document. This is
default.
SIGNING or 1 — allows to filling in form fields and signing.
INSERTING or 2 — allows inserting, deleting and rotation pages.
COMMENTING or 3 — allows commenting, filling in form fields and
signing.
EXTRACTING or 4 — allows anything but extracting pages.
allow_copying — specifies if content can be copied.
TRUE or 1 — allows to copy content. This is default.
FALSE or 0 — does not allow to copy content.
allow_accessibility — specifies accessibility for visually
impaired assistance devices.
TRUE or 1 — enables the text access. This is default.
FALSE or 0 — disables the text access.
master_password — password required to modify security settings.
Any text. Default is empty.
Description options
title — specifies title for the document properties.
Any text. Default is empty.
author — specifies author for the document properties.
Any text. Default is empty.
subject — specifies subject for the document properties.
Any text. Default is empty.
keywords — specifies keywords for the document properties.
Any text. Default is empty.
§
Hole Data Structure
The following structures are used to read, modify and create holes.
HOLE_DATA — options which are used to create a hole.
hole_type — string value which is either STRAIGHT, SKETCHED,
STANDARD or CUSTOM. Default is STRAIGHT.
straight_hole — structure of type HOLE_STRAIGHT which is used if
hole_type is STRAIGHT.
sketched_hole — structure of type HOLE_SKETCHED which is used if
hole_type is SKETCHED.
standard_hole — structure of type HOLE_STANDARD which is used if
hole_type is STANDARD.
custom_hole — structure of type HOLE_CUSTOM which is used if
hole_type is CUSTOM.
hole_placement — structure of type HOLE_PLACEMENT.
top_clearance — boolean value if clearance on the top of the hole
should be provided by removing geometry. Default is FALSE.
hole_body — structure of type HOLE_BODY. This structure is only
evaluated and populated for Creo 7.0 or above.
HOLE_STRAIGHT — options which are used for a straight hole.
diameter — double value for the hole diameter. In case of 0.0 the
value is set automatically. Default is 0.0.
depth_to_type — string value for the depth to which the hole will
be created. Valid depth descriptions are BLIND, THRU_NEXT,
THRU_ALL, THRU_UNTIL, TO_SELECTED, SYMMETRIC and NONE. Default is
BLIND.
depth_to_value — double value for depth in the to direction. Used
in case of depth_to is BLIND. In case of 0.0 the value is set
automatically. Default is 0.0.
depth_to_ref — reference for depth in the to direction. Used in
case of depth_to is THRU_UNTIL or TO_SELECTED.
depth_from_type — string value for the depth to which the hole
will be created. Valid depth descriptions are BLIND, THRU_NEXT,
THRU_ALL, THRU_UNTIL, TO_SELECTED, SYMMETRIC and NONE. Default is
NONE.
depth_from_value — double value for depth in the from direction.
Use in case of depth_from is BLIND. In case of 0.0 the value is
set automatically. Default is 0.0.
depth_from_ref — reference for depth in the from direction. Used
in case of depth_from is THRU_UNTIL or TO_SELECTED.
HOLE_SKETCHED — options which are used for a sketched hole.
section— reference to a 2d section which is used for the hole.
HOLE_STANDARD — options which are used for a standard hole
standard_type — string value which is either TAPPED, TAPERED,
DRILLED or CLEARANCE. Default is TAPPED.
thread_type — string value for a thread type of the available
hole files.
screw_size — string value for the screw size of the chosen thread
type.
fit_type — string value which is either CLOSE, FREE or MEDIUM.
The fit is only used for clearance holes. Default is CLOSE.
add_thread — boolean variable if a thread should be added. Only
used in case of a tapped hole. Default is TRUE.
thread_depth_type — string value which is either THRU_THREAD or
VARIABLE_THREAD. Default is VARIABLE_THREAD.
thread_depth — double value for the thread depth. In case of 0.0
the value is set automatically. Default is 0.0.
add_cbore — boolean variable if a counter bore should be added.
Default is FALSE.
cbore_diameter — double value for the counter bore diameter. In
case of 0.0 the value is set automatically. Default is 0.0.
cbore_depth — double value for the counter bore depth. In case of
0.0 the value is set automatically. Default is 0.0.
add_csink — boolean variable fs a counter sink should be added.
Default is FALSE.
csink_diameter — double value for the counter sink diameter. In
case of 0.0 the value is set automatically. Default is 0.0.
csink_angle — double value for the counter sink angle. In case of
0.0 the value is set automatically. Default is 0.0.
add_csink_exit — boolean variable if a counter sink should be
added to the exit of the bore. Default is FALSE.
csink_exit_diameter — double value for the counter sink diameter
at the exit of the bore. In case of 0.0 the value is set
automatically. Default is 0.0.
csink_exit_angle — double value for the counter sink angle at the
exit of the bore. In case of 0.0 the value is set automatically.
Default is 0.0.
depth_type — string value which is either BLIND, THRU_NEXT,
THRU_ALL or TO_SELECT. Default is BLIND.
depth_value — double value for depth. Used in case of depth is
BLIND. In case of 0.0 the value is set automatically. Default is
0.0.
depth_ref — reference for depth. Used in case of depth is
THRU_UNTIL or THRU_SELECT.
depth_dim_scheme — string value which for the dimension scheme.
The value is either TILL_SHOULDER or TILL_TIP. Default is
TILL_SHOULDER.
drill_point_angle — double value defines the dill point angle.
Default is 118.
tapered_straight_drill_type — string value which is either NONE,
BLIND, THRU_NEXT, THRU_ALL, THRU_UNTIL or TO_SELECT. Only used in
case of a tapered hole. This is only supported for Creo 8.0 and
above. Default is BLIND.
tapered_straight_drill_diameter — double value for the tapered
straight drill diameter. Only used in case of a tapered hole and
the tapered_straight_drill_type is not NONE. In case of 0.0 the
value is set automatically. This is only supported for Creo 8.0
and above. Default is 0.0.
tapered_straight_drill_depth — double value for the tapered
straight drill diameter. Only used in case of a tapered hole with
the tapered_straight_drill_type is BLIND. In case of 0.0 the
value is set automatically. This is only supported for Creo 8.0
and above. Default is 0.0.
tapered_straight_drill_ref — reference for the depth of the
tapered straight drill. Only used in case of a tapered hole with
the tapered_straight_drill_type is THRU_UNTIL or TO_SELECT. This
is only supported for Creo 8.0 and above.
add_tapered_tip_angle — boolean value if a tapered tip angle
should be created. Only used in case of a tapered hole. This is
only supported for Creo 8.0 and above. Default is FALSE.
tapered_tip_angle — double value for the tapered tip angle. Only
used in case of a tapered hole and add_tapered_tip_angle is set
to TRUE. In case of 0.0 the value is set automatically. This is
only supported for Creo 8.0 and above- Default is 0.0.
add_note — boolean variable if a note should be shown or not.
Default is TRUE.
HOLE_CUSTOM — options which are used for a custom hole.
diameter — double value for the hole diameter. In case of 0.0 the
value is set automatically. Default is 0.0.
add_cbore — boolean variable if a counter bore should be added.
Default is FALSE.
cbore_diameter — double value for the counter bore diameter. In
case of 0.0 the value is set automatically. Default is 0.0.
cbore_depth — double value for the counter bore depth. In case of
0.0 the value is set automatically. Default is 0.0.
add_csink — boolean variable is a counter sink should be added.
Default is FALSE.
csink_diameter — double value for the counter sink diameter. In
case of 0.0 the value is set automatically. Default is 0.0.
csink_angle — double value for the counter sink angle. In case of
0.0 the value is set automatically. Default is 0.0.
add_csink_exit — boolean variable is a counter sink should be
added. Default is FALSE.
csink_exit_diameter — double value for the counter sink diameter
at the exit of the bore. In case of 0.0 the value is set
automatically. Default is 0.0.
csink_exit_angle — double value for the counter sink angle at the
exit of the bore. In case of 0.0 the value is set automatically.
Default is 0.0.
depth_type — string value which is either BLIND, THRU_NEXT,
THRU_ALL or TO_SELECT. Default is BLIND.
depth_value — double value for depth. Used in case of depth is
BLIND. In case of 0.0 the value is set automatically. Default is
0.0.
depth_ref — reference for depth. Used in case of depth is
THRU_UNTIL or THRU_SELECT.
depth_dim_scheme — string value which for the dimension scheme.
The value is either TILL_SHOULDER or TILL_TIP. Default is
TILL_SHOULDER.
drill_point_angle — double value defines the dill point angle.
Default is 118.
HOLE_PLACEMENT — options which are used to place a hole.
placement_type LINEAR, RADIAL, DIAMETER, ON_POINT COAXIAL or
RADIAL_HOLE_LIN_DIM (this is only available for the configuration
option radial_hole_linear_dim yes). ON_POINT is default.
placement_ref1 — first reference for placement.
placement_ref2 — second reference for placement.
offset_ref1 — first offset reference for placement.
offset_ref2 — second offset reference for placement.
orient_ref — orient reference for placement. This is used for
linear placement when only one offset reference is supplied.
aligned1 — boolean value determines if the first placement
reference is aligned or if an offset value is used. Default is
FALSE.
aligned2 — boolean value determines if the second placement
reference if aligned or if an offset value is used. Default is
FALSE.
offset1 — double value used for offset of the first placement
reference which is used for placement_type LINEAR.
offset2 — double value used for offset of the second placement
reference which is used for placement_type LINEAR.
radius — double value for the radius which is used for
placement_type RADIAL and RADIAL_HOLE_LIN_DIM. In case of 0.0
the value is set automatically. Default is 0.0.
diameter — double value for the diameter which is used for
placement_type DIAMETER. In case of 0.0 the value is set
automatically. Default is 0.0.
angle — double value for the diameter which is used for
placement_type LINEAR (on a cylindrical surface), RADIAL,
DIAMETER and RADIAL_HOLE_LIN_DIM. In case of 0.0 the value is
set automatically. Default is 0.0.
axial — double value for the axial distance which is used for
placement_type LINEAR (on a cylindrical surface). In case of 0.0
the value is set automatically. Default is 0.0.
HOLE_BODY — options to specify the bodies which are intersected by
the hole. This option is only used for Creo Parametric 7.0 and
above.
body_option — string value which is either ALL, SELECTED or
DEFAULT. Default is DEFAULT. When reading the option from an
existing bore it will be either ALL or SELECTED.
array_bodies — array of body references. This is only used for
the body_option SELECTED.
§
GTOL Data Structure
The following structures are used to read, modify and create
geometric tolerances for solids and drawings.
GTOL_DATA — main structure for geometric tolerances.
type — string variable to define the type of the geometric
tolerance. Valid types are STRAIGHTNESS, FLATNESS, CIRCULAR,
CYLINDRICAL, LINE, SURFACE, ANGULAR, PERPENDICULAR, PARALLEL,
POSITION, CONCENTRICITY, SYMMETRY, CIRCULAR_RUNOUT and
TOTAL_RUNOUT. Default is STRAIGHTNESS.
mdl_refs — structure of type GTOL_MDL_REFS to define the model
references of the geometric tolerance.
datum_refs — structure of type GTOL_DATUM_REFS to define the
datum references of the geometric tolerance.
tol_value — structure of type GTOL_VALUE to define the tolerances
values.
symbols — structure of type GTOL_SYMBOLS to define the symbols
which are visualized in the geometric tolerance.
text — structure of type GTOL_TEXT to define the text displayed
in the geometric tolerance.
GTOL_MDL_REFS — structure for the model references of geometric
tolerances.
entity_type — string variable to define the type of the entity.
Valid types are EDGE, AXIS, SURFACE, FEATURE, DATUM, ENTITY, NONE
and DEFAULT. In case of DEFAULT the entity_type is determined by
the referred item of entity_ref. Default is DEFAULT.
entity_ref — reference to the entity.
placement_type — string variable to define the type of the
placement. Valid types are DATUM, DIMENSION, DIM_RELATED,
FREENOTE, LEADER, TANGENT_LEADER, NORMAL_LEADER, GTOL and
DEFAULT. In case of DEFAULT the placement_type is determined by
the referred item of placement_ref or array_leaders. Default is
DEFAULT.
placement_ref — reference used for placement.
location — structure of type POINT to define the location on the
screen. This is only used for leader based and free note
tolerances.
annotation_plane — reference to the annotation plane. This is
only used for leader based annotations on solid models.
array_leaders — array of structures of type LEADER.
GTOL_DATUM_REFS — structure for the datum references of geometric
tolerances.
primary — structure of type GTOL_DATUM_REF for the primary datum
references.
secondary — structure of type GTOL_DATUM_REF for the secondary
datum references.
tertiary — structure of type GTOL_DATUM_REF for the tertiary
datum references.
enable_composite_tolerance — boolean variable to define if the
geometric tolerance is a composite. Default is FALSE.
composite_tolerance_value — double variable for the composite
tolerance value. Default is 0.001.
composite_tolerance_num_digits — integer variable to set the
minimal number of decimals for the composite tolerance value.
Default is -1.
composite_tolerance_datum_ref — string variable to define which
datum reference should be used. Valid values are PRIMARY,
SECONDARY, TERTIARY and NONE. Default is NONE.
GTOL_DATUM_REF — structure for a specific datum reference of a
geometric tolerance.
basic_ref — basic reference.
basic_material_condition — string variable for to define the
basic material condition. Valid values are LMC, MMC, RFS and
DEFAULT_RFS. Default is DEFAULT_RFS.
compound_ref — compound reference.
compound_material_condition — string variable for to define the
compound material condition. Valid values are LMC, MMC, RFS and
DEFAULT_RFS. Default is DEFAULT_RFS.
enable_translation — boolean variable to define if the
translation should be enabled. Default is FALSE.
GTOL_VALUE — structure for the reference value of a geometric
tolerance.
enable_overall_tolerance — boolean variable to define if the
overall tolerance value should be set. Default is FALSE.
overall_tolerance_value — double variable to set the overall
tolerance value. Default is 0.001.
overall_tolerance_num_digits — integer variable to set the
minimal number of decimals for the overall tolerance value.
Default is -1.
enable_per_unit_tolerance — boolean variable to define if the per
unit tolerance should be set. Default is FALSE.
per_unit_tolerance_value — double variable to set the unit
tolerance value. Default is 0.001.
per_unit_tolerance_num_digits — integer variable to set the
minimal number of decimals for the unit tolerance value. Default
is -1.
per_unit_tolerance_area_or_length — double value to set the unit
length or the unit value. Default is 0.001.
per_unit_tolerance_area_or_length_num_digits — integer variable
to set the minimal number of decimals for the unit length or the
unit value. Default is -1.
per_unit_tolerance_display_style — string variable to set the
display style. Valid values are X, BOX and DIAMETER. Default is
X.
material_condition — string variable to set the material
condition. Valid values are LMC, LMC_R, MMC, MMC_R, RFS and
DEFAULT_RFS. Default is DEFAULT_RFS.
GTOL_SYMBOLS — structure to enable or disable symbols in a
geometric tolerance.
enable_asme_style — boolean variable to define if the ASME Y14.41
style symbol is set. Default is FALSE.
enable_statistical_tolerance — boolean variable to define if the
statistical tolerance symbol is set. Default is FALSE.
enable_diameter_symbol — boolean variable to define if the
diameter symbol is set. Default is FALSE.
enable_free_state — boolean variable to define if the free state
symbol is set. Default is FALSE.
enable_all_around_symbol — boolean variable to define if the all
around symbol is set. Default is FALSE.
enable_all_over_symbol — boolean variable to define if the all
over symbol is set. Default is FALSE.
enable_tangent_plane — boolean variable to define if the tangent
plane symbol is set. Default is FALSE.
enable_set_boundary — boolean variable to define if the set
boundary symbol is set. Default is FALSE.
The following three members are only effective in case of LINE or
SURFACE tolerances.
profile_boundary — string variable to set the profile boundary
type. Valid values are UNILATERAL, BILATERAL and UNEQUAL. Default
is UNILATERAL.
profile_boundary_flip — boolean variable to define if in case of
a UNILITERAL profile boundary the direction should be flipped.
Default is FALSE.
profile_unequal_disposition — double variable to define the
unequal disposition of an UNEQUAL boundary. Default is 0.0.
GTOL_TEXT — structure to define the text of a geometric tolerance.
text_above — string variable to set the text above. Default is an
empty string.
align_text_above — string variable to set the horizontal
alignment for the text above. Valid values are LEFT, CENTER and
RIGHT. Default is RIGHT.
text_below — string variable to set the text below. Default is an
empty string.
align_text_below — string variable to set the horizontal
alignment for the text below. Valid values are LEFT, CENTER and
RIGHT. Default is RIGHT.
text_left — string variable to set the text on left. Default is
an empty string.
text_right — string variable to set the text on right. Default is
an empty string.
prefix — string variable to set the text prefix. Default is an
empty string.
suffix — string variable to set the text suffix. Default is an
empty string.
LEADER — structure to define leaders.
arrow_type — string variable to define the type of the leader
arrow. Valid types are listed in the leader arrow type
specification. Default is AUTOMATIC.
placement_ref — placement reference for the leader.
§
GTOL Creo 4 Data Structure
The following structures are used to read, modify and create
geometric tolerances for solids and drawings with the new
functionality for Creo 4.0 and above.
GTOL_CREO4_DATA — main structure for geometric tolerances.
type — string variable to define the type of the geometric
tolerance. Valid types are STRAIGHTNESS, FLATNESS, CIRCULAR,
CYLINDRICAL, LINE, SURFACE, ANGULAR, PERPENDICULAR, PARALLEL,
POSITION, CONCENTRICITY, SYMMETRY, CIRCULAR_RUNOUT and
TOTAL_RUNOUT. Default is STRAIGHTNESS.
value — string variable which defines the value of the geometric
tolerance. This values has priority over the variable value of
the first array member of array_datum_refs. Default is 0.01.
array_references — array of reference to which the geometric
reference is related. Default is an empty array.
placement — structure of type GTOL_CREO4_PLACEMENT to define the
model references of the geometric tolerance.
array_datum_refs — array of structures of type
GTOL_CREO4_DATUM_REF to define the datum references of the
geometric tolerance.
share_datum_refs — boolean variable to determine if the datum
references should be shared between all rows. Default is FALSE.
array_indicators — array of structures of type
GTOL_CREO4_INDICATOR to define the tolerances values.
modifiers — structure of type GTOL_CREO4_MODIFIERS to define the
symbols which are visualized in the geometric tolerance.
text — structure of type GTOL_CREO4_TEXT to define the text
displayed in the geometric tolerance.
options used only for geometric tolerances which are shown on a
drawing
view — drawing view which is used to specify the view to which
the leaders are related.
GTOL_CREO4_PLACEMENT— structure for the placement of geometric
tolerances in Creo 4.0.
placement_type — string variable to define the type of the
placement. Valid types are DATUM, ANNOTATION, ANNOTATION_ELBOW,
FREE, LEADERS, OFFSET, MAKE_DIM. and DEFAULT. In case of DEFAULT
the placement_type is determined by the referred item of
placement_ref or array_leaders. Default is DEFAULT.
placement_ref — reference used for placement.
location — structure of type POINT to define the location on the
screen. This is only used for leader based and free note
tolerances.
annotation_plane — reference to the annotation plane. This is
only used for leader based annotations on solid models.
array_leaders — array of structures of type GTOL_CREO4_LEADER.
GTOL_CREO4_DATUM_REF — structure for the datum references of
geometric tolerances.
value — string variable to define the value. Default is 0.01
primary — string variable to define the primary reference.
Default is an empty string.
secondary — string variable to define the secondary reference.
Default is an empty string.
tertiary — string variable to define the tertiary reference.
Default is an empty string.
GTOL_CREO4_INDICATOR — structure for a indicator of a geometric
tolerance.
type — string variable to define the type of the indicator. Valid
types are DIRECTION_FEATURE, COLLECTION_PLANE, INTERSECTION_PLANE
and ORIENTATION_PLANE. Default is COLLECTION_PLANE.
symbol— string variable to define the symbol of the indicator.
Valid types are ANGULARITY, PERPENDICULARITY, PARALLELISM and
SYMMETRY. Default is PERPENDICULARITY.
datum — string variable for to define the related datum. Default
is an empty string.
GTOL_CREO4_MODIFIERS — structure for the reference value of a
geometric tolerance.
all_over — boolean variable to determine if the All Over symbol
should be shown in the geometric tolerance. This option is only
effective for the tolerance type SURFACE. Default is FALSE.
all_around — boolean variable to determine if the All Around
symbol should be shown in the geometric tolerance. This option is
only effective for the tolerance types LINE and SURFACE. Default
is FALSE.
unilateral — boolean variable to determine if the unilateral
profile tolerance should be displayed. This option is only
effective for the tolerance types LINE and SURFACE. Default is -
FALSE.
flip — boolean variable to determine if the direction for the
unilateral setting should be flipped. This option is only
effective for the if the unilateral setting is enabled. Default
is FALSE.
boundary — boolean variable to determine if the BOUNDARY modifier
should be shown in the geometric tolerance. This option is only
effective for the tolerance type POSITION. Default is FALSE.
GTOL_CREO4_TEXT — structure to define the text of a geometric
tolerance.
text_above — string variable to set the text above. Default is an
empty string.
align_text_above — string variable to set the horizontal
alignment for the text above. Valid values are LEFT, CENTER and
RIGHT. Default is RIGHT.
box_text_above — boolean variable to determine if the text above
should be surrounded by a box. Default is FALSE.
text_below — string variable to set the text below. Default is an
empty string.
align_text_below — string variable to set the horizontal
alignment for the text below. Valid values are LEFT, CENTER and
RIGHT. Default is RIGHT.
box_text_below — boolean variable to determine if the text below
should be surrounded by a box. Default is FALSE.
text_left — string variable to set the text on left. Default is
an empty string.
text_right — string variable to set the text on right. Default is
an empty string.
GTOL_CREO4_LEADER — structure to define leaders.
arrow_type — string variable to define the type of the leader
arrow. Valid types are listed in the leader arrow type
specification. Default is AUTOMATIC.
placement_ref — placement reference for the leader.
§
General Point Data Structure
The following structures are used to read, modify and create general
points in Pro/ENGINEER Wildfire 5.0 and above.
GENERAL_POINT_DATA — main structure for general points.
array_placement — array of GENERAL_POINT_PLACEMENT structures to
define the placement constraints of the point.
array_dimensions — array of GENERAL_POINT_DIMENSION structures to
define the dimension constraints of the point.
GENERAL_POINT_PLACEMENT — options for the placement constraints of
a point.
placement_type — string value to define the placement type.
Valid types are PNT_ON, PNT_OFFSET, PNT_CENTER, PNT_PARALLEL,
PNT_NORMAL, PNT_CARTESIAN, PNT_CYLINDRICAL and PNT_SPHERICAL.
Default is PNT_ON.
placement_ref — reference used for the placement.
placement_value — double value for the placement. Default is
0.0.
GENERAL_POINT_DIMENSION — options for the dimension constraints
of a point.
dimension_type — string value to define the dimension type.
Valid types are PNT_DIM_OFFSET, PNT_DIM_LENGTH, PNT_DIM_RATIO,
PNT_DIM_LENGTH_END, PNT_DIM_RADIO_END, PNT_DIM_ALONG_X,
PNT_DIM_ALONG_Y and PNT_DIM_ALONG_Z. Default is
PNT_DIM_OFFSET.
dimension_ref — reference used for the dimension.
dimension_value — double value for the dimension. Default is
0.0.
§
General Coordinate System Data Structure
The following structures are used to read, modify and create general
coordinate systems.
GENERAL_CSYS_DATA — main structure for general coordinate systems.
offset_type — string value to define the offset type. Valid types
are CARTESIAN, CYLINDRICAL and SPHERICAL. Default is CARTESIAN.
offset_reference_type — string value to define the reference
offset type. Valid types are NONE, LINEAR, RADIAL and DIAMETER.
Default is NONE when no offset references are used.
array_origin_references — array of references which are used for
the origin.
array_offset_references — array of GENERAL_CSYS_OFFSET_REFERENCE
offset references.
offset — variable of type VECTOR contains the offset values. For
the offset type CARTESIAN these are the X, Y and Z values. For
the offset type SPHERICAL these are the radial distance, theta
and offset z. For the offset type CYLINDRICAL these are the
radial distance, phi and theta.
orient —variable of type VECTOR contains the orientations.
GENERAL_CSYS_OFFSET_REFERENCE — options for the offset references.
offset_reference — reference used for this offset.
offset_type — string value to define the offset type. Valid
values are OFFSET and ALIGN. Default is OFFSET.
offset_value — double value for the offset. This is only used
if the offset_type is set to OFFSET. Default is 0.0.
§
Pattern Data Structure
The following structures are used to read, modify and create patterns
in Pro/ENGINEER Wildfire 5.0 and above.
PATTERN_DATA — main structure for patterns.
type — string value to define the type of the pattern. Valid
types are DIMENSION_PATTERN, DIRECTION_PATTERN, AXIS_PATTERN,
FILL_PATTERN, TABLE_PATTERN, REFERENCE_PATTERN, CURVE_PATTERN and
POINT_PATTERN. Default is DIMENSION_PATTERN.
direction_pattern — structure of type PATTERN_DIRECTION_DATA
which is used if type is DIRECTION_PATTERN.
axis_pattern — structure of type PATTERN_AXIS_DATA which is used
if type is AXIS_PATTERN.
fill_pattern — structure of type PATTERN_FILL_DATA which is used
if type is FILL_PATTERN.
table_pattern — structure of type PATTERN_TABLE_DATA. which is
used if type is TABLE_PATTERN.
curve_pattern structure of type PATTERN_CURVE_DATA which is used
if type is CURVE_PATTERN.
array_dimensions_first_dir — array of PATTERN_DIMENSION
structures. This array is used for the pattern types
DIMENSION_PATTERN, DIRECTION_PATTERN and AXIS_PATTERN.
array_dimensions_second_dir — array of PATTERN_DIMENSION
structures. This array is used for the pattern types
DIMENSION_PATTERN, DIRECTION_PATTERN and AXIS_PATTERN.
number_instances_first_dir — integer value of the number of
instances in the first direction. This number is used for the
pattern types DIMENSION_PATTERN, DIRECTION_PATTERN and
AXIS_PATTERN. Default is 2.
number_instances_second_dir — integer value of the number of
instances in the second direction. This number is used for the
pattern types DIMENSION_PATTERN, DIRECTION_PATTERN and
AXIS_PATTERN. Default 2.
pattern_ref — reference used for the types AXIS_PATTERN (axis),
FILL_PATTERN (sketch feature), CURVE_PATTERN (sketch feature) and
POINT_PATTERN (datum point feature or sketch feature).
regen_option — string value for the regeneration option. Valid
types are GENERAL, VARYING and IDENTICAL. Default is GENERAL.
PATTERN_DIRECTION_DATA — options which are used for
DIRECTION_PATTERN.
direction1 — structure of type PATTERN_DIRECTION for the first
direction.
direction2 — structure of type PATTERN_DIRECTION for the
second direction.
PATTERN_DIRECTION — options which are used for
DIRECTION_PATTERN.
direction_type — string value for the direction type. Valid
types are TRANSLATIONAL, ROTATIONAL and CSYS. Default is
TRANSLATIONAL.
direction_ref — reference used for the direction_type
TRANSLATIONAL and ROTATIONAL. For the direction_type CSYS,
this reference in read-only.
direction_vector — structure of type VECTOR. This is used for
the direction_type CSYS.
direction_flip — boolean value to determine if the direction
should be flipped. Default is FALSE.
direction_spacing — double value for the spacing between the
instances. Default is 10.0.
PATTERN_AXIS_DATA — options which are used for AXIS_PATTERN.
angle_offset — double value for the angular offset. Default is
90.0.
angle_flip — boolean value determines if an angular flip
should be applied. Default is FALSE.
radial_offset — double value for the radial offset. Default is
10.0.
radial_flip — boolean value if a radial flip should be
applied. Default is FALSE.
angle_extend — double value for the whole angle. Default is
360.0.
PATTERN_FILL_DATA — options which are used for FILL_PATTERN.
fill_type — string value to define the fill type. Valid types are
SQUARE, DIAMOND, TRIANGLE, CIRCLE, CURVE and SPIRAL. Default is
SQUARE.
spacing — double value for the spacing between the pattern
members. Default is 10.0.
min_distance — double value for the minimal distance between the
pattern member centers and the sketch boundary. Default is 0.0.
rot_angle — double value for the rotational angle of the grid
about the origin. Default is 90.0.
radial_spacing — double value for the radial spacing for circular
and spiral grids. Default is 10.0.
PATTERN_TABLE_DATA — options which are used for TABLE_PATTERN.
array_dimensions — array of dimension references.
array_tables — array of PATTERN_TABLE structures.
active_table— integer valuer which defines which table is active.
Default is 0 for the first table.
PATTERN_TABLE — options which are used for TABLE_PATTERN.
name — string value to define the name of the pattern table.
array_instances — array of PATTERN_TABLE_INSTANCE structures.
PATTERN_TABLE_INSTANCE — options which are used for TABLE_PATTERN.
index — integer value to define the index of the instance.
Default is 0. Regular indices are starting with 1. Smaller values
or already used values are automatically updated to the non
occupied index.
array_dim_values — array of double values.
PATTERN_CURVE_DATA — options which are used for CURVE_PATTERN.
use_number — boolean value to determine if number of members
should be used. Default is FALSE.
spacing — double value for the spacing between the pattern
members. This value is only used if use_number is set to FALSE.
Default is 10.0.
number — integer value to specify the number of pattern members.
This value is only used if use_number is set to TRUE. Default is
10.0.
PATTERN_DIMENSION — options which are used for DIMENSION_PATTERN,
DIRECTION_PATTERN and AXIS_PATTERN.
dimension_ref — reference to the dimension.
dimension_by_value — boolean value to distinguish dimensions
driven by value from dimensions driven by relations. Default is
TRUE.
value — double value for the dimension value. Default is 10.0.
array_relations — array of string values for the relations.
§
NC Structures
The following structures are available for NC operations:
NC_TOOL_SETUP — Structure for storing a NC tool setup.
head_number — Number of the head containing the tool.
tool_name— Name/ID of the tool.
tool_position — Position of the tool within its containing head.
Starts at 0.
workcell — Workcell, which contains the tool (i.e. the tool is
part of a head, which is part of a workcell).
NC_TOOL_TIP — Structure for storing NC tool tips.
register — integer value for the tip register number. Default is
0.
comment — string value for the tip command. Default is an empty
string.
offset_z — double value for the tip z offset. Default is 0.0.
offset_x — double value for the tip x offset. Default is 0.0.
angle — double value for the tip angle offset. default is 0.0.
flash_opt — boolean value if the flashing compatibility is
enabled. Default is FALSE.
flash_register — integer value for the alternate tip register
number. default is 0.
flash_comment — string value for the alternate tip command.
Default is an empty string.
flash_offset_z — double value for the alternate tip z offset.
Default is 0.0.
flash_offset_x — double value for the alternate x offset. Default
is 0.0
NC_STEP — Description of an NC step feature.
parameters — A map of the step parameters. The parameter names
are used as keys while the values are the actual values.
operation — reference to the step operation. This information is
read-only and could not be changed.
orient_csys — reference to the orientation coordinate system.
type — sequence type of the step. Valid types are:
PROF_SURF_MILL, VOL_MILL, CONV_SURF_MILL, FACE_MILL, HOLEMAKING,
PREV_TOOL_MILL, TRAJ_MILL, AREA_TURN, 4X_AREA_TURN, GROOVE_TURN,
TRAJ_TURN, THREAD_TURN, PENCIL_TRACING_MILL, PROF_TURN,
THREAD_MILL, CUTLINE_MILL, GROOVE_MILL, ROUGHVOL_MILL,
REROUGH_MILL, FF_TRAJ_MILL, MANUAL_CYCLE_MILL, TRAJ_MILL_STEP,
ROUND_MILL, CHAMFER_MILL and MANUAL_CYCLE_TURN.
The type is read-only and could not be changed. Default is
PROF_SURF_MILL.
num_axes — integer variable which contains the number of step
axis. Default is 0.
spindle — string variable which contains the step spindle. Valid
types are UNDEFINED, MAIN and SUB. Default is UNDEFINED.
tool_adapter — string variable which contains the tool adapter
name and extension. Default is an empty string.
comments – string variable which contains the step comments.
tool_setup — a structure of type NC_TOOL_SETUP, which describes
the tool of the step. This information is read-only and could not
be changed.
retract_surface — a structure of type NC_RETRACT_SURFACE which
describes the retraction surface.
NC_RETRACT_SURFACE — Structure for the definition of a retraction
surface.
type — string variable of the type of the retraction surface.
Valid types are UNDEFINED, PLANE, CYLINDER, SPHERE, REVOLVED and
AUTOMATIC (for Creo 8.0 and above). Default is UNDEFINED.
surface — reference to the retraction surface.
orient — string variable of the orientation of the retraction
surface. Valid types are X_DIR, Y_DIR and Z_DIR. Default is
Z_DIR.
value — double variable for the offset value for planar retract
or radius. Default is 0.0.
§
Web Service Structures
The following structures are used for web service calls.
NETWORK_CONNECTION — structure to define the network connection for
the web service call.
timeout — integer variable for the network timeout in seconds.
Default is 10.
verify_certificate — boolean variable if for https connections
the server certificate should be tested. Default is FALSE.
HTTP_HEADER — main structure for HTTP headers.
request — structure of type HTTP_HEADER_REQUEST which is used to
define the header data which is send.
response — structure of type HTTP_HEADER_RESPONSE which is used
for the header data which is received.
HTTP_HEADER_REQUEST — headers which are send with the web service
call.
accept — string variable to specify which content is accepted.
Possible values are JSON, XML, HTML, TEXT, ALL and any other
text for application defined content. Default is JSON.
login— string variable to specify the user name for the HTTP
basic authentication mechanism. An empty string indicates that
no authentication is used. Default is an empty string.
password — string variable containing the password for the
HTTP basic authentication mechanism.
connection — boolean variable if the network connection should
be maintained after the web service call. Default is TRUE.
content_type — string variable to specify which content is
provided as input. Possible values are JSON, XML, HTML, TEXT,
URLENCODED , BINARY or any other text for application defined
content. Default is JSON.
content_encoding — string variable to specify how the content
is encoded. Possible values are GZIP or an empty string.
default is an empty string.
custom_headers — map of custom request headers. A map element
consists of the header name as key and the header content as
string value.
HTTP_HEADER_RESPONSE — headers which are received as answer to
the web service call.
response_version — string variable to receive the response
version. Default is an empty string. Response will usually be
HTTP 1/1.
response_code — integer variable to receive the response code.
Default is 200. All codes below 300 indicate a successful web
service call. An overview over possible response codes is
available here:
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes. In
general all codes smaller than 300 can be considered as
successful.
response_phrase — string variable to receive the response
phrase. Default is OK for an successful web service call. An
overview over possible response phrases is available here:
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes.
content_type — string variable to receive the type of the
received data. Possible values are JSON, XML, HTML, TEXT and
others application defined ones. Default is JSON.
content_encoding — string variable to specify how the content
is encoded. Possible values are GZIP or an empty string.
default is an empty string.
custom_headers — map of custom response headers. A map element
consists of the header name as key and the header content as
string value.
Math Expressions
Math expressions could be build up with the following terms.
Operands
Normal numbers as well as parameters defined by the script language
could be used as operands.

example
1.1, -2, param, -param
Basic operators
The typical basic operators for math calculations (*, /, -, +) are
available with the normal rules for precedence. Parenthesis could be
used to define order of evaluation.

example
2*param+3*param/2, (param1+2)*param2
Constants
The constant PI is available for math expressions and defined with
the value 3.1415926535897932384626433832795.
Functions
The following functions are available for calculation. The numerical
arguments could consist of terms build up operands, basic operators,
constants and other functions. String arguments could be build up
with all kind of string expressions.
sin (valueDOUBLE)
Calculates sine of a double argument in radians.

asin (valueDOUBLE)
Calculates arc sine of a double argument in radians.

cos (valueDOUBLE)
Calculates cosine of a double argument in radians.

acos (valueDOUBLE)
Calculates arc cosine of a double argument in radians.

tan (valueDOUBLE)
Calculates tangent of a double argument in radians.

atan (valueDOUBLE)
Calculates arc tangent of a double argument in radians.

sinh (valueDOUBLE)
Calculates hyperbolic sine of a double argument in radians.

cosh (valueDOUBLE)
Calculates hyperbolic cosine of a double argument in radians.

tanh (valueDOUBLE)
Calculates hyperbolic tangent of a double argument in radians.

log (valueDOUBLE)
Calculates logarithm of a double argument for the basis 10.

ln (valueDOUBLE)
Calculates natural logarithm of a double argument.

exp (valueDOUBLE)
Calculates exponential function of a double argument.

ceil (valueDOUBLE)
Calculates smallest integer less or equal for a double argument.

floor (valueDOUBLE)
Calculates largest integer less or equal for a double argument.

abs (valueDOUBLE)
Calculates absolute value for a double argument.

sqrt (valueDOUBLE)
Calculates square root of a double argument.

sqr (valueDOUBLE)
Calculates square of a double argument.

pow (baseDOUBLE, exponentDOUBLE)


Calculates values raised to a power.

mod (numeratorDOUBLE, denominatorDOUBLE)


Calculates remainder of a division by the modulus operation.

round (valueDOUBLE, digitsINTEGER)


Calculates the rounded value according to the specified digits.
strfind ("string", "sub str")
Find a sub string in a string. In case the sub string is not found
the function returns -1. In case it is found, it return the
position in string. First character has position 0. Upper and lower
cases are not distinguished.
strfindcs ("string", "sub str")
Case sensitive function for strfind. Same behaviour expect that
upper and lower cases are distinguished.
strlen ("string")
Calculates length for the specified string.
strcmp ("str1", "str2")
Compares string str1 against string str2.
-1 if str1 is less than str2.
0 if str1 is identical to str2.
1 if str1 is greater that str2.
Upper and lower cases are not distinguished.
strcmpcs ("str1", "str2")
Case sensitive function for strcmp. Same behaviour expect that
upper and lower cases are distinguished.
stof ("string")
Converts a string to a double value.
stoi ("string")
Converts a string to an integer value.
stob("string)
Converts a string to a boolean value.
asc ("string")
Converts the first character of the string to the corresponding
ascii code.
isnumber ("string")
Tests if a string only consists of digits.
isinteger ("string")
Test if a string builds a correct integer value.
isdouble ("string")
Tests if a string builds a correct double value. Integer values are
also regarded as valid doubles.

equal (value1DOUBLE, value2DOUBLE, digitsINTEGER)


Compares two values for equality according to the specified digits.
The normal comparison via '==' compares for 6 digits. More digits
means less stable for numerical inaccuracies.

less (value1DOUBLE, value2DOUBLE, digitsINTEGER)


Compares if one value is smaller than the other according to the
specified digits. The normal comparison via '<' compares for 6
digits. More digits means less stable for numerical inaccuracies.

lessorequal (value1DOUBLE, value2DOUBLE, digitsINTEGER)


Compares if one value is smaller or equal to the other according to
the specified digits. The normal comparison via '<=' compares for 6
digits. More digits means less stable for numerical inaccuracies.
greater (value1DOUBLE, value2DOUBLE, digitsINTEGER)
Compares if one values is greater than the other according to the
specified digits. The normal comparison via '>' compares for 6
digits. More digits means less stable for numerical inaccuracies.

greaterorequal (value1DOUBLE, value2DOUBLE, digitsINTEGER)


Compares if one value is greater or equal to the other according to
the specified digits. The normal comparison via '>=' compares for 6
digits. More digits means less stable for numerical inaccuracies.

example
sqrt(sin(param) + cos(param))
Comparison operators
For comparison the following operators could be used. Each value
could be calculated by operands, basic operators, constants and
functions.
value1DOUBLE == value2DOUBLE
Calculates if value1 is equal to value2.

value1DOUBLE <> value2DOUBLE


Calculates if value1 is not equal to value2.

value1DOUBLE <= value2DOUBLE


Calculates if value1 is less than or equal to value2.

value1DOUBLE >= value2DOUBLE


Calculates if value1 is greater than or equal to value2.

value1DOUBLE < value2DOUBLE


Calculates if value1 is less than value2.

value1DOUBLE > value2DOUBLE


Calculates if value1 greater than value2.

example
2*param < 3, sin(param) == PI
String Expressions
Strings could be build up by the use of normal characters and special
characters. Specific operators allow to concatenate strings and to
distinguish between text strings and string variables.
There are several functions available for extracting contents,
searching and converting. Also strings could be compared by the use
of comparison operators.
To distinguish text from variables, it is recommended to use double
quotes: "..."

Example
Creo Elements/Pro part contains 2 parameters: LENGTH=25 and D1=3
DECLARE_VARIABLE STRING LENGTH "D1"
SEARCH_MDL_PARAM THIS LENGTH MY_LENGTH
In this case MY_LENGTH will be equal to the value of the Creo
Elements/Pro parameter D1. LENGTH is considered to be a variable. The
search is done for the content of this variable LENGTH which is "D1".
So, MY_LENGTH=3.
SEARCH_MDL_PARAM THIS "LENGTH" MY_LENGTH
In this case MY_LENGTH will be equal to the value of the Creo
Elements/Pro parameter LENGTH. "LENGTH" is considered to be a text.
The search is done for "LENGTH". So, MY_LENGTH=25.
Escape sequences
Special characters are available to format a string. These characters
are called escape sequences and are introduced by a backslash (\).
The most popular one is the line break (\n) and the double quote
(\").
\a alert
\b backspace
\f form feed
\n new line
\r carriage return
\t horizontal tab
\v vertical tab
\' single quote
\" double quote
\\ backslash
\? question mark

Example
PRINT "This is a quote \"\nThat's the second line"
Verbatim strings
Composing strings to represent a path requires to use two backslashes
as separator for sub directories and file name. This could become
confusing especially when UNC paths are used. Using an at sign right
before the first double quote introduces a verbatim string which
disables the escape sequences.

Example for using escape sequences


path = "\\\\server\\share\\path\\file.txt"

Example for using verbatim strings


path = @"\\server\share\path\file.txt"
Operands
Normal string expressions as well as string parameters defined by the
script language could be used as operands. To distinguish text from
parameter, it is recommended to use double quotes: "...". An leading
ampersand & indicates that the following word is an parameter an not
a normal text.
In case no double quotes and ampersands are used, it is first checked
if the word matches a parameter name. If this does not fit, it is
handled as text.

Example
"test", paramText
Basic operators
For concatenating two sub strings the operator + could be used.
Thereby the sub strings could be build up with all other string
operations.

Example
"test " + paramText
Functions
strleft("text", valueINT)
Returns a string of the specified length. The characters are taken
from the head of the string.

strright("text", valueINT)
Returns a string of the specified length. The characters are taken
from the tail of the string.

strmid("text", value1INT[, value2INT])


Returns a string starting on the character specified with value1.
If the optional value2 is specified the length of the string is
restricted to value2. Otherwise the complete sub string starting
with character value1 is returned. The first character has the
number 0.

strchr( valueINT)
Returns a character with the specified index of the ASCII table.
The values are between 0 and 255.
strtrunc ("text")
Returns truncated string without leading and trailing spaces or
tabs.

itos(valueINT)
Returns a string with represents the integer value.

ftos(valueDOUBLE[, decimalsINT])
Returns a string which represents the double value. If the optional
integer decimals is specified, the number of decimal places is
rounded to this value.

btos(valueBOOL)
Returns the string TRUE or FALSE depending on the value.
mkupper("text")
Returns the string in upper characters.
mklower("text)
returns the string in lower characters.

strreplace("text", "search", "replace", allOccurencesBOOL)


Searches for the "search" string in "text" and replaces it via
"replace". allOccurences determines if the replacement is only
applied for the first found instance or for all of them.

strreplacecs("text", "search", "replace", allOccurencesBOOL)


Case sensitive function for strreplace. Same behaviour except that
upper and lower cases are distinguished.
All values could be build up with math expressions.
Comparison operators
For comparison the following operators could be used. Each text could
be build up by operands, basic operators and functions. The
comparison operations are not case sensitive.
text1 == text2
Compares if text1 is equal to text2.
text1 <> text2
Compares if text1 is not equal to text2.
text1 <= text2
Compares if text1 is less than or equal to text2.
text1 >= text2
Compares if text1 greater than or equal to text2.
text1 < text2
Compares if text1 is less than text2.
text1 > text2
Compares if text1 is greater than text2.

Example
strleft(paramText, strlen("test")) == "test"
Logical Expressions
Logical expressions are used for comparisons in control structures
like IF and WHILE statements. These expressions are build up in a
conditions term which consists of single conditions.

condition
comparison of string values.
comparison of math expressions.
REF_TYPE reference<:in> 'type'
Tests if type of the reference follows specification.
SURF_TYPE reference<:in> 'surface_type'
Tests if surface type of the reference follows the specification.
If the reference is not a surface the script program will terminate
with an error.
INTERF reference1<:in> reference2<:in>
Tests if bodies or models are interfering.
Note: Intersections are only determined between visible elements
which are interfering. In case one model contains the other without
any interfering surfaces, it will not be considered as interfering.
INTERF_REC reference1<:in> reference2<:in>
Tests recursively if bodies or models are interfering. This enables
interference controls of assemblies with their components.
Note: Intersections are only determined between visible elements
which are interfering. In case one model contains the other without
any interfering surfaces, it will not be considered as interfering.

FEAT_EXIST model feature_nameWORD


Tests if feature with specified name exists in the model.

FEAT_NOT_EXIST model feature_nameWORD


Tests if feature with specified name does not exist in the model.

SURF_EXIST model surface_nameWORD


Tests if surface with specified name exists in the model.

SURF_NOT_EXIST model surface_nameWORD


Tests if surface with specified name does not exist in the model.
PARAM_EQUAL param1WORD param2WORD
Tests if param1 and param2 are identical. Two undefined parameters
are not regarded as equal.

PARAM_UNEQUAL param1WORD param2WORD


Tests if param1 and param2 are not identical. Two undefined
parameters are regarded as not identical.
PARAM_TRUE parameter<:in>
Tests if parameter is different from 0. The parameter has to be
valid and it should not be a string parameter.
PARAM_FALSE parameter<:in>
Tests if parameter is equal to 0. The parameter has to be valid and
it should not be a string parameter.
PARAM_EXIST parameter<:in>
Tests if parameter is existing.
PARAM_VALID parameter<:in>
Tests if parameter content is defined.
ARRAY_EMPTY array<:in>
Tests if an array is empty or populated.
REF_EQUAL reference1<:in> reference2<:in>
Tests if both references are identical.
REF_UNEQUAL reference1<:in> reference2<:in>
Tests if both references are not identical.
ELEM_NEW
Tests if a new component is assembled instead of an existing one.
This condition does not distinguish between creating and modifying
a component. To determine if you are in modification mode, use the
ELEM_REDEFINE condition.
ELEM_EXIST
Tests if an existing component is assembled again. This conditions
combines ELEM_COPY_EXIST as well as ELEM_CREATE_EXIST.
ELEM_COPY_EXIST
Tests if an existing component is assembled again as a copy of
itself.
ELEM_CREATE_EXIST
Tests if an existing component is assembled again as the identical
Creo Elements/Pro part / assembly.
ELEM_REDEFINE
Tests if a component is redefined.
REF_VALID reference<:in>
Tests if the reference is defined and if it currently refers to a
valid entity in Creo Elements/Pro.
REF_GENERIC reference<:in>
Tests if the reference belongs to a generic member of a family
table.
REF_INSTANCE reference<:in>
Tests if the references belongs to an instance of a family table.
IS_FAMITEM_VALUE_GENERIC generic_mdl<:in> "instance_name"
"item_name"
Tests if the family item value is set to default "*".
REF_PATTERN_MEMBER reference<:in>
Tests if the reference is member of a pattern.
REF_PATTERN_HEAD reference<:in>
Tests if the reference is the head of a pattern.
REF_PATTERN_LEADER reference<:in>
Tests if the reference is the leader of a pattern.
REF_GROUP_MEMBER reference<:in>
Tests if the reference is member of a group.
REF_GROUP_HEAD reference<:in>
Tests if the reference is the head of a group.
RELATION_EXIST reference<:in>
Tests if the referenced model or feature contains a relations.
LAYER_EXIST reference<:in> "layer_name"
Test if the reference model contains a layer of the specified name.
ERROR
Tests if an error has occurred which has not terminated the program
due to a BEGIN_CATCH_ERROR command.
GUI_CANCELLED
Test if the graphical user interface was terminated with the cancel
button. This condition is only useful for the CONFIG_ELEM option
CONTINUE_ON_CANCEL. Use CLEAR_GUI_CANCELLED to clear this flag.
EXCEL_CONNECTED
Tests if a connection to Microsoft Excel is established.
EXCEL_HAS_DOCUMENT
Tests if a document is opened in Microsoft Excel.
WINWORD_CONNECTED
Tests if a connection to Microsoft Word is established.
ODBC_CONNECTED
Tests if a connection to ODBC is established.
FTP_CONNECTED
Tests if a connection to an FTP server is established.
PDM_CONNECTED
Tests if a connection to Intralink or PDMLink is established. Prior
to Wildfire 3 the connected status is determined by SmartAssembly >
Windchill session.
IS_DESIGN_SERVER_SESSION
Figures out if SmartAssembly runs in an SmartDesignServer
environment.
FILE_VALID file<:in>
Tests if a file handle is valid.
FILE_END file<:in>
Tests if the end of a file was reached.
PIPELINE_MEMBER reference<:in>
Tests if the reference is part of a pipeline.
HAS_GEOMCHK reference<:in>
Tests if the reference has geometry checks.
IS_SKELETON reference<:in>
Tests if the reference belongs to a skeleton.
IS_FROZEN reference<:in>
Tests if the reference belongs to a frozen component.
IS_PACKAGED reference<:in>
Tests if the reference belongs to a packaged component. A component
is packaged when it has no constraints.
IS_UNDERCONSTRAINED reference<:in>
Test if the reference belongs to a component which is not fully
constraint.
IS_PLACED reference<:in>
Test if the reference is placed. Unplaced components are usually
created via Model > Assemble > Include.
IS_FROM_SEARCH_PATH reference<:in>
Tests if the reference belongs to a model which was retrieved from
a search path.
IS_READONLY reference<:in>
Tests if the reference belongs to a component which has read only
features.
CURRENT_MDL_AVAILABLE
Tests if a current model is available on the screen.
IS_TLA_ACTIVE
Tests if the current top level model is activated and non of its
child models.
IS_EXPLODED model
Tests if an assembly is exploded.
IS_EMBEDDED reference<:in>
Tests if the reference belongs to an embedded component.
IS_CONCAVE_SURFACE reference<:in>
Tests if the reference is a concave surface.
IS_CONVEX_SURFACE reference<:in>
Tests if the reference is a convex surface.
IS_SMT_BEND_SURFACE reference<:in>
Tests if the reference is a sheet metal bend surface.
IS_FAILED reference<:in>
Tests if a feature is failed.
IS_HIDDEN reference<:in>
Tests if a feature is hidden by the right mouse button > Hide
command.
TOOLKIT_HANDLE_VALID handle<:in>
Tests if a Toolkit handle is valid.
JLINK_HANDLE_VALID handle<:in>
Test if a J-Link handle is valid.
IS_FLEXIBLE reference<:in>
Test if the reference belongs to a component which is set as
flexible.
IS_FLEXIBLE_PREDEFINED reference<:in>
Test if the reference belongs to a model with predefined
flexibility.
IS_INSERT_MODE_ACTIVE reference<:in>
Test if the reference belongs to a model with active insert mode.

condition term
Multiple of the conditions listed above can be connected with logical
operators AND and OR. Furthermore the opposite of a condition could
be specified with NOT option.
Example
IF REF_VALID refEdge AND param1 < 18.0
...
END_IF
Assignment Operations
In case parameters are already defined by the script language,
contents could be assigned by assignment operations.
parameter = value
Normal assignment operator. String or numerical values could be
assigned to an existing parameter. Also string expressions or math
expressions could be used on the right side of the assignment. The
data type of the parameter is converted to the data type of the
value.
parameter := value
Cast assignment operator. String or numerical values could be
assigned to an existing parameter. Also string expressions or math
expressions could be used on the right side of the assignment. The
data type of the parameter is preserved.
parameter ++
Increase operator for numerical parameters. The value is increased
by 1. This is an abbreviation for parameter = parameter + 1.
parameter --
Decrease operator for numerical parameters. The value is decreased
by 1. This is an abbreviation for parameter = parameter - 1.
parameter += value
Add a value to an existing numerical parameter. The value could be
build up as math expression. This is an abbreviation for parameter
= parameter + value.
parameter -= value
Subtract a value from an existing numerical parameter. The value
could be build up as math expression. This is an abbreviation for
parameter = parameter - value.
parameter *= value
Multiply a value with an existing numerical parameter. The value
could be build up as math expression. This is an abbreviation for
parameter = parameter * value.
parameter /= value
Divide an existing numerical parameter through a value. The value
could be build up as math expression. This is an abbreviation for
parameter = parameter / value.
Also defined references can be assigned by an operator. In this case
only the direct assignment is supported.
reference1 = reference2
About Creo Parametric Parameters
Various Creo Parametric parameters can be used to influence the
behaviour of the component processing.
The following parameters can be applied as model or as component
parameters.
BUW_NO_COPY — to avoid that a model is copied to a new name when
created from library.
BUW_NO_MODIFY — to avoid that a component is modified in the
component description block.
BUW_NO_BOM — to avoid that bill of material parameters are updated.
BUW_INTERF_CHECK — to exclude components and its sub components
from collision detection.
BUW_INTERF_LEVEL — to exclude components and sub components from
collision detection for a specific level.
BUW_NO_COPY
A BUW_NO_COPY parameter at the component feature or at the model can
avoid that the model is copied to a new name when a component is
created from library.
Use a string parameter with content y or a YES/NO parameter with YES
to disable the copying process.
BUW_NO_MODIFY
A BUW_NO_MODIFY parameter at the component feature or at the model
can avoid that the model is modified when processing the component
description block.
Use a string parameter with content y or a YES/NO parameter with YES
to avoid that parameters are updated or the name is changed.
BUW_NO_BOM
A BUW_NO_BOM parameter at the component feature or at the model can
avoid that bill of material parameters are assigned to this
component.
Use a string parameter with content y or a YES/NO parameter with YES
to avoid that bill of material parameters are assigned.
BUW_INTERF_CHECK
A BUW_INTERF_CHECK parameter can be used to exclude a component in
the INTERF_MDL FOR loop option from being checked for collision. In
case of a string parameter with content "NO", the component is
excluded.
In case of an integer parameter an interference check level can be
used. The level is defined by the BUW_INTERF_LEVEL parameter of the
model which is used for collision detection. In case the
BUW_INTERF_CHECK parameter value is greater or equal to the
BUW_INTERF_LEVEL, the component is not tested for collision
detection.
BUW_INTERF_LEVEL
An integer parameter BUW_INTERF_LEVEL could be used to define a
collision detection interference level to exclude a component in the
INTERF_MDL FOR loop option from being checked for collision. It works
in combination with the BUW_INTERF_CHECK parameter of the component
which is checked for collision.
Cut out with different Interferences
Frequently components have to be cut out by different clearances. To
figure out the intersected part a interference test has to be
processed.
Quilts are only considered by the interference test, when they are
visible. This provides the technology to control by the user of
layers which quilts are tested against interference and which not.
In the following example two quilts, QUILT1 and QUILT2, have to be
cut out with different clearances, specified by the parameters
DIM_CLEAR1 and DIM_CLEAR2. Therefore, the quilts are placed on
different layers that are displayed and blanked for interference
detection.
Example
SET_LAYER_STATUS FIRST_SURFACE DISPLAY
SET_LAYER_STATUS SECOND_SURFACE BLANK
FOR CUT_MDL REF INTERF_MDL THIS
CREATE_UDF QUILT_CUT_CLEARANCE CUT_MDL
UDF_REF REF_QUILT QUILT1
UDF_DIM REF_QUILT_CLEARANCE DIM_CLEAR1
END_CREATE_UDF
END_FOR
SET_LAYER_STATUS FIRST_SURFACE BLANK
SET_LAYER_STATUS SECOND_SURFACE DISPLAY
FOR CUT_MDL REF INTERF_MDL THIS
CREATE_UDF QUILT_CUT_CLEARANCE CUT_MDL
UDF_REF REF_QUILT QUILT1
UDF_DIM REF_QUILT_CLEARANCE DIM_CLEAR2
END_CREATE_UDF
END_FOR
Reusing References and Parameters
To create or copy an existing component references and parameter
variables needs to be retrieved from the previous instance. The
following technique shows how to store this information to a
component feature in Creo Elements/Pro and retrieve it later on. By
using IF ELEM_NEW and IF ELEM_EXIST it can be figured out if a
component is created new or if it is created based on an existing
one.
When creating a component SET_FEAT_PARAM and SAVE_REFERENCE store
information to the latest created component feature. On creating a
component by use of an existing one, SEARCH_FEAT_PARAM and
RETRIEVE_REFERENCE retrieve this information.
Example
IF ELEM_NEW
CONFIG_ELEM
END_IF
IF ELEM_EXIST
SEARCH_FEAT_PARAM COMP_FEAT DIAMETER DIA1
RETRIEVE_REFERENCE COMP_FEAT REF1
END IF
ASSEMBLE
...
END_ASSEMBLE
SET_FEAT_PARAM COMP_FEAT DIA1
SAVE_REFERENCE COMP_FEAT REF1
Retrieving GUI variables for modification
Using the modify command on a component brings up the question which
value should appear in the dialog mask for a parameter variable in
case the designer has modified the parameter inside Creo Elements/Pro
manually. The following technique has been implemented to give
control on this issue:
Parameter variables which are retrieved from Creo Elements/Pro or
calculated by other variables will show up the new content in the
user dialog.
Parameter variables which are not retrieved or calculated will be
restored by the old value of the dialog.
Example for part, part_copy, asm, asm_copy programs
The following example assembles a block with variable length, depth
and height on a coordinate system. In case the user modifies the
dimensions manually after the block was assembled there is different
behaviour for the length, width and height.
On modification the following values will appear in the user
interface:
LENGTH: will be set do the dimension value because of the
SEARCH_MDL_PARAM command.
DEPTH: will always be set to 250, because it is defined on this
value.
HEIGHT: will be set to the original value which was entered in the
user interface, since it is not set to any other value.
BEGIN_GUI_DESCR

USER_SELECT CSYS asmCsys


USER_INPUT_PARAM DOUBLE LENGTH
USER_INPUT_PARAM DOUBLE DEPTH
USER_INPUT_PARAM DOUBLE HEIGHT

END_GUI_DESCR

BEGIN_ASM_DESCR

SEARCH_MDL_PARAM THIS LENGTH LENGTH


DECLARE_VARIABLE DOUBLE DEPTH 250
SEARCH_MDL_REF THIS CSYS cs0 compCsys
CONFIG_ELEM
ASSEMBLE THIS
CSYS asmCsys compCsys
END_ASSEMBLE

END_ASM_DESCR
Example for udf programs
In case of UDF programs which place several UDFs the following tasks
has to be solved.
1. Identify the UDFs created by this program.
The UDF which was selected to initiate the modify functionality
can be found be the keyword COMP_FEAT. References for remaining
UDFs must be stored and retrieved from this feature by
SAVE_REFERENCE and RETRIEVE_REFERENCE.
2. Read the current values for the variable dimensions.
This can be achieved by the command SEARCH_UDF_DIM.
BEGIN_ASM_DESCR
DECLARE_VARIABLE DOUBLE dia1 50
DECLARE_VARIABLE DOUBLE dia2 75
DECLARE_VARIABLE DOUBLE dia3 100
IF ELEM_REDEFINE
RETRIEVE_REFERENCE COMP_FEAT secondUdf
RETRIEVE_REFERENCE COMP_FEAT thirdUdf
SEARCH_UDF_DIM COMP_FEAT dia dia1
SEARCH_UDF_DIM secondUdf dia dia2
SEARCH_UDF_DIM thirdUdf dia dia3
END_IF
CONFIG_ELEM
CREATE_UDF circle coord1 firstUdf
UDF_REF REF_CSYS coord1
UDF_DIM DIA dia1
END_CREATE_UDF
CREATE_UDF circle coord2 secondUdf
UDF_REF REF_CSYS coord2
UDF_DIM DIA dia2
END_CREATE_UDF
CREATE_UDF circle coord3 thirdUdf
UDF_REF REF_CSYS coord3
UDF_DIM DIA dia3
END_CREATE_UDF
SAVE_REFERENCE firstUdf secondUdf
SAVE_REFERENCE firstUdf thirdUdf
END_ASM_DESCR
§
Using CONFIG_HTML
CONFIG_HTML provides a technique to launch a web page using a
JavaScript interface to communicate with SmartAssembly. As data
container inside SmartAssembly a document with the node
/CONFIG_HTML_DATA is used. Inside JavaScript this data is contained
in a JSON object.
Launching the web page
Use CONFIG_HTML to launch a web page in SmartAssembly. This page
should contains the following lines at the end of its body.
<script src="sas/jquery/jquery.min.js"></script>
<script src="sas/SmartAssembly/SmartAssembly.js"></script>
<script src="my_application.js"></script>
The first two lines include jQuery and the SmartAssembly JavaScript
interface. The prefix sas describes the location in
<SmartAssembly>/js/packages. The third line points to the
application. The path is considered relative to the document root
provides with the CONFIG_HTML command.
Communication between web page and SmartAssembly
In order to communicate between the JavaScript application and
SmartAssembly the SmartAssembly.js file contains the interface.

SAS.cancel()
Cancels the CONFIG_HTML command. No commands after it will be
processed.

SAS.ok()
Commits the CONFIG_HTML command. The following commands will be
processed.

SAS.execute(program file, input, onSuccess, onError)


Provides the possibility to call a SmartAssembly program file. The
command requires the following arguments:
program files — describes the program file relatively to the
document root.
input — describes the data which should be supplied to
SmartAssembly. This should be an object in JSON notation.
onSuccess(result) — defines the callback function to execute in
case the SmartAssembly program was running successful. The argument
result contains the result data as a JSON object.
onError() — defines the callback function to execute in case the
SmartAssembly program failed.
Furthermore SmartAssembly.js contains a mechanism constantly sending
a heartbeat to SmartAssembly to track if the web page is still
active.
Communication between SmartAssembly and the web page
The commands GET_CONFIG_HTML_DATA and SET_CONFIG_HTML_DATA provide
the mechanism to access the supplied data in SAS.execute and to
modify it.
§
Avoiding ambiguity for negative numbers
In case negative numbers are used as an argument, they could be
misinterpreted if another number or a variable is used in the
previous argument. The following example shows the problem:
SET_DRW_TABLE_FORMAT refDrw 0 -1 -1 HEIGHT 5
The three arguments 0 -1 -1 are interpreted as a math expression and
calculated to -2. Therefor the parsing fails with the information
that there are missing arguments. There are two ways to prevent this
problem:

Use variables to avoid ambiguous negative numbers


In the following example using variables for the negative numbers
prevents the misinterpretation.
DECLARE_VARIABLE INTEGER row
DECLARE_VARIABLE INTEGER col
row = -1
col = -1
SET_DRW_TABLE_FORMAT refDrw 0 row col HEIGHT 5

Use brackets to avoid ambiguous math calculation


In the following example using brackets around the negative numbers
prevents the misinterpretation.
SET_DRW_TABLE_FORMAT refDrw 0 (-1) (-1) HEIGHT 5.

You might also like