API Documentation > Classes > Class pfcModelDescriptor
Class pfcModelDescriptor
Description
This class includes the information that identifies a Creo Parametric model or file.
Model descriptors can be used to represent models that are not currently in session.
The possible model types are as follows:
MDL_ASSEMBLY
MDL_PART
MDL_DRAWING
MDL_2D_SECTION
MDL_LAYOUT
MDL_DWG_FORMAT
MDL_MFG
MDL_REPORT
MDL_MARKUP
MDL_DIAGRAM
This descriptor does not support the Multi-CAD concept. Refer to Object Toolkit for Multi-CAD support.
See Also:
User Guide References:
Property Summary
string
The device. On UNIX systems, this field contains an empty string. If you change this value on a UNIX system, Creo Parametric may experience problems when reading or writing the file.
/* optional */ number
The version of the file
/* optional */ string
The name of the generic model. If the model is not an instance, this attribute must be null or an empty string.
string
This is Obsoleted. The host. If the model resides on the local Windows or UNIX host, this field contains an empty string. If you change this value, Creo Parametric may experience problems when reading or writing the file.
string
The name of the model, or, if the model is an instance, the instance name. This string can be neither null nor empty.
string
The path to the file. Note that this argument is ignored by the RetrieveModel method.
The model type. If the model descriptor represents a Creo Parametric related file that is not a true model type, a pfcXUnusedValue exception will result if you try to access this value.
Method Summary
Create (pfcModelType Type, string InstanceName, /* optional */ string GenericName)
Creates a new model descriptor.
CreateFromFileName (string FileName)
Creates a new model descriptor object, given a file name string.
string
Retrieves the extension of the model identified by the model descriptor.
string
Returns the file name for the object represented by the model descriptor.
string
Retrieves the full name of the model identified by the model descriptor.
Property Detail
string
Device
The device. On UNIX systems, this field contains an empty string. If you change this value on a UNIX system, Creo Parametric may experience problems when reading or writing the file.
/* optional */ number
FileVersion
The version of the file
/* optional */ string
GenericName
The name of the generic model. If the model is not an instance, this attribute must be null or an empty string.
string
Host
This is Obsoleted. The host. If the model resides on the local Windows or UNIX host, this field contains an empty string. If you change this value, Creo Parametric may experience problems when reading or writing the file.
string
InstanceName
The name of the model, or, if the model is an instance, the instance name. This string can be neither null nor empty.
string
Path
The path to the file. Note that this argument is ignored by the RetrieveModel method.
The model type. If the model descriptor represents a Creo Parametric related file that is not a true model type, a pfcXUnusedValue exception will result if you try to access this value.
Method Detail
Create
(pfcModelType Type, string InstanceName, /* optional */ string GenericName)
Creates a new model descriptor.
Parameters:
Type
The model type
InstanceName
The name of the model, or, if the model is an instance, the instance name.This string can be neither null nor empty.
GenericName
The name of the generic model. If the model is not an instance, this attributemust be null or an empty string.
Returns:
The new ModelDescriptor
User Guide References:
CreateFromFileName
(string FileName)
Creates a new model descriptor object, given a file name string.
Exceptions thrown (but not limited to):
pfcXInvalidFileName - Invalid File Name
See Also:
Parameters:
FileName
The file name, of the form "<name>.<extension>".
Returns:
The new model descriptor object.
User Guide References:
string
GetExtension
()
Retrieves the extension of the model identified by the model descriptor.
Model extension gives an extension of the file which stores the model information. Models of the same type have the same extension. The following model extensions are used:
"asm" - for MDL_ASSEMBLY
"prt" - for MDL_PART
"drw" - for MDL_DRAWING
"sec" - for MDL_2D_SECTION and for MDL_3D_SECTION
"lay" - for MDL_LAYOUT
"frm" - for MDL_DWG_FORMAT
"mfg" - for MDL_MFG
"rep" - for MDL_REPORT
"mrk" - for MDL_MARKUP
"dgm" - for MDL_DIAGRAM
Other extensions may be returned for a model descriptor that represents a Creo Parametric file that does not match one of the above types.
Returns:
The model extension
string
GetFileName
()
Returns the file name for the object represented by the model descriptor.
See Also:
Returns:
The file name, of the form "<name>.<extension>".
string
GetFullName
()
Retrieves the full name of the model identified by the model descriptor.
Returns:
The name of the model. If the model is an instance, its full name has the formInstanceName<GenericName>
User Guide References:
Was this helpful?