3D PLM PPR Hub Open Gateway |
File XPDM (PX1) |
Creating an Interactive Command to Save a Complete SessionHow to use CATxPDMSessionServices |
Use Case |
AbstractThis article shows how to create an interactive command to save a complete session in a given directory. |
In this use case you will mainly earn how to use the SaveSessionToDirectory
method of the CATxPDMSessionServices class.
[Top]
CAAxPDMToolbar is a use case of the CAAxPDMInterfaces.edu framework that illustrates CATxPDMInterfaces framework capabilities. Be careful, such as all use cases illustrating the CATxPDMInterfaces framework, the current one requires a PX1 licence.
[Top]
The PX1 Toolbar containing several command, you have to select the Save one.
![]()
Fig.1 The Save Session To Directory Dialog Box
![]()
All documents in session are displayed in the dialog box.
- To send them to a directory, set a directory name in the Destination Directory editor.
- You can change the name of a document, by editing the New Name field.
- The document will be send to the directory with this name. The document's name in session is changed too.
- The status field can have three values:
- New : it's a created document in the current session
- Modify: the loaded document , not a new one, has been modified in the session after the last save.
- blank: the document has been loaded without modification.
- The access filed can have three values:
- Lock: it's a 'Check In' file
- Forbidden: it's a modified 'Check In' file. It means that save will failed. User has to perform a checkout first.
- blank: it's a 'Check Out' file.
- Preview of selected file is display on right side of panel.
- You can check some design rules before launching Save. Several rules are available:
- Import Resolution, this rule check that all geometrical and parameters imports are resolved. System verify that all pointed documents are available and that pointed object is available (not deleted).
- Import Synchronization, this rule verify that all imports are synchronized.
- Cycle between document, this rule check there is no cycle between CATPart due to imports.
- Publication usage, this rule check that all imports (geometry and parameters) are using publication. One big added value of this rule is ability to check without loading pointed objects.
- Limit number of level of nested import, this rule allow to limit complexity of design by limiting number of level of imports. Number of levels can be customized inside the command.
- Limit number of level of nested level for all documents, this rule allow to limit complexity of design by limiting number of level of links. Number of levels can be customized inside the command.
- Click on the OK button to launch the send operation.
If there is a error during check of Design Rules, a specific panel is displayed with list of errors
Fig.2 The Check Design Rule error Dialog Box
In this panel, for each error, you have access to
- Document with error
- Error type
- Object with error, it could be document itself or an object inside the document
- Complete error message
If you select a line, complete message is displayed on bottom of panel.
If you double-clic on a line, document with error is automatically open in its editor.
[Top]
To launch CAAxPDMToolbar, you will need to set up the build time environment, then compile CAAxPDMToolbar along with its prerequisites, set up the run time environment, and then execute the use case [1]. To launch it, refer to the What Does CAAxPDMToolbar Do section.
[Top]
The CAAxPDMToolbar use case is made of three files,
Windows | InstallRootDirectory\CAAxPDMInterfaces.edu\CAAxPDMToolbar.m\ |
Unix | InstallRootDirectory/CAAxPDMInterfaces.edu/CAAxPDMToolbar.m/ |
this file contains the addin to create the toolbar.
Windows | InstallRootDirectory\CAAxPDMInterfaces.edu\CAAxPDMUICommands.m\ |
Unix | InstallRootDirectory/CAAxPDMInterfaces.edu/CAAxPDMUICommands.m/ |
The first class is the state command launched when the end user push Save Session to Directory command. The second one defines the dialog box [Fig.1] launched by the CAAxPDMPackSessionCmd command.
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
Save of session is performed throught CATxPDMServices::SaveSessionToDirectory
API.
Check of design rules is performed throught CATxPDMServices::CheckDesignRules
API.
Preview is computed through CATIxPDMItem::GeneratePreview
API.
[Top]
This sample show you :
[Top]
[1] | Building and Launching a CAA V5 Use Case |
[Top] |
Version: 1 [Feb 2006] | Document created |
[Top] |
Copyright © 2006, Dassault Systèmes. All rights reserved.