Library | File

Class pfcBaseSession

# include <pfcSession.h>

class pfcBaseSession
 : public virtual pfcActionSource,
 : public virtual pfcDisplay,
 : public virtual pfcParent
{
    xaideclare(pfcBaseSession)
    ...
};



Description

This class defines the information about a Creo Parametric session.
Manual References:
Overview of Creo Object TOOLKIT C++: Casting of Creo Object TOOLKIT C++ pfc Classes to wfc Classes
Direct Known Subclasses:
pfcSession, wfcWBaseSession



Method Summary

voidAllowDuplicateModelItems (xbool val)
Turns on/off the control of creating duplicate model items.
voidAuthenticateBrowser (xrstring Username, xrstring Password)
Preset username and password to allow automatic login into HTTP servers that require authentication.
voidChangeDirectory (xrstring Path)
Changes Creo Parametric to another working directory.
voidCheckoutToWS (pfcModelDescriptors_ptr Objects, xrstring WSName, xbool AsLink, pfcRelCriterion RelCriterion)
Checks out a model from Pro/INTRALINK into the workspace.
voidCopyFileFromWS (xrstring SourceFile, xrstring TargetDirectory)
Copies a file from a Windchill workspace to a disk location.
voidCopyFileToWS (xrstring SourceFile, xrstring TargetWorkspace, optional xrstring PrimaryContent)
Copies a file from local disk to a Windchill workspace; either as a primary document or as secondary content of an existing document in the workspace.
pfcAssembly_ptrCreateAssembly (xrstring Name)
Creates an empty assembly.
pfcDrawing_ptrCreateDrawingFromTemplate (xrstring Name, xrstring Template, pfcModelDescriptor_ptr DrawingModel, pfcDrawingCreateOptions_ptr Options)
Creates a drawing from a template.
pfcWindow_ptrCreateModelWindow (pfcModel_ptr Mdl)
Creates or retrieves a window for a specified model.
pfcPart_ptrCreatePart (xrstring Name)
Creates a new empty part.
voidEraseUndisplayedModels ()
Erases models which are not used in any Creo Parametric windows.
pfcModelCheckResults_ptrExecuteModelCheck (pfcModel_ptr Model, optional pfcModelCheckInstructions_ptr Instructions)
Execute ModelCheck from an external application.
voidExportCurrentRasterImage (xrstring ImageFileName, pfcRasterImageExportInstructions_ptr Instructions)
Outputs a standard Creo Parametric raster output file (for current Window).
voidExportDirectVRML (pfcVRMLDirectExportInstructions_ptr ExportData)
Exports a Creo Parametric object from disk into VRML format.
pfcWSImportExportMessages_ptrExportFromCurrentWS (xstringsequence_ptr FileNames, xrstring TargetLocation, pfcRelCriterion Dependency)
Export specified objects from the current workspace to a disk in a linked session of Creo Parametric. Can be called only when there are no objects in session . The specified objects may be exported along with all or required by Creo Parametric dependents (recursively), according to a specified dependency criterion. All problems (warnings, conflicts or errors) of processing individual objects are logged in proimpex.errors file created in the Creo Parametric run directory.
voidExportProfileLoad (xrstring ProfileFile)
Loads profile for export.
voidFlushCurrentWindow ()
Forces the flush of pending display commands on the current window.
optional pfcModel_ptrGetActiveModel ()
Retrieves the handle to the active model.
optional pfcServer_ptrGetActiveServer ()
Gets the active server handle .
xstringGetAliasFromAliasedUrl (xrstring AliasedUrl)
Returns server alias from aliased URL.
optional pfcModel_ptrGetByRelationId (xint Id)
Returns the model, given its relation identifier.
optional xstringGetConfigOption (xrstring Name)
Retrieves the current value for the specified configuration file option.
optional xstringsequence_ptrGetConfigOptionValues (xrstring Name)
Retrieves the current value(s) for the specified configuration file option.
xstringGetConnectionId ()
Returns the connection id for the Creo Parametric session that this application is connected to. The identification string can be passed to external asynchronous applications to allow them to connect to this Creo Parametric session.
xstringGetCurrentDirectory ()
Gets the absolute path name of the current working directory for Creo Parametric.
optional pfcModel_ptrGetCurrentModel ()
The current Creo Parametric object, or null, if there is no current object
optional pfcWindow_ptrGetCurrentWindow ()
voidSetCurrentWindow (optional pfcWindow_ptr value)
The current Creo Parametric window
optional xstringGetCurrentWS ()
Returns the name of the Workspace currently registered in Creo Parametric.
pfcDimDisplayModeGetDimensionDisplayMode ()
voidSetDimensionDisplayMode (pfcDimDisplayMode value)
The current dimension display setting.
optional xstringGetEnvironmentVariable (xrstring Name)
Returns the value a system environment variable.
pfcModelTypeGetImportSourceType (xrstring FileToImport, pfcNewModelImportType NewModelType)
Returns the type of model that can be created from a 3D format file. Note: does not support all types of 3D formats.
xstringGetLocalizedMessageContents (xrstring MsgFile, xrstring Format, optional xstringsequence_ptr MessageTexts)
Writes a text message to a buffer string.
xstringGetMessageContents (xrstring MsgFile, xrstring Format, optional xstringsequence_ptr MessageTexts)
Writes a text message to a buffer string.
optional pfcModel_ptrGetModel (xrstring Name, pfcModelType Type)
Finds a model in the Creo Parametric session, given the model name and type.
optional pfcModel_ptrGetModelFromDescr (pfcModelDescriptor_ptr MdlDescr)
Finds a model in the Creo Parametric session, given the model descriptor.
optional pfcModel_ptrGetModelFromFileName (xrstring FileName)
Locates and returns a model handle given its file name.
xstringGetModelNameFromAliasedUrl (xrstring AliasedUrl)
Returns model name from aliased URL.
optional pfcWindow_ptrGetModelWindow (pfcModel_ptr Mdl)
Returns the window where a Creo Parametric model is displayed.
pfcPrintMdlOption_ptrGetPrintMdlOptions (pfcModel_ptr model)
Get model options for a specified model.
pfcPrinterPCFOptions_ptrGetPrintPCFOptions (xrstring filename, pfcModel_ptr model)
Get the print options from a specified PCF file.
pfcPrintPlacementOption_ptrGetPrintPlacementOptions ()
Get the current print placement options.
pfcPrintPrinterOption_ptrGetPrintPrinterOptions (xrstring printer_type)
Get printer options for a specified printer.
optional pfcDll_ptrGetProToolkitDll (xrstring ApplicationId)
Finds a Creo Parametric TOOLKIT DLL, given its identifer string.
pfcColorRGB_ptrGetRGBFromStdColor (pfcStdColor StdClr)
Retrieves the RGB values for the specified color.
optional pfcServer_ptrGetServerByAlias (xrstring Alias)
Gets the server handle for a given server alias.
optional pfcServer_ptrGetServerByUrl (xrstring Url, optional xrstring WorkspaceName)
Gets the server handle for a given server url and workspace name.
pfcServerLocation_ptrGetServerLocation (xrstring Url)
Gets the server location handle for a given server url.
xstringGetUrlFromAliasedUrl (xrstring AliasedUrl)
Converts an an aliased url (wtpub://alias/etc/p.prt) suitable for use in functions like ProMdlLoad to an unaliased URL (http://windchillserver.ptc.com/etc).
optional pfcWindow_ptrGetWindow (xint Id)
Retrieves the window object by its identifier.
pfcModel_ptrImport2DModel (xrstring NewModelName, pfcModelType Type, xrstring FilePath, pfcImport2DInstructions_ptr Instructions)
Creates a two-dimensional model from a geometry file.
pfcModel_ptrImportNewModel (xrstring FileToImport, pfcNewModelImportType NewModelType, pfcModelType Type, xrstring NewModelName, optional pfcLayerImportFilter_ptr Filter)
Imports a 3D format file as a new model.
pfcWSImportExportMessages_ptrImportToCurrentWS (xstringsequence_ptr Filepaths, pfcRelCriterion Dependency)
Import specified objects from a disk to the current workspace in a linked session of Creo Parametric. Can be called only when there are no objects in session . The specified objects may be imported along with all or required by Creo Parametric dependents (recursively), according to a specified dependency criterion. All problems (warnings, conflicts or errors) of processing individual objects are logged in proimpex.errors file created in the Creo Parametric run directory.
xboolIsConfigurationSupported (pfcExportType Type, pfcAssemblyConfiguration Configuration)
Identifies if an assembly configuration is supported for a particular export type.
xboolIsGeometryRepSupported (pfcExportType Type, pfcGeometryFlags_ptr Flags)
Identifies if a combination of geometry flags are supported for export to a certain format.
xstringsequence_ptrListFiles (xrstring Filter, pfcFileListOpt Version, optional xrstring Path)
Returns a list of the files in the designated directory.
pfcModels_ptrListModels ()
Retrieves the list of objects in the Creo Parametric session.
pfcModels_ptrListModelsByType (pfcModelType Type)
Returns all of the models of a particular type in the Creo Parametric session.
optional pfcServers_ptrListServers ()
Sequence of servers , or null if server was not found
xstringsequence_ptrListSubdirectories (optional xrstring Path)
Lists the subdirectories in a given directory location.
pfcWindows_ptrListWindows ()
Lists all the Creo Parametric windows.
voidLoadConfigFile (xrstring ConfigFileName)
Reads a configuration file into Creo Parametric.
pfcDll_ptrLoadProToolkitDll (xrstring ApplicationName, xrstring DllPath, xrstring TextPath, xbool UserDisplay)
Causes Creo Parametric to load a Creo Parametric TOOLKIT DLL application.
pfcDll_ptrLoadProToolkitLegacyDll (xrstring ApplicationName, xrstring DllPath, xrstring TextPath, xbool UserDisplay)
Causes Creo Parametric to load a Creo Parametric TOOLKIT DLL non-Unicode application.
pfcWindow_ptrOpenFile (pfcModelDescriptor_ptr MdlDescr)
Retrieves the specified model and displays it in a window.
xstringPLMSInitialize (xrstring request)
 
optional pfcSelections_ptrQueryFeatureEdit ()
Find the list of features being displayed for modification, as is done in 'Edit' on a feature.
voidRegisterCustomModelCheck (pfcCustomCheckInstructions_ptr Instructions)
Registers an custom check that can be included in any ModelCheck execution.
voidRegisterRelationFunction (xrstring Name, pfcRelationFunctionListener_ptr Listener, optional pfcRelationFunctionOptions_ptr Options)
Register an external function which can be included in relations.
pfcServer_ptrRegisterServer (xrstring Alias, xrstring Location, xrstring WorkspaceName)
Registers a server in the session given its root location and an alias.
pfcAssembly_ptrRetrieveAssemSimpRep (xrstring AssemName, optional pfcSimpRepInstructions_ptr Instructions)
Retrieves the specified simplified representation.
pfcPart_ptrRetrieveGeometryPartRep (xrstring PartName)
Retrieves the specified part's geometric simplified representation.
pfcAssembly_ptrRetrieveGeomSimpRep (xrstring AssemName)
Retrieves the geometry simplified representation of an assembly.
pfcPart_ptrRetrieveGraphicsPartRep (xrstring PartName)
Retrieves the specified part's graphic simplified representation.
pfcAssembly_ptrRetrieveGraphicsSimpRep (xrstring AssemName)
Retrieves the graphics simplified representation of an assembly.
pfcModel_ptrRetrieveModel (pfcModelDescriptor_ptr MdlDescr)
Retrieves the specified model into the Creo Parametric session from standard directory.
pfcModel_ptrRetrieveModelWithOpts (pfcModelDescriptor_ptr MdlDescr, pfcRetrieveModelOptions_ptr Opts)
Retrieves the specified model into the Creo Parametric session based on the path specified in the model descriptor.
pfcPart_ptrRetrievePartSimpRep (xrstring PartName, xrstring RepName)
Retrieves the specified part's user-defined simplified representation.
pfcPart_ptrRetrieveSymbolicPartRep (xrstring PartName)
Retrieves the specified part's symbolic simplified representation.
pfcAssembly_ptrRetrieveSymbolicSimpRep (xrstring AssemName)
Retrieves the symbolic simplified representation of an assembly.
voidRunMacro (xrstring Macro)
Runs the specified macro.
optional pfcSelections_ptrSelect (pfcSelectionOptions_ptr Options, optional pfcSelections_ptr InitialSels)
Allows interactive selection of objects in Creo Parametric.
voidSetConfigOption (xrstring Name, xrstring Value)
Sets the value of the specified configuration file option.
voidSetCurrentWS (xrstring NewWSName)
Registers a Workspace in Creo Parametric. Only one is allowed at a time, so if one is already registered, the new one will substitute the current one, but only if there are no objects in session.
pfcStdLineStyleSetLineStyle (pfcStdLineStyle NewStyle)
Sets the line style.
voidSetStdColorFromRGB (pfcStdColor StdClr, pfcColorRGB_ptr Color)
Enables you to set the values of the three color components for a standard color in Creo Parametric.
pfcStdColorSetTextColor (pfcStdColor NewColor)
Enables you to change the text color so any subsequent graphics window text is drawn in the specified color.
voidSetWSExportOptions (pfcWSExportOptions_ptr Options)
Sets the option controlling whether or not to export secondary contents during a call to pfcBaseSession::ExportFromCurrentWS(xstringsequence_ptr, xrstring, pfcRelCriterion)
pfcJLinkApplication_ptrStartJLinkApplication (xrstring ApplicationName, xrstring ClassName, xrstring StartMethod, xrstring StopMethod, optional xrstring AdditionalClassPath, optional xrstring TextPath, xbool UserDisplay)
Register and start a synchronous J-Link application.
voidUIRegisterFileOpen (pfcFileOpenRegisterOptions_ptr Options, pfcFileOpenRegisterListener_ptr Listener)
Register a file type in File Open Dialog.
voidUIRegisterFileSave (pfcFileSaveRegisterOptions_ptr Options, pfcFileSaveRegisterListener_ptr Listener)
Register a file type in File 'Save a Copy' Dialog.
voidWLBInitialize (xbool val)
 


Methods Inherited from Class pfcActionSource:

AddActionListener, RemoveActionListener, AddActionListenerWithType


Methods Inherited from Class pfcParent:

GetChild


Methods Inherited from Class pfcDisplay:

CreateDisplayList2D, Invalidate, DrawArc2D, DrawPolygon2D, DrawText2D, CreateDisplayList3D, DrawCircle, DrawLine, SetPenPosition, DrawPolyline, GetDefaultFont, GetCurrentFont, SetCurrentFont, GetFontById, GetFontByName, GetTextHeight, SetTextHeight, GetRotationAngle, SetRotationAngle, GetSlantAngle, SetSlantAngle, GetWidthFactor, SetWidthFactor, ResetTextAttributes, GetCurrentGraphicsMode, SetCurrentGraphicsMode, GetCurrentGraphicsColor, SetCurrentGraphicsColor



Method Detail

voidCopyFileFromWS (xrstring SourceFile, xrstring TargetDirectory)

Copies a file from a Windchill workspace to a disk location.

Exceptions thrown (but not limited to):

pfcXToolkitInvalidFile - The input file was not found or improper.

pfcXToolkitInvalidDir - The output location was not found.

pfcXToolkitCantAccess - No permission to read the input file, or to write to the target directory.


Manual References:
Windchill Connectivity APIs: File Copy
Parameters:
SourceFile
The path to the file.This must begin with wtws://.
TargetDirectory
The location on the local disk indicating where to copy the file.
Returns:



voidCopyFileToWS (xrstring SourceFile, xrstring TargetWorkspace, optional xrstring PrimaryContent)

Copies a file from local disk to a Windchill workspace; either as a primary document or as secondary content of an existing document in the workspace.

Exceptions thrown (but not limited to):

pfcXToolkitInvalidFile - An input file was not found or improper.

pfcXToolkitBadContext - There was a problem setting primary_content.

pfcXToolkitCantWrite - The workspace file is not writable.


Manual References:
Windchill Connectivity APIs: File Copy, Windchill Connectivity APIs: File Copy
Parameters:
SourceFile
The path to the file
TargetWorkspace
The destination workspace.
PrimaryContent
The document which the copy will be attached to,"box7.prt" for example.Pass null to simply copy the file to the workspace.
Returns:



optional pfcWindow_ptrGetCurrentWindow ()
voidSetCurrentWindow (optional pfcWindow_ptr value)

The current Creo Parametric window
Manual References:
Solid Bodies: To set the appearance of bodies, Windows and Views: Getting a Window Object, Windows and Views: Getting a Window Object




pfcWindow_ptrCreateModelWindow (pfcModel_ptr Mdl)

Creates or retrieves a window for a specified model.

If the window is already open with the model attached, the function returns the window object. If there is an empty window open, the function attaches the object to it. Otherwise, the function creates a new window and attaches the model to it.

Note that if the function creates a new window for an object, it does not automatically display the object in the window. To display the model, you must explicitly call the function pfcModel::Display().

Exceptions thrown (but not limited to):

pfcXToolkitInvalidType - You specified an invalid object type.

pfcXToolkitDeadLock - The Creo Parametric user interface is not prepared to handle this request (because it is blocked by another process such as an OLE container activation).

pfcXToolkitNotFound - The application is trying to open an embedded model (that is, a model representing a single body of a multi-body foreign object) in a separate window. This operation is not supported.


Manual References:
Windows and Views: Getting a Window Object, Windows and Views: Getting a Window Object
Parameters:
Mdl
The model that will be displayed in (or associated with) the window.
Returns:
The new or retrieved window



optional pfcWindow_ptrGetModelWindow (pfcModel_ptr Mdl)

Returns the window where a Creo Parametric model is displayed.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The function was not able to find the window.


Manual References:
Solid Bodies: To create a multibody part from an assembly, Solid Bodies: To create an assembly from a multibody part, Windows and Views: Getting a Window Object
Parameters:
Mdl
The model.
Returns:
The window, or null, if the model is not displayed.



pfcWindow_ptrOpenFile (pfcModelDescriptor_ptr MdlDescr)

Retrieves the specified model and displays it in a window.

This method is equivalent to calling pfcBaseSession::RetrieveModel(pfcModelDescriptor_ptr) , pfcBaseSession::CreateModelWindow(pfcModel_ptr) , and pfcModel::Display() .

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - This means either:

  • The model was not found in the current directory, OR
  • The function was not able to find the window, OR
  • The application is trying to open an embedded model (that is, a model representing a single body of a multi-body foreign object) in a separate window. This operation is not supported.

pfcXToolkitNoPermission - The function does not have permission to operate on this model.

pfcXToolkitInvalidType - You specified an invalid object type.

pfcXToolkitDeadLock - The Creo Parametric user interface is not prepared to handle this request (because it is blocked by another process such as an OLE container activation).


Manual References:
Models: Retrieving Models, Models: Retrieving Models, Windows and Views: Getting a Window Object, Windows and Views: Getting a Window Object, Windchill Connectivity APIs: Retrieval
Parameters:
MdlDescr
The model to retrieve
Returns:
The new window



pfcWindows_ptrListWindows ()

Lists all the Creo Parametric windows.
Manual References:
Windows and Views: Getting a Window Object, Windows and Views: Getting a Window Object
Returns:
The list of windows



optional pfcWindow_ptrGetWindow (xint Id)

Retrieves the window object by its identifier.
Manual References:
Windows and Views: Getting a Window Object, Windows and Views: Getting a Window Object
Parameters:
Id
The identifier of the window
Returns:
The window that corresponds to the given identifier



voidFlushCurrentWindow ()

Forces the flush of pending display commands on the current window.

IMPORTANT: Excessive use of this method will cause major slow down on systems running Vista or Windows 7. It is recommended to call this method only after completing all display operations.
Manual References:
Windows and Views: Window Operations
Returns:



pfcModels_ptrListModels ()

Retrieves the list of objects in the Creo Parametric session.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - No objects were found in the workspace.


Manual References:
Models: Getting a Model Object, Models: Getting a Model Object, Drawings: Obtaining Drawing Models, Drawings: Obtaining Drawing Models
Returns:
The list of models



pfcModels_ptrListModelsByType (pfcModelType Type)

Returns all of the models of a particular type in the Creo Parametric session.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - No objects were found in the workspace.


Manual References:
Drawings: Obtaining Drawing Models
Parameters:
Type
The type of model to locate.
Returns:
Sequence of model objects.



optional pfcModel_ptrGetCurrentModel ()

The current Creo Parametric object, or null, if there is no current object

Exceptions thrown (but not limited to):

pfcXToolkitBadContext - The current Creo Parametric object is not set.


Manual References:
Models: Getting a Model Object, Models: Getting a Model Object




optional pfcModel_ptrGetActiveModel ()

Retrieves the handle to the active model.

Exceptions thrown (but not limited to):

pfcXToolkitBadContext - The active Creo Parametric object is not set.


Manual References:
Models: Getting a Model Object, Models: Getting a Model Object
Returns:
The active model



pfcPart_ptrCreatePart (xrstring Name)

Creates a new empty part.

Exceptions thrown (but not limited to):

pfcXToolkitFound - An object of the specified name and type already exists.

pfcXToolkitLineTooLong - Name length of the new object is more than 31 chars.


Manual References:
Solid Bodies: To create a multibody part from an assembly, Solid: Getting a Solid Object, Solid: Getting a Solid Object
Parameters:
Name
The name of the part
Returns:
The new part



pfcAssembly_ptrCreateAssembly (xrstring Name)

Creates an empty assembly.

Exceptions thrown (but not limited to):

pfcXToolkitFound - An object of the specified name and type already exists.

pfcXToolkitLineTooLong - Name length of the new object is more than 31 chars.


Manual References:
Solid: Getting a Solid Object, Solid: Getting a Solid Object
Parameters:
Name
The name of the assembly to create
Returns:
The new assembly



pfcDrawing_ptrCreateDrawingFromTemplate (xrstring Name, xrstring Template, pfcModelDescriptor_ptr DrawingModel, pfcDrawingCreateOptions_ptr Options)

Creates a drawing from a template.
See Also:
pfcXToolkitDrawingCreateErrors, pfcDrawingCreateOption
Manual References:
Drawings: Creating Drawings from Templates
Parameters:
Name
The new drawing name.
Template
The template drawing name. This should be located in the search path or the system template directory.
DrawingModel
The name and type of the solid model to use while populating template views.
Options
Sequence of options to use while creating the drawing.
Returns:
The created drawing.



pfcModel_ptrImport2DModel (xrstring NewModelName, pfcModelType Type, xrstring FilePath, pfcImport2DInstructions_ptr Instructions)

Creates a two-dimensional model from a geometry file.

Exceptions thrown (but not limited to):

pfcXToolkitInvalidFile - The input file could not be found, or contained unrecoverable errors.

pfcXToolkitNoLicense - There is no license for this import option.

pfcXToolkitCantOpen - Failed to create drawing.

pfcXToolkitObsoleteFunc - The file format selected is no longer supported on this platform.


See Also:
pfcSTEPImport2DInstructions, pfcIGESImport2DInstructions, pfcDXFImport2DInstructions, pfcDWGImport2DInstructions
Manual References:
Interface: Importing 2D Models
Parameters:
NewModelName
The new model name.
Type
The new model type.
FilePath
The full path to the file to import.
Instructions
Instructions for importing the file.
Returns:
The newly created two dimensional model.



optional pfcModel_ptrGetByRelationId (xint Id)

Returns the model, given its relation identifier.
Manual References:
Models: Getting a Model Object, Models: Getting a Model Object
Parameters:
Id
The identifier
Returns:
The model



pfcModel_ptrRetrieveModel (pfcModelDescriptor_ptr MdlDescr)

Retrieves the specified model into the Creo Parametric session from standard directory.

The method does not create a window for the model or display it anywhere. The model can be retrieved only from standard directory. Path argument in model descriptor is ignored by this api.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The model was not found in the current directory.

pfcXToolkitNoPermission - The function does not have permission to operate on this model.


See Also:
pfcBaseSession::GetModel(xrstring, pfcModelType), pfcBaseSession::GetModelFromDescr(pfcModelDescriptor_ptr)
Manual References:
Models: Retrieving Models, Models: Retrieving Models, Drawings: Obtaining Drawing Models, Windchill Connectivity APIs: Retrieval, Windchill Connectivity APIs: Retrieval
Parameters:
MdlDescr
The information about the model to retrieve
Returns:
The retrieved model



pfcModel_ptrRetrieveModelWithOpts (pfcModelDescriptor_ptr MdlDescr, pfcRetrieveModelOptions_ptr Opts)

Retrieves the specified model into the Creo Parametric session based on the path specified in the model descriptor.

The method does not create a window for the model or display it anywhere.

Exceptions thrown (but not limited to):

pfcXToolkitCantOpen - The model exists but is not readable.

pfcXToolkitNotFound - The model does not exist, or was not found

pfcXToolkitInvalidFile - The model is not a Creo Parametric model.

pfcXToolkitInvalidName - The model name is too long.

pfcXToolkitNoPermission - The function does not have permission to operate on this model.


Manual References:
Models: Retrieving Models, Models: Retrieving Models, Windchill Connectivity APIs: Retrieval, Windchill Connectivity APIs: Retrieval
Parameters:
MdlDescr
The information about the model to retrieve
Opts
Options for retrieval
Returns:
The retrieved model



optional pfcModel_ptrGetModel (xrstring Name, pfcModelType Type)

Finds a model in the Creo Parametric session, given the model name and type.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - Unable to find the required model.


See Also:
pfcBaseSession::RetrieveModel(pfcModelDescriptor_ptr), pfcBaseSession::GetModelFromDescr(pfcModelDescriptor_ptr)
Manual References:
Models: Getting a Model Object, Models: Getting a Model Object, Drawings: Obtaining Drawing Models, Drawings: Obtaining Drawing Models
Parameters:
Name
The name of the model
Type
The model type
Returns:
The requested model or null, if no model with the specified parameters has been found in session



optional pfcModel_ptrGetModelFromDescr (pfcModelDescriptor_ptr MdlDescr)

Finds a model in the Creo Parametric session, given the model descriptor.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - Unable to find the required model.


See Also:
pfcBaseSession::RetrieveModel(pfcModelDescriptor_ptr), pfcBaseSession::GetModel(xrstring, pfcModelType)
Manual References:
Drawings: Obtaining Drawing Models, Drawings: Obtaining Drawing Models
Parameters:
MdlDescr
The model descriptor
Returns:
The requested model or null, if no model with the specified parameters has been found in session



optional pfcModel_ptrGetModelFromFileName (xrstring FileName)

Locates and returns a model handle given its file name.

File name format should be of the form <model name>.<extension>, without a path.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - Unable to find the required model.

pfcXInvalidFileName - Invalid file name.


Parameters:
FileName
The Creo Parametric model file name.
Returns:
The model handle, or null, if the model was not found.



voidEraseUndisplayedModels ()

Erases models which are not used in any Creo Parametric windows.

Exceptions thrown (but not limited to):

pfcXToolkitBusy - Creo Parametric is in a state where erase isn't allowed.


See Also:
pfcModel::Erase(), pfcModel::EraseWithDependencies()
Returns:



optional pfcSelections_ptrSelect (pfcSelectionOptions_ptr Options, optional pfcSelections_ptr InitialSels)

Allows interactive selection of objects in Creo Parametric.

Exceptions thrown (but not limited to):

pfcXToolkitUserAbort - The user chose Quit.

pfcXToolkitPickAbove - Selection was interrupted by a user's pick on any button from above menus.

pfcXToolkitDeadLock - The Creo Parametric user interface is not prepared to handle this request (because it is blocked by another process such as an OLE container activation).


Manual References:
The Creo Object TOOLKIT C++ Online Browser: APIWizard Overview, External Data: Selecting the Node from the External Application Tree, Solid Bodies: To create a multibody part from an assembly, Selection: Interactive Selection, Selection: Interactive Selection, About This Guide, Assembly: Kinematic Dragging and Creating Snapshots: Connecting to a Kinematic Drag Session, Drawings: Selecting Drawing Tables and Cells, Drawings: Selecting Drawing Tables and Cells, Ribbon Tabs, Groups, and Menu Items: Loading Multiple Applications Using the Ribbon Definition File
Parameters:
Options
The selection options, including the option keywords and maximum number ofselections allowed
InitialSels
A list of initial selections, which will be included in the return.
Returns:
A list of selected objects



optional pfcSelections_ptrQueryFeatureEdit ()

Find the list of features being displayed for modification, as is done in 'Edit' on a feature.
Manual References:
Features: Access to Features
Returns:
A list of features being displayed for modification.



voidSetConfigOption (xrstring Name, xrstring Value)

Sets the value of the specified configuration file option.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The specified option was not found.


See Also:
pfcBaseSession::GetConfigOptionValues(xrstring), pfcBaseSession::GetConfigOption(xrstring)
Manual References:
Session Objects: Configuration Options, Session Objects: Configuration Options
Parameters:
Name
The name of the configuration file option. This string can include uppercase and lowercase letters.
Value
The value of the option, as it must appear in the configuration file. If the option is a multivalued option,such as a path, this will add a new value to the array of values that already exist.
Returns:



optional xstringGetConfigOption (xrstring Name)

Retrieves the current value for the specified configuration file option.

The maximum length of a configuration option value returned by this function is 80 characters. For access to larger values, use pfcBaseSession::GetConfigOptionValues(xrstring).

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The specified option was not found.

pfcXToolkitLineTooLong - The function returned the option value, but the option is longer than the maximum string length 81.


See Also:
pfcBaseSession::GetConfigOptionValues(xrstring), pfcBaseSession::SetConfigOption(xrstring, xrstring)
Parameters:
Name
The name of the configuration file option whose value you want. Thisstring can contain uppercase and lowercase letters.
Returns:
The value



optional xstringsequence_ptrGetConfigOptionValues (xrstring Name)

Retrieves the current value(s) for the specified configuration file option.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The specified option was not found.

pfcXToolkitLineTooLong - The function returned the option value, but the option is longer than the maximum string length 260.


See Also:
pfcBaseSession::GetConfigOption(xrstring), pfcBaseSession::SetConfigOption(xrstring, xrstring)
Manual References:
Session Objects: Configuration Options, Session Objects: Configuration Options
Parameters:
Name
The name of the configuration file option whose value you want. Thisstring can contain uppercase and lowercase letters.
Returns:
The sequence of values. This may contain one value, if the option is not a multi-valued option.



voidRunMacro (xrstring Macro)

Runs the specified macro.

Macros may only run when control is returned to Creo Parametric. If control is maintained by a J-Link program, the macro will be stored for later running.
Manual References:
Session Objects: Macros, Session Objects: Macros, Session Objects: Macros
Parameters:
Macro
The macro to run
Returns:



pfcStdColorSetTextColor (pfcStdColor NewColor)

Enables you to change the text color so any subsequent graphics window text is drawn in the specified color.

Exceptions thrown (but not limited to):

pfcXToolkitNoChange - The current color is the same as the new color.


Manual References:
Session Objects: Colors and Line Styles, Session Objects: Colors and Line Styles
Parameters:
NewColor
The new color to be used for text
Returns:
The previous text color



pfcColorRGB_ptrGetRGBFromStdColor (pfcStdColor StdClr)

Retrieves the RGB values for the specified color.
Manual References:
Session Objects: Colors and Line Styles
Parameters:
StdClr
The color type
Returns:
The RGB values



voidSetStdColorFromRGB (pfcStdColor StdClr, pfcColorRGB_ptr Color)

Enables you to set the values of the three color components for a standard color in Creo Parametric.
Manual References:
Graphics: Displaying Graphics, Session Objects: Colors and Line Styles, Session Objects: Colors and Line Styles
Parameters:
StdClr
The RGB values
Color
The color type
Returns:



pfcStdLineStyleSetLineStyle (pfcStdLineStyle NewStyle)

Sets the line style.

Exceptions thrown (but not limited to):

pfcXToolkitNoChange - The new line style is the same as the old line style.


Manual References:
Graphics: Displaying Graphics, Session Objects: Colors and Line Styles
Parameters:
NewStyle
The new line style
Returns:
The previous line style



voidExportDirectVRML (pfcVRMLDirectExportInstructions_ptr ExportData)

Exports a Creo Parametric object from disk into VRML format.

This function does not retrieve the model. See pfcVRMLExportInstructions for a description of the files produced by the export.

Exceptions thrown (but not limited to):

pfcXToolkitBadContext - The function is not available in Design Test Mode.


Manual References:
Interface: Export Instructions
Parameters:
ExportData
pfcVRMLDirectExportInstructions
Returns:



voidLoadConfigFile (xrstring ConfigFileName)

Reads a configuration file into Creo Parametric.

Exceptions thrown (but not limited to):

pfcXToolkitLineTooLong - The input filename length is too long for this import file type.

pfcXToolkitObsoleteFunc - The file format selected is no longer supported on this platform.


Manual References:
Session Objects: Configuration Options
Parameters:
ConfigFileName
The output file name, including the extension.
Returns:



xstringGetCurrentDirectory ()

Gets the absolute path name of the current working directory for Creo Parametric.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The function was unable to find current working directory.


Manual References:
Session Objects: Directories, Session Objects: Directories
Returns:
The absolute path



voidChangeDirectory (xrstring Path)

Changes Creo Parametric to another working directory.

Exceptions thrown (but not limited to):

pfcXToolkitCantAccess - You are unable to access the specified directory.

pfcXToolkitInvalidName - You specified an invalid name.


Manual References:
Session Objects: Directories
Parameters:
Path
The path to the new directory (relative or absolute).
Returns:



xstringsequence_ptrListFiles (xrstring Filter, pfcFileListOpt Version, optional xrstring Path)

Returns a list of the files in the designated directory.

Exceptions thrown (but not limited to):

pfcXToolkitInvalidDir - Invalid directory.


See Also:
pfcBaseSession::ListSubdirectories(optional xrstring)
Manual References:
Session Objects: File Handling, Session Objects: File Handling
Parameters:
Filter
A filename filter, such as "*.prt"
Version
Flag indicating if all versions, or the latest versions should be found. Also allows alphatical sorting of the returned list.
Path
The directory
Returns:
Sequence of files found, including the full path name.



xstringsequence_ptrListSubdirectories (optional xrstring Path)

Lists the subdirectories in a given directory location.

Exceptions thrown (but not limited to):

pfcXToolkitInvalidDir - Invalid directory.


Manual References:
Session Objects: File Handling, Session Objects: File Handling
Parameters:
Path
The directory.
Returns:
Sequence of subdirectories.



optional xstringGetEnvironmentVariable (xrstring Name)

Returns the value a system environment variable.
Parameters:
Name
The name of the variable.
Returns:
The value, or null if the variable is not set.



voidCheckoutToWS (pfcModelDescriptors_ptr Objects, xrstring WSName, xbool AsLink, pfcRelCriterion RelCriterion)

Checks out a model from Pro/INTRALINK into the workspace.

NOTE: This method is deprecated. Pro/INTRALINK 3.4 is not supported. Please use Pro/INTRALINK 10.0 method pfcServer::CheckoutObjects(optional pfcModel_ptr, optional xrstring, xbool, optional pfcCheckoutOptions_ptr) or pfcServer::CheckoutMultipleObjects(xstringsequence_ptr, xbool, optional pfcCheckoutOptions_ptr) instead.

This method has limited options; PTC recommends using Pro/INTRALINK Toolkit for more complex checkout operartions.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The specified objects were not found in the Commonspace; or the Pro/INTRALINK Client is not in the latest frame when attempting the checkout.

pfcXToolkitCommError - A Pro/INTRALINK Client is not available, and the Creo Parametric user has not registered Pro/INTRALINK as a server. (This function will work if the Pro/INTRALINK client has been authenticated previously through the Creo Parametric dialog.)

pfcXToolkitNotImplemented - Initially, some of the options above might not be implemented.


Parameters:
Objects
Files to check out (name and type are required fields).
WSName
The workspace name.
AsLink
true to check out as a link, false to check out as a copy.
RelCriterion
Instructions about how to checkout dependencies.
Returns:



pfcWSImportExportMessages_ptrExportFromCurrentWS (xstringsequence_ptr FileNames, xrstring TargetLocation, pfcRelCriterion Dependency)

Export specified objects from the current workspace to a disk in a linked session of Creo Parametric. Can be called only when there are no objects in session . The specified objects may be exported along with all or required by Creo Parametric dependents (recursively), according to a specified dependency criterion. All problems (warnings, conflicts or errors) of processing individual objects are logged in proimpex.errors file created in the Creo Parametric run directory.

Exceptions thrown (but not limited to):

pfcXToolkitBusy - cannot export because there are objects in Creo Parametric session

pfcXToolkitNotFound - no workspace registered as current (or non linked session)

pfcXToolkitInvalidDir - bad or inaccessible target_path


Manual References:
Windchill Connectivity APIs: Import and Export, Windchill Connectivity APIs: Import and Export, Windchill Connectivity APIs: File Copy
Parameters:
FileNames
A sequence of strings (file names ) to export.
TargetLocation
The export target directory.
Dependency
Instructions about how to export dependencies
Returns:
Import/export messages.



pfcWSImportExportMessages_ptrImportToCurrentWS (xstringsequence_ptr Filepaths, pfcRelCriterion Dependency)

Import specified objects from a disk to the current workspace in a linked session of Creo Parametric. Can be called only when there are no objects in session . The specified objects may be imported along with all or required by Creo Parametric dependents (recursively), according to a specified dependency criterion. All problems (warnings, conflicts or errors) of processing individual objects are logged in proimpex.errors file created in the Creo Parametric run directory.

Exceptions thrown (but not limited to):

pfcXToolkitBusy - cannot import because there are objects in Creo Parametric session

pfcXToolkitNotFound - no workspace registered as current (or non linked session)


Manual References:
Windchill Connectivity APIs: Upload, Windchill Connectivity APIs: Import and Export, Windchill Connectivity APIs: Import and Export, Windchill Connectivity APIs: File Copy
Parameters:
Filepaths
A sequence of strings - file paths (absolute or relative to current working directory) to objects to import.
Dependency
Instructions about how to import dependencies
Returns:
Import/export messages.



voidSetWSExportOptions (pfcWSExportOptions_ptr Options)

Sets the option controlling whether or not to export secondary contents during a call to pfcBaseSession::ExportFromCurrentWS(xstringsequence_ptr, xrstring, pfcRelCriterion)
Manual References:
Windchill Connectivity APIs: Import and Export, Windchill Connectivity APIs: Import and Export
Parameters:
Options
Export options object of type pfcWSExportOptions.
Returns:



voidExportCurrentRasterImage (xrstring ImageFileName, pfcRasterImageExportInstructions_ptr Instructions)

Outputs a standard Creo Parametric raster output file (for current Window).

Exceptions thrown (but not limited to):

pfcXToolkitNoPermission - The function does not have permission to operate on this model.

pfcXToolkitBadContext - The function is not available in Design Test Mode.


Parameters:
ImageFileName
An output filename, including the extension
Instructions
An Raster-Export-Instructions object that controls the Raster-Image export operation. All of these objects inherit from pfcRasterImageExportInstructions .
Returns:



pfcAssembly_ptrRetrieveAssemSimpRep (xrstring AssemName, optional pfcSimpRepInstructions_ptr Instructions)

Retrieves the specified simplified representation.

This method does not support Multi-CAD models. Object Toolkit users can use RetrieveAssemblySimpRep under wfcSession module as a superseding method.

Exceptions thrown (but not limited to):

pfcXToolkitNoPermission - The function does not have permission to operate on this assembly.

pfcXToolkitNotFound - The function did not find the simplified representation in the solid.


Manual References:
Simplified Representations: Retrieving Simplified Representations, Simplified Representations: Retrieving Simplified Representations
Parameters:
AssemName
The name of the assembly to retrieve.
Instructions
The simplified representation Instructions - the internal data required to define a simplified representation.
Returns:
The handle to the assembly.



pfcAssembly_ptrRetrieveGraphicsSimpRep (xrstring AssemName)

Retrieves the graphics simplified representation of an assembly.

This method supports Multi-CAD approach only for Object Toolkit (OTK) users. Outside of OTK (for instance in J-Link), this method will throw the XToolkitUnsupported exception if called on models originated through Multi-CAD.

For OTK users this method is a shortcut for wfcSession::WSession::RetrieveSimpRep.

Exceptions thrown (but not limited to):

pfcXToolkitNoPermission - The function does not have permission to operate on this assembly.


Manual References:
Simplified Representations: Retrieving Simplified Representations, Simplified Representations: Retrieving Simplified Representations
Parameters:
AssemName
The name of the assembly to retrieve.
Returns:
The handle to the assembly.



pfcAssembly_ptrRetrieveSymbolicSimpRep (xrstring AssemName)

Retrieves the symbolic simplified representation of an assembly.

This method supports Multi-CAD approach only for Object Toolkit (OTK) users. Outside of OTK (for instance in J-Link), this method will throw the XToolkitUnsupported exception if called on models originated through Multi-CAD.

For OTK users this method is a shortcut for wfcSession::WSession::RetrieveSimpRep.

Exceptions thrown (but not limited to):

pfcXToolkitNoPermission - The function does not have permission to operate on this assembly.


Manual References:
Simplified Representations: Retrieving Simplified Representations, Simplified Representations: Retrieving Simplified Representations
Parameters:
AssemName
The name of the assembly to retrieve.
Returns:
The handle to the assembly.



pfcAssembly_ptrRetrieveGeomSimpRep (xrstring AssemName)

Retrieves the geometry simplified representation of an assembly.

This method supports Multi-CAD approach only for Object Toolkit (OTK) users. Outside of OTK (for instance in J-Link), this method will throw the XToolkitUnsupported exception if called on models originated through Multi-CAD.

For OTK users this method is a shortcut for wfcSession::WSession::RetrieveSimpRep.

Exceptions thrown (but not limited to):

pfcXToolkitNoPermission - The function does not have permission to operate on this assembly.


Manual References:
Simplified Representations: Retrieving Simplified Representations, Simplified Representations: Retrieving Simplified Representations
Parameters:
AssemName
The name of the assembly to retrieve.
Returns:
The handle to the assembly.



pfcPart_ptrRetrievePartSimpRep (xrstring PartName, xrstring RepName)

Retrieves the specified part's user-defined simplified representation.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The Part was not found.

pfcXToolkitInvalidName - The specified user defined rep was not found.

pfcXToolkitNoPermission - The function does not have permission to operate on this assembly.


Parameters:
PartName
The name of the part to retrieve.
RepName
The name of the user-defined simplified representation.
Returns:
The handle to the part.



pfcPart_ptrRetrieveGraphicsPartRep (xrstring PartName)

Retrieves the specified part's graphic simplified representation.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The Part was not found.

pfcXToolkitInvalidName - The specified user defined rep was not found.

pfcXToolkitNoPermission - The function does not have permission to operate on this assembly.


Parameters:
PartName
The name of the part to retrieve.
Returns:
The handle to the part.



pfcPart_ptrRetrieveGeometryPartRep (xrstring PartName)

Retrieves the specified part's geometric simplified representation.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The Part was not found.

pfcXToolkitInvalidName - The specified user defined rep was not found.

pfcXToolkitNoPermission - The function does not have permission to operate on this assembly.


Parameters:
PartName
The name of the part to retrieve.
Returns:
The handle to the part.



pfcPart_ptrRetrieveSymbolicPartRep (xrstring PartName)

Retrieves the specified part's symbolic simplified representation.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The Part was not found.

pfcXToolkitInvalidName - The specified user defined rep was not found.

pfcXToolkitNoPermission - The function does not have permission to operate on this assembly.


Parameters:
PartName
The name of the part to retrieve.
Returns:
The handle to the part.



optional xstringGetCurrentWS ()

Returns the name of the Workspace currently registered in Creo Parametric.

NOTE: This method is deprecated. Pro/INTRALINK 3.4 is not supported. Please use Pro/INTRALINK 10.0 method pfcServer::GetActiveWorkspace() instead.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - There was no Workspace registered.


Returns:
 



voidSetCurrentWS (xrstring NewWSName)

Registers a Workspace in Creo Parametric. Only one is allowed at a time, so if one is already registered, the new one will substitute the current one, but only if there are no objects in session.

NOTE: This method is deprecated. Pro/INTRALINK 3.4 is not supported. Use Pro/INTRALINK 10.0 method pfcServer::SetActiveWorkspace(xrstring) instead.

Exceptions thrown (but not limited to):

pfcXToolkitBusy - When another workspace is already registered, cannot de-register because there are objects in Creo Parametric session.


Parameters:
NewWSName
The name of the Workspace.
Returns:



pfcModelTypeGetImportSourceType (xrstring FileToImport, pfcNewModelImportType NewModelType)

Returns the type of model that can be created from a 3D format file. Note: does not support all types of 3D formats.

Exceptions thrown (but not limited to):

pfcXToolkitInvalidType - This function is not supported for this import type.


Manual References:
Interface: Importing 3D Geometry, Interface: Importing 3D Geometry
Parameters:
FileToImport
The name of the file.
NewModelType
The type of information contained in the file.
Returns:
The type of file that can be created from the geometry file.



pfcModel_ptrImportNewModel (xrstring FileToImport, pfcNewModelImportType NewModelType, pfcModelType Type, xrstring NewModelName, optional pfcLayerImportFilter_ptr Filter)

Imports a 3D format file as a new model.

Exceptions thrown (but not limited to):

pfcXToolkitCantOpen - import_file can't be opened.

pfcXToolkitUnsupported - Creo Parametric does not support import of the indicated file.

pfcXToolkitNotExist - No profile found.

pfcXToolkitInvalidFile - profile is not readable.

pfcXToolkitInvalidType - This combination of arguments is invalid.

pfcXToolkitLineTooLong - Name length of new model is more than 31 chars.

pfcXToolkitFound - Already a model with same name exists in the Creo session.


Manual References:
Interface: Importing 3D Geometry, Interface: Importing 3D Geometry
Parameters:
FileToImport
Full path to the file to be imported.
NewModelType
The type of model to be imported. Use the method pfcBaseSession::GetImportSourceType(xrstring, pfcNewModelImportType) to automatically determine the model type for some format types.
Type
The type of file being imported.
NewModelName
New name for the created model.
Filter
Returns:
The newly imported part or assembly, drawing.



pfcDll_ptrLoadProToolkitDll (xrstring ApplicationName, xrstring DllPath, xrstring TextPath, xbool UserDisplay)

Causes Creo Parametric to load a Creo Parametric TOOLKIT DLL application.

The application's user_initialize() function will be called as the application starts.

Exceptions thrown (but not limited to):

pfcXToolkitUserAbort - The DLL's user_initialize function returned an error and the DLL was not initialized. Check the values of GetUserInitializeReturn and GetUserInitializeMessage for more details.

pfcXToolkitCantAccess - The file specified could not be read.

pfcXToolkitInvalidFile - The file specified is not a proper DLL.

pfcXToolkitInUse - The specified DLL is already loaded and may not be loaded again.

pfcXToolkitNotFound - exec_file did not exist or was not readable

pfcXToolkitCantWrite - Creo Parametric will not accept any more external applications registered at this time.

pfcXToolkitBadContext - The DLL was already registered and failed to start or stop cleanly the last time it was loaded/unloaded.

pfcXToolkitNeedsUnlock - The DLL requires the Creo Parametric TOOLKIT Development License, but it is not available in the Creo Parametric session.

pfcXToolkitDllInitializeFailed - The DLL was not initialized


Manual References:
Task Based Application Libraries: Launching a Creo TOOLKIT DLL, Task Based Application Libraries: Launching a Creo TOOLKIT DLL
Parameters:
ApplicationName
The name of the application. Application names must be unique within the Creo Parametric session.
DllPath
The full path to the DLL binary file.
TextPath
The full path to the directory containing the DLL text, menu and resource files.
UserDisplay
If true, the application will be visible from the Auxiliary Applications dialog box, and the user will be allowed to stop it. If errors occur on startup, those errors will be presented to the user. If false, the application will be invisible to the user.
Returns:
The Creo Parametric TOOLKIT DLL handle.



pfcDll_ptrLoadProToolkitLegacyDll (xrstring ApplicationName, xrstring DllPath, xrstring TextPath, xbool UserDisplay)

Causes Creo Parametric to load a Creo Parametric TOOLKIT DLL non-Unicode application.

This API is similar to pfcBaseSession::LoadProToolkitDll(xrstring, xrstring, xrstring, xbool). Its purpose is to communicate to Creo Parametric that the loaded dll should be treated as a non-Unicode (pre-Wildfire 4.0) application. WARNING: this API should be used only by a pre-Wildfire 4.0 application to load a pre-Wildfire 4.0 dll.

Exceptions thrown (but not limited to):

pfcXToolkitUserAbort - The DLL's user_initialize function returned an error and the DLL was not initialized. Check the values of user_error_ret and user_string_ret for more details.

pfcXToolkitCantAccess - The file specified could not be read.

pfcXToolkitInvalidFile - The file specified is not a proper DLL.

pfcXToolkitInUse - The specified DLL is already loaded and may not be loaded again.

pfcXToolkitNotFound - exec_file did not exist or was not readable

pfcXToolkitCantWrite - Creo Parametric will not accept any more external applications registered at this time.

pfcXToolkitBadContext - The DLL was already registered and failed to start or stop cleanly the last time it was loaded/unloaded.

pfcXToolkitNeedsUnlock - The DLL requires the Creo Parametric TOOLKIT Development License, but it is not available in the Creo Parametric session.


Manual References:
Task Based Application Libraries: Launching a Creo TOOLKIT DLL, Task Based Application Libraries: Launching a Creo TOOLKIT DLL
Parameters:
ApplicationName
The name of the application. Application names must be unique within the Creo Parametric session.
DllPath
The full path to the DLL binary file.
TextPath
The full path to the directory containing the DLL text, menu and resource files.
UserDisplay
If true, the application will be visible from the Auxiliary Applications dialog box, and the user will be allowed to stop it. If errors occur on startup, those errors will be presented to the user. If false, the application will be invisible to the user.
Returns:
The Creo Parametric TOOLKIT DLL handle.



optional pfcDll_ptrGetProToolkitDll (xrstring ApplicationId)

Finds a Creo Parametric TOOLKIT DLL, given its identifer string.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - Application could not be found.

pfcXToolkitBadContext - Application was not active


Manual References:
Task Based Application Libraries: Launching a Creo TOOLKIT DLL, Task Based Application Libraries: Launching a Creo TOOLKIT DLL
Parameters:
ApplicationId
The DLL's identifier string, acquired from either:
  • A call to ProToolkitDllIdGet within the DLL application
  • The Id attribute in the pfcDll interface.
Returns:
The DLL object, or null if the DLL was not found in session.



pfcJLinkApplication_ptrStartJLinkApplication (xrstring ApplicationName, xrstring ClassName, xrstring StartMethod, xrstring StopMethod, optional xrstring AdditionalClassPath, optional xrstring TextPath, xbool UserDisplay)

Register and start a synchronous J-Link application.

Exceptions thrown (but not limited to):

pfcXToolkitUserAbort - The application failed to start properly. See the startup exception for more details.

pfcXToolkitAmbiguous - The application class is already registered as another application, with different start and/or stop methods.

pfcXToolkitInUse - The application with this configuration is already loaded, and may not be loaded again.

pfcXToolkitCantWrite - Creo Parametric will not accept any more auxiliary applications at this time.


See Also:
pfcJLinkApplication::ExecuteTask(xrstring, pfcArguments_ptr), pfcJLinkApplication::Stop()
Manual References:
Task Based Application Libraries: Launching Tasks from Creo Object TOOLKIT C++ Task Libraries, Task Based Application Libraries: Launching Tasks from Creo Object TOOLKIT C++ Task Libraries
Parameters:
ApplicationName
The application name.
ClassName
The application Java class.
StartMethod
Static method used to intialize the application.
StopMethod
Static method used to terminate the application.
AdditionalClassPath
Additional elements to be added to the front of the system CLASSPATH. Can be null. If more than one path is being added, they must be separated using the appropriate path separator (';' on Windows and ':' on UNIX).
TextPath
The application text path for menus and messaging. If null, the function uses the current directory.
UserDisplay
true to show application startup failure messages to the user, and to show the application in the Auxiliary Applications dialog.
Returns:
The J-Link application handle.



xboolIsConfigurationSupported (pfcExportType Type, pfcAssemblyConfiguration Configuration)

Identifies if an assembly configuration is supported for a particular export type.

Exceptions thrown (but not limited to):

pfcXToolkitNotImplemented - file_type interface is currently not supported.

pfcXToolkitInvalidType - invalid file_type.


See Also:
pfcModel::Export(xrstring, pfcExportInstructions_ptr), pfcBaseSession::IsGeometryRepSupported(pfcExportType, pfcGeometryFlags_ptr)
Manual References:
Interface: Export Utilities, Interface: Export Utilities
Parameters:
Type
The format of the export.
Configuration
The configuration type.
Returns:
true if this type is supported, false if not.



xboolIsGeometryRepSupported (pfcExportType Type, pfcGeometryFlags_ptr Flags)

Identifies if a combination of geometry flags are supported for export to a certain format.

Exceptions thrown (but not limited to):

pfcXToolkitNotImplemented - file_type interface is currently not supported.

pfcXToolkitInvalidType - invalid file_type.


See Also:
pfcModel::Export(xrstring, pfcExportInstructions_ptr), pfcBaseSession::IsConfigurationSupported(pfcExportType, pfcAssemblyConfiguration), pfcGeometryFlags::Create()
Manual References:
Interface: Export Utilities
Parameters:
Type
The format of the export.
Flags
The geometry flags.
Returns:
true if the format supports these flags, false if the flags cannot be used with this format.



pfcDimDisplayModeGetDimensionDisplayMode ()
voidSetDimensionDisplayMode (pfcDimDisplayMode value)

The current dimension display setting.




voidAuthenticateBrowser (xrstring Username, xrstring Password)

Preset username and password to allow automatic login into HTTP servers that require authentication.
Manual References:
Windchill Connectivity APIs: Accessing Information Before Registering a Server, Windchill Connectivity APIs: Accessing Information Before Registering a Server, Windchill Connectivity APIs: Registering and Activating a Server, Windchill Connectivity APIs: To Register a Server with an Existing Workspace
Parameters:
Username
The name of user to be used.
Password
The password of the user to be used.
Returns:



pfcServer_ptrRegisterServer (xrstring Alias, xrstring Location, xrstring WorkspaceName)

Registers a server in the session given its root location and an alias.

To automate registration of servers in interactive mode, use the standard config.fld setup to preregister the servers. To ensure that the servers are not preregistered when running Creo Parametric in batch non-graphics mode, set the environment variable PTC_WF_ROOT to an empty directory before starting Creo Parametric.

Exceptions thrown (but not limited to):

pfcXToolkitFound - A server with this alias or location/workspace is already registered.

pfcXToolkitNotFound - The server couldn't be found at the given location.

pfcXToolkitInvalidName - Authentication failed.

pfcXToolkitInvalidDir - The workspace couldn't be found or created.

pfcXToolkitNoLicense - There is no license to work with the server.

pfcXToolkitInvalidType - The server version is not supported.


Manual References:
Windchill Connectivity APIs: Registering and Activating a Server, Windchill Connectivity APIs: Registering and Activating a Server, Windchill Connectivity APIs: To Register a Server with an Existing Workspace
Parameters:
Alias
The name used by Creo Parametric to refer to this server.
Location
The root location for the server.
WorkspaceName
The name of the workspace to use.
Returns:
The registered server handle.



optional pfcServers_ptrListServers ()

Sequence of servers , or null if server was not found

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - No servers are currently registered.


Manual References:
Windchill Connectivity APIs: Information on Servers in Session
Returns:



optional pfcServer_ptrGetServerByAlias (xrstring Alias)

Gets the server handle for a given server alias.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The server was not registered.


Manual References:
Windchill Connectivity APIs: Information on Servers in Session, Windchill Connectivity APIs: Information on Servers in Session
Parameters:
Alias
The name used by Creo Parametric to refer to this server.
Returns:
The server handle , or null if server with input alias was not found



optional pfcServer_ptrGetServerByUrl (xrstring Url, optional xrstring WorkspaceName)

Gets the server handle for a given server url and workspace name.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The server was not registered.


Manual References:
Windchill Connectivity APIs: Information on Servers in Session, Windchill Connectivity APIs: Information on Servers in Session
Parameters:
Url
The url of server.
WorkspaceName
The workspace name on the server.Can be null. If null, and more then one server with the url is registered, then function returns one of the registered servers.
Returns:
The server handle , or null if server with input url was not found



pfcServerLocation_ptrGetServerLocation (xrstring Url)

Gets the server location handle for a given server url.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The server was not registered.


Manual References:
Windchill Connectivity APIs: Accessing Information Before Registering a Server
Parameters:
Url
The url of server.
Returns:
The server location handle.



optional pfcServer_ptrGetActiveServer ()

Gets the active server handle .

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - There is no active aliased server (Local Dir is active).


Manual References:
Windchill Connectivity APIs: Information on Servers in Session, Windchill Connectivity APIs: Information on Servers in Session
Returns:
The server handle, or null if active server was not found



xstringGetUrlFromAliasedUrl (xrstring AliasedUrl)

Converts an an aliased url (wtpub://alias/etc/p.prt) suitable for use in functions like ProMdlLoad to an unaliased URL (http://windchillserver.ptc.com/etc).

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The server listed in the given aliased URL is not registered in session.

pfcXToolkitCantAccess - If the server is in offline mode.


Manual References:
Windchill Connectivity APIs: Utility APIs
Parameters:
AliasedUrl
The aliased URL.
Returns:
The unaliased URL.



xstringGetAliasFromAliasedUrl (xrstring AliasedUrl)

Returns server alias from aliased URL.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The object was not found.


Manual References:
Windchill Connectivity APIs: Utility APIs, Windchill Connectivity APIs: Utility APIs
Parameters:
AliasedUrl
The aliased URL.
Returns:
The server alias.



xstringGetModelNameFromAliasedUrl (xrstring AliasedUrl)

Returns model name from aliased URL.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The object was not found.


Manual References:
Windchill Connectivity APIs: Utility APIs, Windchill Connectivity APIs: Utility APIs
Parameters:
AliasedUrl
The aliased URL.
Returns:
The model name.



xstringGetConnectionId ()

Returns the connection id for the Creo Parametric session that this application is connected to. The identification string can be passed to external asynchronous applications to allow them to connect to this Creo Parametric session.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - Communications are not correctly established for this session of Creo Parametric, and asynchronous connection is not possible.


Manual References:
Asynchronous Mode: Connecting Via Connection ID, Asynchronous Mode: Connecting Via Connection ID




pfcModelCheckResults_ptrExecuteModelCheck (pfcModel_ptr Model, optional pfcModelCheckInstructions_ptr Instructions)

Execute ModelCheck from an external application.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The function failed to find config directoy specified.

pfcXToolkitNoLicense - Creo Parametric is missing the license to execute ModelCheck.


Manual References:
Models: Running Creo Modelcheck, Models: Running Creo Modelcheck
Parameters:
Model
The model.
Instructions
The ModelCheck instructions.
Returns:
A summary of the results of the ModelCheck run.



voidRegisterCustomModelCheck (pfcCustomCheckInstructions_ptr Instructions)

Registers an custom check that can be included in any ModelCheck execution.

Exceptions thrown (but not limited to):

pfcXToolkitFound - Check with this name already exists.

pfcXToolkitBadContext - ModelCheck is not enabled in session.


Manual References:
Models: Custom Checks, Models: Custom Checks, Models: Custom Checks
Parameters:
Instructions
The custom check instructions.
Returns:



voidRegisterRelationFunction (xrstring Name, pfcRelationFunctionListener_ptr Listener, optional pfcRelationFunctionOptions_ptr Options)

Register an external function which can be included in relations.

Exceptions thrown (but not limited to):

pfcXToolkitFound - Function with the given name was already found.


Manual References:
Relations: Adding a Customized Function to the Relations Dialog Box
Parameters:
Name
The name of the external function.
Listener
The listener for the external relation function methods.
Options
The relation function options indicating enabled/disabled attributes.
Returns:



xstringGetMessageContents (xrstring MsgFile, xrstring Format, optional xstringsequence_ptr MessageTexts)

Writes a text message to a buffer string.

This method supports only ASCII character strings as texts.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The specified message file was not found.

pfcXToolkitCantOpen - The system could not read the message file.

pfcXToolkitMsgNotFound - The specified message was not found in the message file.

pfcXToolkitMsgNoTrans - The message text (in the current language of the user interface) was not found.

pfcXToolkitMsgFmtError - There was a format error in the message text.

pfcXToolkitMsgTooLong - The message was longer than 80 characters and has been truncated to fit.

pfcXToolkitFound - The specified message was not found in memory and the message file was read previously. This may indicate that there are two different message files with the same name; avoid this problem by including the application name in the file name.


Manual References:
Session Objects: Accessing the Message Window, Session Objects: Accessing the Message Window
Parameters:
MsgFile
The name of the message file containing the format
Format
The format of the message: the first line of the section of the message file that uniquely identifies the message
MessageTexts
A sequence of strings which will replace any occurrences of %#s in the message format, where '#' is the numerical identifier of the replacement. This method does not support formats using %#w.
Returns:
The buffer string.



xstringGetLocalizedMessageContents (xrstring MsgFile, xrstring Format, optional xstringsequence_ptr MessageTexts)

Writes a text message to a buffer string.

This method supports non-ASCII character strings as messages.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The specified message file was not found.

pfcXToolkitCantOpen - The system could not read the message file.

pfcXToolkitMsgNotFound - The specified message was not found in the message file.

pfcXToolkitMsgNoTrans - The message text (in the current language of the user interface) was not found.

pfcXToolkitMsgFmtError - There was a format error in the message text.

pfcXToolkitMsgTooLong - The message was longer than 259 characters and has been truncated to fit.

pfcXToolkitFound - The specified message was not found in memory and the message file was read previously. This may indicate that there are two different message files with the same name; avoid this problem by including the application name in the file name.


Manual References:
Session Objects: Accessing the Message Window
Parameters:
MsgFile
The name of the message file containing the format.
Format
The format of the message: the first line of the section of the message file that uniquely identifies the message.
MessageTexts
A sequence of strings which will replace any occurrences of %#w in the message file, where '#' is the numerical identifier of the replacement. This method does not support formats using %#s.
Returns:
The buffer string.



voidUIRegisterFileSave (pfcFileSaveRegisterOptions_ptr Options, pfcFileSaveRegisterListener_ptr Listener)

Register a file type in File 'Save a Copy' Dialog.

Exceptions thrown (but not limited to):

pfcXToolkitOutOfMemory - Couldn't allocate memory for new type.

pfcXToolkitInUse - Already registered by this app.

pfcXToolkitBadContext - The function is not available in Design Test Mode.


Manual References:
Session Objects: File Dialogs, Session Objects: File Dialogs
Parameters:
Options
The options for file type and description for save operation.
Listener
The listener for the file save operation.
Returns:



voidUIRegisterFileOpen (pfcFileOpenRegisterOptions_ptr Options, pfcFileOpenRegisterListener_ptr Listener)

Register a file type in File Open Dialog.

Exceptions thrown (but not limited to):

pfcXToolkitOutOfMemory - Couldn't allocate memory for new type.

pfcXToolkitInUse - Already registered by this app.


Manual References:
Session Objects: File Dialogs, Session Objects: File Dialogs
Parameters:
Options
The options for file type and description for open operation.
Listener
The listener for the file open operation.
Returns:



pfcPrintPlacementOption_ptrGetPrintPlacementOptions ()

Get the current print placement options.
Manual References:
Interface: Placement Options, Interface: Placement Options
Returns:



pfcPrintPrinterOption_ptrGetPrintPrinterOptions (xrstring printer_type)

Get printer options for a specified printer.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The printer type was not recognized.


Manual References:
Interface: Printer Options, Interface: Printer Options
Parameters:
printer_type
Name of the printer type.
Returns:



pfcPrintMdlOption_ptrGetPrintMdlOptions (pfcModel_ptr model)

Get model options for a specified model.
Manual References:
Interface: Model Options, Interface: Model Options
Parameters:
model
The model.
Returns:



pfcPrinterPCFOptions_ptrGetPrintPCFOptions (xrstring filename, pfcModel_ptr model)

Get the print options from a specified PCF file.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The PCF file does not exist.


Parameters:
filename
The name of the PCF file.
model
Model to be printed.
Returns:



xstringPLMSInitialize (xrstring request)

 
Parameters:
request
 
Returns:
 



voidAllowDuplicateModelItems (xbool val)

Turns on/off the control of creating duplicate model items.

Applications have an option to prevent creating ModelItems more than twice for the same Creo Parametric item. Howerever, this may cause memory corruption if not handled properly on the application side. Therefore, this behavior is turned off by default. Calling pfcBaseSession::AllowDuplicateModelItems(xbool) for Boolean.FALSE turns it on. Although there is no restriction of turning this control off/on at any time and multiple times, it is recommended doing it not more than once and right after the session is obtained.
Manual References:
ModelItem: Duplicating ModelItems
Parameters:
val
Returns:



voidWLBInitialize (xbool val)

 
Parameters:
val
 
Returns:



voidExportProfileLoad (xrstring ProfileFile)

Loads profile for export.

Exceptions thrown (but not limited to):

<reference 4 to unknown entity pfcExceptions::pfcXEmptyString> - This means NULL or empty profile file path.


Manual References:
Interface: Export Instructions, Interface: Export Instructions
Parameters:
ProfileFile
Profile full path along with profile name and extension.
Returns: