User's Guide > Fundamentals > Creo Toolkit Style
Creo Toolkit Style
Creo TOOLKIT uses an object-oriented programming style. Data structures for the transfer information between Creo Parametric and the application are not directly visible to the application. These data structures are accessible only with Creo TOOLKIT functions.
Objects and Actions
The most basic Creo TOOLKIT concepts are objects and actions.
Each Creo TOOLKIT library C function performs an action on a specific type of object. The Creo TOOLKIT convention for function names is the prefix “Pro” the name of the object type, and the name of the action it performs, for example:
A Creo TOOLKIT object is a well-defined and self-contained C structure used to perform actions relevant to that object. Most objects are items in the Creo Parametric database, such as features and surfaces. Others, however, are more abstract or transient, such as the information resulting from a select action.
In Creo TOOLKIT, each type of object has a standard name consisting of a “Pro” plus capitalized word that describes the object. Simple examples of Creo TOOLKIT object types and their Creo Parametric equivalents are as follows:
ProFeature—A feature
ProSurface—A surface
ProSolid—An abstract object created to exploit the commonality between parts and assemblies
ProWcell—A workcell feature in a manufacturing assembly
Creo TOOLKIT provides a C typedef for each object used for variables and arguments that refer to those objects. Creo TOOLKIT objects have a hierarchical relationship that reflects the Creo Parametric database. For example, a ProFeature object can contain objects of type ProSurface (among others).
For example, the following functions have actions that are single verbs:
Some Creo TOOLKIT functions require names that include more than one object type. The function names have the object types first, then the action. For example:
ProWcellTypeGet()
The action verbs indicate the type of action being performed, as shown in the following table.
Action Verb
Type of Action
Get
Read information directly from the Creo Parametric database.
Eval
Provide the result of a simple calculation.
Compute
Provide the result of a computation that typically involves numerical analysis of the model geometry.
Examples are:
To illustrate further, function ProSolidOutlineGet() reads from Creo Parametric the currently stored solid outline, but ProSolidOutlineCompute() invokes a recomputation of that information. Use ProSolidOutlineCompute() to compute an accurate outline of a solid.
Note:
 
Do not use ProSolidOutlineGet() to calculate the outline of a solid. It will not return a properly calculated outline.
Other Creo TOOLKIT function conventions are that the first argument identifies the object, and input arguments come before output arguments.
¿Fue esto útil?