Library | File

Class pfcModelDescriptor

# include <pfcModel.h>

class pfcModelDescriptor
 : public virtual xobject
{
    xdeclare(pfcModelDescriptor)
    ...
};
This is a COMPACT class.



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:

This descriptor does not support the Multi-CAD concept. Refer to Object Toolkit for Multi-CAD support.


See Also:
pfcModel::Backup(pfcModelDescriptor_ptr), pfcBaseSession::OpenFile(pfcModelDescriptor_ptr), pfcBaseSession::RetrieveModel(pfcModelDescriptor_ptr), pfcBaseSession::GetModelFromDescr(pfcModelDescriptor_ptr)
Manual References:
Action Listeners: Model Level Action listeners, Models: Retrieving Models



Method Summary

static pfcModelDescriptor_ptrCreate (pfcModelType Type, xrstring InstanceName, optional xrstring GenericName)
Creates a new model descriptor.
static pfcModelDescriptor_ptrCreateFromFileName (xrstring FileName)
Creates a new model descriptor object, given a file name string.
xstringGetDevice ()
voidSetDevice (xrstring value)
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.
xstringGetExtension ()
Retrieves the extension of the model identified by the model descriptor.
xstringGetFileName ()
Returns the file name for the object represented by the model descriptor.
optional xintGetFileVersion ()
voidSetFileVersion (optional xint value)
The version of the file
xstringGetFullName ()
Retrieves the full name of the model identified by the model descriptor.
optional xstringGetGenericName ()
voidSetGenericName (optional xrstring value)
The name of the generic model. If the model is not an instance, this attribute must be null or an empty string.
xstringGetHost ()
voidSetHost (xrstring value)
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.
xstringGetInstanceName ()
voidSetInstanceName (xrstring value)
The name of the model, or, if the model is an instance, the instance name. This string can be neither null nor empty.
xstringGetPath ()
voidSetPath (xrstring value)
The path to the file. Note that this argument is ignored by the RetrieveModel method.
pfcModelTypeGetType ()
voidSetType (pfcModelType value)
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

pfcModelTypeGetType ()
voidSetType (pfcModelType value)

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.
Manual References:
Models: Model Descriptors




xstringGetInstanceName ()
voidSetInstanceName (xrstring value)

The name of the model, or, if the model is an instance, the instance name. This string can be neither null nor empty.
Manual References:
Models: Model Descriptors




optional xstringGetGenericName ()
voidSetGenericName (optional xrstring value)

The name of the generic model. If the model is not an instance, this attribute must be null or an empty string.
Manual References:
Models: Model Descriptors




xstringGetHost ()
voidSetHost (xrstring value)

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.




xstringGetDevice ()
voidSetDevice (xrstring value)

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.
Manual References:
Models: Model Descriptors




xstringGetPath ()
voidSetPath (xrstring value)

The path to the file. Note that this argument is ignored by the RetrieveModel method.
Manual References:
Models: Model Descriptors




optional xintGetFileVersion ()
voidSetFileVersion (optional xint value)

The version of the file
Manual References:
Models: Model Descriptors, Models: Retrieving Models




xstringGetFullName ()

Retrieves the full name of the model identified by the model descriptor.
Manual References:
Models: Model Descriptors
Returns:
The name of the model. If the model is an instance, its full name has the formInstanceName<GenericName>



xstringGetExtension ()

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



xstringGetFileName ()

Returns the file name for the object represented by the model descriptor.
See Also:
pfcModelDescriptor::CreateFromFileName(xrstring), pfcModelDescriptor::Create(pfcModelType, xrstring, optional xrstring), pfcBaseSession::GetModelFromFileName(xrstring), pfcBaseSession::RetrieveModel(pfcModelDescriptor_ptr)
Returns:
The file name, of the form "<name>.<extension>".



static pfcModelDescriptor_ptrCreate (pfcModelType Type, xrstring InstanceName, optional xrstring GenericName)

Creates a new model descriptor.
Manual References:
Models: Model Descriptors, Models: Model Descriptors
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



static pfcModelDescriptor_ptrCreateFromFileName (xrstring FileName)

Creates a new model descriptor object, given a file name string.

Exceptions thrown (but not limited to):

pfcXInvalidFileName - Invalid File Name


See Also:
pfcModelDescriptor::GetFileName(), pfcModelDescriptor::Create(pfcModelType, xrstring, optional xrstring), pfcBaseSession::GetModelFromFileName(xrstring), pfcBaseSession::RetrieveModel(pfcModelDescriptor_ptr)
Manual References:
Models: Model Descriptors, Models: Model Descriptors
Parameters:
FileName
The file name, of the form "<name>.<extension>".
Returns:
The new model descriptor object.