Methods Introduced:
The method pfcModel::IsNativeModel returns true, if the specified model is a native Creo model. It returns false, when the model is a non-native part or assembly created in other CAD applications.
The method pfcModel::GetFileName retrieves the model file name in the "name"."type" format.
The method pfcModel::GetCommonName retrieves the common name for the model. This name is displayed for the model in Windchill PDMLink.
Use the method pfcModel::GetIsCommonNameModifiable to identify if the common name of the model can be modified. You can modify the name for models that are not yet owned by
Windchill PDMLink, or in certain situations if the configuration option let_proe_rename_pdm_objects is set to yes.
The method pfcModel::GetFullName retrieves the full name of the model in the instance <generic> format.
The method pfcModel::GetGenericName retrieves the name of the generic model. If the model is not an instance, this name must be NULL or an empty string.
The method pfcModel::GetInstanceName retrieves the name of the model. If the model is an instance, this method retrieves the instance name.
The method wfcWModel::GetDefaultName gets the default name assigned to the model by Creo application at the time of creation.
The method pfcModel::GetOrigin returns the complete path to the file from which the model was opened. This path can be a location on disk from a Windchill
workspace, or from a downloaded URL.
The method pfcModel::GetRelationId retrieves the relation identifier of the specified model. It can be NULL.
The method pfcModel::GetDescr returns the descriptor for the specified model. Model descriptors can be used to represent models not currently in session.
Note
The methods pfcModel::GetFullName, pfcModel::GetGenericName, and pfcModel::GetDescr throw an exception pfcXtoolkitCantOpen if called on a model instance whose immediate generic is not in session. Handle this exception and typecast the model as
pfcSolid, which in turn can be typecast as pfcFamilyMember, and use the method pfcFamilyMember::GetImmediateGenericInfo to get the model descriptor of the immediate generic model. The model descriptor can be used to derive the full name or generic
name of the model.
If you wish to switch this behavior to the pre-Wildfire 4.0 mode, set the configuration option retrieve_instance_dependencies to instance_and_generic_deps.
The method pfcModel::GetType returns the type of model in the form of the pfcModelType object. The types of models are as follows:
|
• |
pfcMDL_ASSEMBLY—Specifies an assembly. |
|
• |
pfcMDL_PART—Specifies a part. |
|
• |
pfcMDL_DRAWING—Specifies a drawing. |
|
• |
pfcMDL_2D_SECTION—Specifies a 2D section. |
|
• |
pfcMDL_LAYOUT—Specifies a notebook. |
|
• |
pfcMDL_DWG_FORMAT—Specifies a drawing format. |
|
• |
pfcMDL_MFG—Specifies a manufacturing model. |
|
• |
pfcMDL_REPORT—Specifies a report. |
|
• |
pfcMDL_MARKUP—Specifies a drawing markup. |
|
• |
pfcMDL_DIAGRAM—Specifies a diagram |
|
• |
pfcMDL_CE_SOLID—Specifies a Layout model.
Note
Creo Object
TOOLKIT C++ methods will only be able to read models of type Layout, but will not be able to pass Layout models as input to other methods.
PTC recommends that you review all Creo Object
TOOLKIT C++ applications that use the enumerated type pfcModelType and modify the code as appropriate to ensure that the applications work correctly.
|
The method pfcModel::GetIsModified identifies whether the model has been modified since it was last saved.
The method pfcModel::GetVersion returns the version of the specified model from the PDM system. It can be NULL, if not set.
The method pfcModel::GetRevision returns the revision number of the specified model from the PDM system. It can be NULL, if not set.
The method pfcModel::GetBranch returns the branch of the specified model from the PDM system. It can be NULL, if not set.
The method pfcModel::GetReleaseLevel returns the release level of the specified model from the PDM system. It can be NULL, if not set.
The method pfcModel::GetVersionStamp returns the version stamp of the specified model. The version stamp is a Creo specific identifier that changes with each change made to the model.
The method pfcModel::ListDependencies returns a list of the first-level dependencies for the specified model in the Creo workspace in the form of the pfcDependencies object.
Use the method
pfcModel::CleanupDependencies to clean the dependencies for an object in the
Creo workspace.
Note
Do not call the method pfcModel::CleanupDependencies during operations that alter the dependencies, such as, restructuring components and creating or redefining features.
The method pfcModel::ListDeclaredModels returns a list of all the first-level objects declared for the specified model.
The method pfcModel::CheckIsModifiable identifies if a given model can be modified without checking for any subordinate models. This method takes a boolean argument
ShowUI that determines whether the Creo conflict resolution dialog box should be displayed to resolve conflicts, if detected. If this argument is false, then the
conflict resolution dialog box is not displayed, and the model can be modified only if there are no conflicts that cannot
be overridden, or are resolved by default resolution actions. For a generic model, if ShowUI is true, then all instances of the model are also checked.
The method pfcModel::CheckIsSaveAllowed identifies if a given model can be saved along with all of its subordinate models. The subordinate models can be saved based
on their modification status and the value of the configuration option save_objects. This method also checks the current user interface context to identify if it is currently safe to save the model. Thus,
calling this method at different times might return different results. This method takes a boolean argument ShowUI. Refer to the previous method for more information on this argument.
The method wfcWModel::GetSubType returns the subtype of the specified model using the enumerated data type wfcModelSubType. This is similar to selecting types and sub-types of models available in the Creo user interface using the command .