AbstractThis article discusses the CAAMaiCreateToolBarFromCatalog use case and explains how to use the CATIMfgCatalogServices manufacturing interface. It describes a short cut to access to the Machining Process instantiation without using the catalog browser. A prerequisite is to refer to the CATIManufacturingProgramAddin interface for more details about the complete customization of a workbench |
This use case is intended to help you to create your own toolbars and sub-toolbars in the Prismatic Machining workbench with command headers lauching commands from catalog components. These components are Machining Processes referenced in catalogs and when the command is launched, the Machining Process instantiation panel is displayed.
[Top]
CAAMaiCreateToolBarFromCatalog is a use case of the CAAManufacturingItf.edu framework in the CAAMaiCreateToolBarFromCatalog.m module that illustrates ManufacturingInterfaces framework capabilities and specially their customization.
[Top]
The CAAMaiCreateToolBarFromCatalog use case illustrates a use of the CATIMfgCatalogServices through an implementation of CATIManufacturingProgramAddin interface. It enables the customer to
[Top]
To use CAAMaiCreateToolBarFromCatalog, you will need to:
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\CNext\code\dictionary\ |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/CNext/code/dictionary/ |
where InstallRootDirectory
is the directory where the CAA
CD-ROM is installed, and decomment the following line by removing the '#CAA#' character:
CAAMaiAddinCmd CATIMfgManufacturingProgramAddin libCAAMaiCreateToolBarFromCatalog
[Top]
The CAAMaiCreateToolBarFromCatalog use case code is located in the CAAMaiCreateToolBarFromCatalog.m module of the CAAManufacturingItf.edu framework:
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\ CAAMaiCreateToolBarFromCatalog.m |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/ CAAMaiCreateToolBarFromCatalog.m |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
There are two logical steps in CAAMaiCreateToolBarFromCatalog:
We now comment each of those sections by looking at the code.
[Top]
The CAAMaiStandardMPCom.cpp file illustrates how to access to the machining process instantiation command through the CATIMfgCatalogServices interface.
The following code enables to access to the CATIMfgCatalogServices :
CATIMfgCatalogServices *piServices=NULL;
CATString ClassName("CATMfgCatalogServices");
CATInstantiateComponent (ClassName,CATIMfgCatalogServices::ClassId(),(void**)&piServices);
Then the BuildMfgStartupMPPath method builds a complete path from a catalog name, by analysing the CATInstallPath environment variable and the "startup\Manufacturing\Processes" relative path :
CATUnicodeString CatalogName = "MP_demo.catalog"; CATUnicodeString Path;HRESULT Res = piServices->BuildMfgStartupMPPath(CatalogName, Path);
In this case, the MP_demo.catalog file is delivered in the standard Machining configuration (look at intel_a\startup\Manufactruing\Processes path under Windows or intel_a/startup/Manufactruing/Processes path under Unix). Any other method to build the path can be used.
The LaunchMPApplication method launches the Machining Process instantiation and looks like the instantiation from the catalog browser :
Res = piServices->LaunchMPApplication(Path, PathChapter, NomMPRef, Keyword);
The Path argument is the same as the path returned by the previous method.
The PathChapter argument describes the path to access the Machining Process inside the catalog
The NomMPRef argument is the Machining Process Name in the catalog
The Keyword argument enables to customize the Machining Process name at the instantiation. It has to be defined in the resources\msgcatalog\CATMfgMachProcessCatalogAccess.CATNls file but it is not a prerequisite
[Top]
The CAAMaiAddinCmd.cpp file declares all the command headers and organizes the toolbars.
Two commands are declared from the SampleCmdHdr command header in the CreateCommands method. These headers are linked to the CAAMaiStandardMPCom and CAAMaiStandardMPCom2 commands. This is there that the customer will declare his own commands. The command icons are defined in the SampleCmdHdr.CATRsc resource file of the CAAManufacturingItf.edu framework
A sub-toolbars sample is proposed in the CreateToolbars method : the toolbar contains two sub-toolbars with two commands each one.
The tool bar :
The 2 sub-toolbars :
and
[Top]
It is important to set the command headers icons in the SampleCmdHdr.CATRsc resource file to be able to launch the Machining Process instantiation.
You can use commands from Machining Processes catalogs and official commands in your tool bars (Let's have a look in the CATMfgHeader.CATRsc file).
[Top]
This article provides an example on how to use the CATIMfgCatalogServices interface dedicated to the workbench customization.
[Top]
[1] | Building and Launching a CAA V5 Use Case |
[Top] |
Version: 1 [January 2008] | Document created |
[Top] |
Copyright © 2008, Dassault Systèmes. All rights reserved.