Model Items
A “model item” is a generic object used to represent any item contained in any type of model, for the purpose of functions whose actions are applicable to all these types of item. (Some items, such as “version stamp,” retain their own object types.)
The object type ProModelitem is a DHandle (data handle), a structure that contains the item type, the persistent integer identifier of the item, and the handle to the owning object.
The object ProGeomitem, a generic geometrical object described later in this guide, is an instance of ProModelitem, and is a DHandle that shares the same type declaration. Therefore, the functions in this section are also directly applicable to ProGeomitem objects.
The typedef for the ProModelitem data handle is as follows:
typedef struct pro_model_item
{
ProType type;
int id;
ProMdl owner;
} ProModelitem
Functions Introduced:
The function
ProModelitemByNameInit() returns a pointer to an item (structure), given the name and the type of the item. The valid item types are:
• Edge
• Surface
• Feature
• Co-ordinate System
• Axis
• Point
• Quilt
• Curve
• Layer
• Note
• Combined State
The function
ProModelitemInit() is used to generate a
ProModelitem object from the information contained in the structure. You can create such a structure directly, but using this function you can also confirm the existence of the item in the model database.
The function
ProModelitemMdlGet() extracts the
ProMdl handle from the structure.
The function
ProModelitemDefaultnameGet() gets the default name for a new model item of a particular type if it was created taking the model handle as input.
The two functions
ProModelitemNameGet() and
ProModelitemNameSet() read and set the name of the
Creo+ database object referred to by the model item. These functions are therefore applicable to all the instances of
ProModelitem, such as
ProGeomitem and all its instances, including
ProSurface,
ProEdge,
ProCsys,
ProAxis, and
ProCombinedState.
|
• Driving or driven dimension of the type PRO_DIMENSION
• Reference dimension of the type PRO_REF_DIMENSION
• Symbol instance of the type PRO_SYMBOL_INSTANCE
• Surface finish of the type PRO_SURF_FIN
• Geometric tolerance of the type PRO_GTOL
|
The function
ProModelitemNameCanChange() identifies whether the name of the model item can be modified by the user or by
Creo TOOLKIT.
The function
ProModelitemUsernameDelete() deletes the user-defined name of the model item from the
Creo+ database.
The functions
ProModelitemHide() and
ProModelitemUnhide() are equivalent to the > and > commands in the
Creo+ menu, respectively.
ProModelitemHide() hides the specified model item, whereas
ProModelitemUnhide() unhides the model item.
The function
ProModelitemIsHidden() identifies if the specified model item is hidden.