3. MODES
Mode in Pro/Toolkit means the type of model currently being
edited by the user
The possible modes are the options under the Pro/ENGINEER
command File > New
ProMode enumerated data type, declared in ProMode.h
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
4. MODES API
ProModeCurrentGet()
ProSectionIsActive()
outputs the mode in which
Pro/ENGINEER is being used
(example: PRO_MODE_PART,
PRO_MODE_SKETCH etc)
If there is no current model
than API retunes error
PRO_TK_BAD_CONTEXT
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
5. MODES API
ProModeCurrentGet()
outputs the mode in which Pro/ENGINEER is being used (example:
PRO_MODE_PART, PRO_MODE_SKETCH etc)
If there is no current model than API retunes error PRO_TK_BAD_CONTEXT
ProSectionIsActive()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
7. MODELS
A model is a top-level object in a Pro/ENGINEER mode. For
example, in Part mode, the model is a part; in Assembly mode,
the model is an assembly
The declaration of ProMdl is as follows:
Typedef void* ProMdl;
ProSolid is an instance of ProMdl, and ProAssembly and ProPart
are instances of ProSolid
All these object types are represented in Pro/TOOLKIT by opaque
handles
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
8. MODELS
This section describes Pro/TOOLKIT models. The topics are as
follows
Creating Models
Identifying Models
Models in Session
File Management Operations
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
9. CREATE MODELS API
ProSolidCreate()
ProMfgCreate()
ProSection2DAlloc()
ProDrawingFromTmpltCreate()
ProMdlStartAction()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
10. CREATE MODELS API
ProSolidCreat()
Creates a new Pro/ENGINEER object of the specified type (Part or Assembly)
ProMfgCreate()
Creates new manufacturing models
ProSection2DAlloc()
Allocates a two-dimensional section
ProDrawingFromTmpltCreate()
Creating Drawings from Templates
ProMdlStartAction()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
11. IDENTIFYING MODELS API
ProMdlNameGet()
ProMdlTypeGet()
ProMdlInit()
ProMdlIdGet()
ProMdlDataGet()
ProMdlSubtypeGet()
ProMdlToModelitem()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
12. IDENTIFYING MODELS API
ProMdlNameGet() &ProMdlTypeGet()
Providethe name and type of a model, given its ProMdl
handle. Type is enumerated data type ProType
ProMdlInit()
ProMdlIdGet()
ProMdlDataGet()
ProMdlSubtypeGet()
ProMdlToModelitem()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
13. IDENTIFYING MODELS API
ProMdlNameGet() &ProMdlTypeGet()
ProMdlInit()
Provides a valid ProMdl handle for a given name and
type
ProMdlIdGet()
ProMdlDataGet()
ProMdlSubtypeGet()
ProMdlToModelitem()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
14. IDENTIFYING MODELS API
ProMdlNameGet() &ProMdlTypeGet()
ProMdlInit()
ProMdlIdGet()
Provides integer id to a model. It’s one of the way to identify the model(ex. Surface ,edge etc), the identifier of a model is not
persistent between Pro/ENGINEER sessions
ProMdlDataGet()
ProMdlSubtypeGet()
ProMdlToModelitem()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
15. IDENTIFYING MODELS API
ProMdlNameGet() &ProMdlTypeGet()
ProMdlInit()
ProMdlIdGet()
ProMdlDataGet()
provides a C structure that contains information about the
name and location of the operating system file in which the
model is saved
ProMdlSubtypeGet()
ProMdlToModelitem()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
16. IDENTIFYING MODELS API
ProMdlNameGet() &ProMdlTypeGet()
ProMdlInit()
ProMdlIdGet()
ProMdlDataGet()
ProMdlSubtypeGet()
provides the subtype (such as sheet metal) of a specified
model. Valid model subtypes are Part, Assembly, or
Manufacturing. This is like finding subtypes at the
Pro/ENGINEER File > New > Model Type menu
ProMdlToModelitem()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
17. IDENTIFYING MODELS API
ProMdlNameGet() &ProMdlTypeGet()
ProMdlInit()
ProMdlIdGet()
ProMdlDataGet()
ProMdlSubtypeGet()
ProMdlToModelitem()
the first step in building a ProSelection object that
describes the role of a model in a parent assembly
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
18. MODELS IN SESSION API
ProSessionMdlList()
ProMdlCurrentGet()
ProMdlDependenciesList()
ProMdlDeclaredList()
ProMdlModificationVerify()
ProMdlIsModifiable()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
19. MODELS IN SESSION API
ProSessionMdlList()
provides an array of ProMdl handles to models of a
specified type currently in memory
ProMdlCurrentGet()
ProMdlDependenciesList()
ProMdlDeclaredList()
ProMdlModificationVerify()
ProMdlIsModifiable()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
20. MODELS IN SESSION API
Models in Session API
ProSessionMdlList()
ProMdlCurrentGet()
provides the ProMdl handle to the model currently
being edited by the user.
ProMdlDependenciesList()
ProMdlDeclaredList()
ProMdlModificationVerify()
ProMdlIsModifiable()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
21. MODELS IN SESSION API
Models in Session API
ProSessionMdlList()
ProMdlCurrentGet()
ProMdlDependenciesList()
provides an array of ProMdl handles to the models in
memory upon which a specified model depends. One
model depends on another if its contents reference that
model in some way
ProMdlDeclaredList()
ProMdlModificationVerify()
ProMdlIsModifiable()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
22. MODELS IN SESSION API
Models in Session API
ProSessionMdlList()
ProMdlCurrentGet()
ProMdlDependenciesList()
ProMdlDeclaredList()
provides an array of ProMdlhandles to layout models
that have been declared to a specified solid model
ProMdlModificationVerify()
ProMdlIsModifiable()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
23. MODELS IN SESSION API
Models in Session API
ProSessionMdlList()
ProMdlCurrentGet()
ProMdlDependenciesList()
ProMdlDeclaredList()
ProMdlModificationVerify()
tells you whether a specified model in memory has been
modified since it was last saved or retrieved
ProMdlIsModifiable()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
24. MODELS IN SESSION API
Models in Session API
ProSessionMdlList()
ProMdlCurrentGet()
ProMdlDependenciesList()
ProMdlDeclaredList()
ProMdlModificationVerify()
ProMdlIsModifiable()
checks if the specified model is modifiable
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
26. FILE MANAGEMENT OPERATION
ProMdlRetrieve()
retrieves the model into memory, but does not display it or make
it the current model
ProMdlSave()
ProMdlCopy()
ProMdlRename()
ProMdlBackup()
ProMdlDelete()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
27. FILE MANAGEMENT OPERATION
File Management Operation
ProMdlRetrieve()
ProMdlSave()
equivalent to the Save As command in the File pull-down menu of the
Pro/ENGINEER menu bar
ProMdlCopy()
ProMdlRename()
ProMdlBackup()
ProMdlDelete()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
28. FILE MANAGEMENT OPERATION
File Management Operation
ProMdlRetrieve()
ProMdlSave()
ProMdlCopy()
equivalent to the Save As command in the File pull-down menu of
the Pro/ENGINEER menu bar
ProMdlRename()
ProMdlBackup()
ProMdlDelete()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
29. FILE MANAGEMENT OPERATION
File Management Operation
ProMdlRetrieve()
ProMdlSave()
ProMdlCopy()
ProMdlRename()
equivalent to the Save As command in the File pull-down menu of
the Pro/ENGINEER menu bar
ProMdlBackup()
ProMdlDelete()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
30. FILE MANAGEMENT OPERATION
File Management Operation
ProMdlRetrieve()
ProMdlSave()
ProMdlCopy()
ProMdlRename()
equivalent to the Rename command in the File pull-down menu of
the Pro/ENGINEER menu bar
ProMdlBackup()
ProMdlDelete()
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
31. FILE MANAGEMENT OPERATION
File Management Operation
ProMdlRetrieve()
ProMdlSave()
ProMdlCopy()
ProMdlRename()
ProMdlBackup()
ProMdlDelete()
Makes a backup of an object in memory to a disk in a specified directory. This function is equivalent to the
Pro/ENGINEER command File, Backup
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
32. FILE MANAGEMENT OPERATION
File Management Operation
ProMdlRetrieve()
ProMdlSave()
ProMdlCopy()
ProMdlRename()
ProMdlBackup()
ProMdlDelete()
Deletes the specified model from memory and disk
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN
33. MODEL ITEMS
The object type ProModelitem is a Data handle
contains the item type, the persistent integer identifier of the item,
and the handle to the owning object
C structure
typedef struct pro_model_item
{
ProType type;
int id;
ProMdl owner;
} ProModelitem
CENTRE FOR COMPUTATIONAL TECHNOLOGIES - (CCTECH) WWW.CCTECH.CO.IN