Catalog Modeler |
Creating a CatalogUsing CATICatalogChapterFactory, CATICatalogChapter, CATILinkableObject ,CATICatalogKeyword and CATICatalogDescription |
|
Use Case |
AbstractThis use case shows how to create a catalog document. |
Users often need a way of storing and classifying the many objects they have at their disposal, whether they be screws, ball bearings or computer parts. These objects may number tens of thousands, each with its own specific characteristics such as shape, color, size, diameter, length, etc. To facilitate fast and easy retrieval of such objects thus objects avoiding time-wasting redesign Version 5 offers the possibility of creating catalogs.
A catalog is in the form of a tree structure made up of:
a description links a chapter with
and is described with keyword values
The purpose of this use case is to create a catalog composed of:
For components, the following articles described them more in depth:
Before getting to the use case itself, it is important to already be familiar with the basic notions of Catalog. See the referenced article [4] for a detailed overview.
[Top]
CAACciToolCatalogCreation is a use case of the CAAComponentsCatalogs.edu framework that illustrates ComponentsCatalogsInterfaces framework capabilities.
[Top]
This use case creates the CAATool
.catalog document [Fig.1].
The scenario of its creation is explained through images created in editing the
catalog thanks to the Catalog Editor workbench. At last, the interactive scenario to obtain the same result, is
given.
The goal of this catalog is to create a classification of Part documents which contain the design of Screws and Nuts.
The Tools
chapter is the root chapter. It contains two
keywords [Fig.2]:
ToolType
visible keyword with no default value (Unset in the
column Value)- This keyword will separate the chapters concerning the screws,
the nuts and you can imagine other kind of tools.
Suppliers
an invisible keyword with "MySupplierA
" as default value.
This keyword is available for all the catalog and must not appear in the
Catalog Browser, it is a private information, so it is set invisible. The Tools
chapter contains three sub-chapters:
The next picture [Fig 3] shows the three lines in the Reference tab page when the
Tools
chapter is current in the specification tree:
For each sub-chapter the "ToolType
" keyword is
valuated with the following values:
The Screws
chapter is an external chapter see the column
Type
[Fig
3]. In fact it is the
root chapter of the CAAScrew
catalog created in the use case
CAACciScrewCatalogCreation and detailed in the "Creating a Catalog With
Part Documents" article [1]
The Nuts
chapter
is
not an external chapter, see
the column Type
[Fig
3], and contains the "SideNumber
"
keyword. This keyword is an integer without default value (Unset in the column
Value). The goal of this keyword is to separate the nuts with their number of
sides.
This Nuts
chapter contains two sub-chapters: each a Part Family
[2]
Nuts6SidesFamily
, an external
familyNutsSidesFamily,
an internal familyThe next picture [Fig 6] shows the two lines in the Reference tab page when the
Nuts
chapter is current in the specification tree:
For each sub-chapter, a value for the "SideNumber
"
keyword is given:
The Nuts6SidesFamily
chapter is an external Part Family -see the column Type [Fig
6]. In fact it is a end chapter (Part family) of the CAANuts6Sides
catalog
created in the use case CAACciNuts6SidesCatalogCreation and explained in the
"Creating a Catalog With Part Family" article [2]
The Nuts4SidesFamily
chapter is a Part
Family whose the Part document, with a design table, is CAANuts4Sides
.
Its construction is the same
as the Nuts6SidesFamily
Part family [2],
so this article doesn't detail its creation. Nevertheless, the following picture [Fig.8]
shows the descriptions for each configuration of its design table. In this same
picture, notice that the Part configurations are not resolved: the value in the Type
column is "Part family configuration
" and not "Resolved
part family configuration
" and the value in the Object Name
column
is always CAANuts4Sides
, the original Part.
The last chapter under the
Tools
chapter is NutsWithFixedSizeHole
. This
chapter contains only one chapter the Nuts6SidesHole10Family
chapter [Fig 1].
This
chapter is a end chapter (family) whose components will be defined by a persistent query inside
the CAANuts6Sides
catalog. Refer to the
"Creating a Persistent Query" article [3] to
have a complete explanation of this family.
The interactive scenario to obtain the same CAATool.catalog
document is
the following:
Launch CATIA. When the application is ready:
(*) The file are located in the directory CAAComponentsCatalogs.edu/InputData
InstallRootDirectory/CAAComponentsCatalogs.edu/InputData
InstallRootDirectory\CAAComponentsCatalogs.edu\InputData
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
To launch CAACciToolCatalogCreation , you will need to set up the build time environment, then compile the CAACciCatalogCreate module along with its prerequisites, set up the run time environment, and then execute the use case [5].
mkrun -c CAACciCatalogCreate InputPath [OutputPath]
Where:
CAAComponentsCatalogs.edu/InputData
InstallRootDirectory/CAAComponentsCatalogs.edu/InputData
InstallRootDirectory\CAAComponentsCatalogs.edu\InputData
where InstallRootDirectory
is the directory where the CAA
CD-ROM is installed.
The use case creates three documents:
CAAScrew.catalog
, explained in the "Creating a Catalog With Part
Documents"
article [1] CAANuts6Sides.catalog
, explained in the "Creating a Catalog With Part
Family"
article [2] CAATools.catalog
, explained in the current articleAfter its execution, you can launch CATIA and open the created catalogs or execute the CAACciCatalogNavigation use case [6] for each. This use case displays the contents of a catalog.
[Top]
The CAACciToolCatalogCreation use case is made of several source files located in the CAACciCatalogCreate.m module of the CAAComponentsCatalogs.edu framework:
Name of the source file | Function |
CAACciCatalogCreateMain | Main source file |
CAACciToolCatalogCreation | Global function to create the CAATool.catalog document |
CAACciCatalogDocumentServices | Global functions to factorize the code |
depending on operating system you find them :
Windows |
InstallRootDirectory\CAA ComponentsCatalogs .edu\CAACciCatalogCreate.m\ |
Unix | InstallRootDirectory/CAA ComponentsCatalogs .edu/CAACciCatalogCreate.m/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
There are nine logical steps in the CAACciToolCatalogCreation use case:
Some operations like create a document, save a document, retrieve a chapter,..., have been factorized in global functions described in the "Global Functions" section.
[
Top]
... CATDocument * pDocument = NULL ; CATICatalogChapterFactory * pICatalogChapterFactory = NULL ; rc = ::CAACreateCatalogDocument(&pDocument,&pICatalogChapterFactory); ... |
The CAACreateCatalogDocument global
function creates a "catalog" document and returns pICatalogChapterFactory
the CATICatalogChapterFactory
interface pointer on its root container. This interface is necessary to create
chapters.
... CATICatalogChapter * piToolChapter = NULL ; CATUnicodeString ChapterName = "Tools" ; CATBoolean IsEndChapter = FALSE ; rc = pICatalogChapterFactory->CreateChapter(ChapterName,IsEndChapter,piToolChapter); ... ... |
The Tools
chapter is created thanks to the CreateChapter
method of the CATICatalogChapterFactory interface. The second parameter, IsEndChapter
,
specifies that the chapter is a not a family. The returned pointer, piToolsChapter
,
must be released as soon as it will be useless.
The Tools
chapter is the first chapter created in the
document, so it is the root chapter. It means that you can retrieve it thanks to
the GetRootChapter
method of the same interface
CATICatalogChapterFactory
.
... if ( SUCCEEDED(rc) && (NULL != piToolChapter)) { CATICatalogKeyword * piKeyword = NULL ; rc = piToolChapter->AddKeyword("ToolType","String",piKeyword); if ( SUCCEEDED(rc) ) { piKeyword->Release(); piKeyword = NULL ; } if ( SUCCEEDED(rc) ) { rc = piToolChapter->AddKeyword("Suppliers","String",piKeyword); if ( SUCCEEDED(rc) ) { // Suppliers keyword will be invisible in the // catalog browser piKeyword->SetHidden(TRUE); piKeyword->Release(); piKeyword = NULL ; } } } ... |
The "ToolType
" string keyword is created thanks to the AddKeyword
method of the CATICatalogChapter interface applied to piToolChapter
the pointer on the Tools
chapter.
Same thing for the "Suppliers
" keyword. Notice that
this keyword is hidden from a Catalog Browser, in applying the SetHidden
method on piKeyword
the CATICatalogKeyword interface pointer
of the keyword.
Default valuation
The default value for the "Suppliers
" keyword is set thanks to the SetDefaultValue
method of the CATICatalogChapter interface pointer on the Tools
chapter, piToolChapter
.
... if ( SUCCEEDED(rc) && (NULL != piToolChapter)) { CATUnicodeString Value = "MySupplierA" ; rc = piToolChapter->SetDefaultValue("Suppliers",Value); } ... |
For the "ToolType
" keyword there is not default value.
On each description of the Tools
chapter, a value will be set
thanks to the SetValue
method on a CATICatalogDescription
interface pointer. Notice that if a keyword has a default value, its value can
be nevertheless changed on each description.
... if ( SUCCEEDED(rc) && (NULL !=piToolChapter) ) { CATILinkableObject * piLinkOnChapter = NULL ; CATUnicodeString ChapterName = "Screws"; CATUnicodeString DocumentName = "CAAScrew" ; rc = ::CAAFindChapterInCatalog(DocumentName,iOutputPath,ChapterName,IID_CATILinkableObject, (void**)&piLinkOnChapter); if ( SUCCEEDED(rc) ) { CATICatalogDescription * piDescription = NULL ; rc = piToolChapter->AddDescription(piDescription,piLinkOnChapter); if ( SUCCEEDED(rc) && ( NULL != piDescription) ) { rc = piDescription->SetValue("ToolType","Screws"); piDescription->Release(); piDescription = NULL ; } piLinkOnChapter->Release(); piLinkOnChapter = NULL ; } } ... |
The CAAFindChapterInCatalog global
function retrieves inside the CAAScrew.catalog
, the Screws
chapter. The output of this function is, in this case, the CATILinkableObject
interface pointer on this external chapter. This pointer is the input of the AddDescription
method applied to piToolChapter
, the CATICatalogChapter
interface pointer of the Tools
chapter. It means that the piToolChapter
chapter has a new description which contains a link towards the external Screws
chapter.
At last, the
value of the "ToolType" keyword is set to "Screws" on the
new description, piDescription
, the description dedicated to the Screws
chapter.
... if ( SUCCEEDED(rc) ) { CATUnicodeString ChapterName = "Nuts" ; CATBoolean IsEndChapter = FALSE ; rc = pICatalogChapterFactory->CreateChapter(ChapterName,IsEndChapter,piNutsChapter); ... } ... |
The Nuts
chapter is
created thanks to the CATICatalogChapterFactory interface. The new chapter is linked with
a parent chapter thanks a new description
created on its parent chapter. In this case the parent chapter is the Tools
Chapter.
... if (SUCCEEDED(rc) && (NULL != piNutsChapter) && (NULL != piToolChapter) ) { CATILinkableObject * pLinkOnChapter = NULL ; rc = piNutsChapter->QueryInterface(IID_CATILinkableObject, (void **) &pLinkOnChapter); if ( SUCCEEDED(rc) ) { CATICatalogDescription * piDescription = NULL ; rc = piToolChapter->AddDescription(piDescription,pLinkOnChapter); if ( SUCCEEDED(rc) && (NULL != piDescription) ) { rc = piDescription->SetValue("ToolType","Nuts"); piDescription->Release(); piDescription = NULL ; } pLinkOnChapter->Release(); pLinkOnChapter = NULL ; } } ... |
Like any kind object to set in a description, the CATILinkableObject
interface on the Nuts
chapter, pLinkOnChapter
, is
necessary. The AddDescription
method applied to the Tools
chapter, the parent chapter pointed by piToolChapter
, creates
a new description with the pLinkOnChapter
interface
pointer on the Nuts
chapter.
At last, the value of the "ToolType" keyword is set to
"Nuts" on the
new description, piDescription
, the description dedicated to the Nuts
chapter.
... if ( SUCCEEDED(rc) && (NULL != piNutsChapter) ) { CATICatalogKeyword * piKeyword = NULL ; rc = piNutsChapter->AddKeyword("SideNumber","Integer",piKeyword); if ( SUCCEEDED(rc) ) { piKeyword->Release(); piKeyword = NULL ; } } ... |
The integer "SideNumber
" keyword is created on the Nuts
chapter. piNutsChapter
is the CATICatalogChapter interface
pointer on the Nuts
chapter.
... if ( SUCCEEDED(rc) && (NULL != piNutsChapter)) { CATILinkableObject * piLinkOnChapter = NULL ; CATUnicodeString ChapterName = "Nuts6SidesFamily"; CATUnicodeString DocumentName = "CAANuts6Sides"; rc = ::CAAFindChapterInCatalog(DocumentName,iOutputPath, ChapterName,IID_CATILinkableObject, (void**) &piLinkOnChapter); if ( SUCCEEDED(rc) ) { CATICatalogDescription * piDescription = NULL ; rc = piNutsChapter->AddDescription(piDescription,piLinkOnChapter); if ( SUCCEEDED(rc) && (NULL != piDescription) ) { ... rc = piDescription->SetValue("SideNumber","6"); piDescription->Release(); piDescription = NULL ; } piLinkOnChapter->Release(); piLinkOnChapter = NULL ; } } ... |
The CAAFindChapterInCatalog global
function retrieves inside the CAANuts6Sides.catalog
, the Nuts6SidesFamily
chapter. The output of this function is, in this case, the CATILinkableObject
interface pointer on this chapter. This pointer is the input of the AddDescription
method applied to piNutsChapter
, the CATICatalogChapter
interface pointer on the Nuts
chapter. It means that the piNutsChapter
chapter has a new description which contains a links towards the external Nuts6SidesFamily
chapter.
At last, the value of the "SideNumber
" keyword is
set to "6
" on the
new description, piDescription
, the description dedicated to the Nuts6SidesFamily
chapter.
... CATICatalogChapter * piNutsWithFixedSizeHoleChapter = NULL ; if ( SUCCEEDED(rc) ) { CATUnicodeString ChapterName = "NutsWithFixedSizeHole" ; CATBoolean IsEndChapter = FALSE ; rc = pICatalogChapterFactory->CreateChapter(ChapterName,IsEndChapter,piNutsWithFixedSizeHoleChapter); ... } if ( SUCCEEDED(rc) && ( NULL != piToolChapter) ) { CATILinkableObject * pLinkOnChapter = NULL ; rc = piNutsWithFixedSizeHoleChapter->QueryInterface(IID_CATILinkableObject, (void **) &pLinkOnChapter); if ( SUCCEEDED(rc) ) { CATICatalogDescription * piDescription = NULL ; rc = piToolChapter->AddDescription(piDescription,pLinkOnChapter); if ( SUCCEEDED(rc) && (NULL != piDescription) ) { // 2-6-3 Associating a value to the ToolType keyword rc = piDescription->SetValue("ToolType","Nuts"); piDescription->Release(); piDescription = NULL ; } pLinkOnChapter->Release(); pLinkOnChapter = NULL ; } } ... |
The same code as for the Nuts
chapter. The NutsWithFixedSizeHole
chapter is
created thanks to the CATICatalogChapterFactory interface.
The new chapter is linked with a parent chapter thanks a new description
created on its parent chapter. In this case the parent chapter is the Tools
Chapter.
Like any kind object to set in a description, the CATILinkableObject
interface on the
NutsWithFixedSizeHole
chapter, pLinkOnChapter
, is
necessary. The AddDescription
method applied to the Tools
chapter, the parent chapter pointed by piToolChapter
, creates
a new description with the pLinkOnChapter
interface
pointer on the
NutsWithFixedSizeHole
chapter.
At last, the value of the "ToolType" keyword is set to "Nuts
" on the
new description, piDescription
, the description dedicated to the
NutsWithFixedSizeHole
chapter.
... if ( SUCCEEDED(rc) && (NULL != pDocument) ) { CATUnicodeString DocumentName = "CAATool" ; rc = ::CAACloseCatalogDocument(DocumentName,*pDocument,iOutputPath); pDocument = NULL ; } ... |
The CAACloseCatalogDocument global
function saves the new catalog under the name CAATool
In the CAACciCatalogServices.cpp you will find the global functions used in this use case, but also in the CAACciScrewCatalogCreation [1], the CAACciNuts6SidesCatalogCreation [2] and the CAACciCatalogPersistentQuery [3] use cases.
// ObjectModelerBase Framework #include "CATDocumentServices.h" // Open/remove/new document #include "CATDocument.h" // to handle the CATDocument #include "CATInit.h" // To retrieve the root container // ObjectSpecsBase Framework #include "CATLISTV_CATISpecObject.h" // To retrieve the list of design table #include "CATIContainer.h" // for the root container of the document // ComponentsCatalogsInterfaces Framework #include "CATICatalogChapterFactory.h" #include "CATICatalogChapter.h" //MecModInterfaces Framework #include "CATIPrtContainer.h" // The Part root container //LiteralFeatures #include "CATIParmPublisher.h" #include "CATIDesignTable.h" // Standard C++ library #include <iostream.h> // System Framework #include "CATUnicodeString.h" |
This method creates a new catalog document and retrieves the CATICatalogChapterFactory interface implemented on the root container of the new document.
HRESULT CAACreateCatalogDocument(CATDocument ** opDocument, CATICatalogChapterFactory ** opCatalogChapterFactory) { HRESULT rc = E_FAIL ; if ( NULL == opDocument ) return rc ; *opDocument = NULL ; if ( NULL == opCatalogChapterFactory ) return rc ; * opCatalogChapterFactory = NULL ; // 1- Creating a new document rc = CATDocumentServices::New("catalog",*opDocument); if ( SUCCEEDED(rc) ) { CATInit *pInitOnDoc = NULL ; rc = (*opDocument)->QueryInterface(IID_CATInit,(void **) &pInitOnDoc); if ( FAILED(rc) ) { cout << "Error in retrieving the CATInit interface"<< endl; }else { // 2- Retrieving the root container CATIContainer *pIRootCont = NULL ; pIRootCont = (CATIContainer*)pInitOnDoc->GetRootContainer("CATIContainer"); if ( NULL == pIRootCont ) { cout << "The root container is NULL"<< endl; rc = E_FAIL ; }else { // 3- Retrieving the CATICatalogChapterFactory pointer on the root container rc = pIRootCont->QueryInterface(IID_CATICatalogChapterFactory, (void **) opCatalogChapterFactory); if ( FAILED(rc) ) { cout << "Error in retrieving the CATICatalogChapterFactory interface"<< endl; } pIRootCont->Release(); pIRootCont = NULL ; } pInitOnDoc->Release(); pInitOnDoc = NULL ; } } return rc ; } |
As usual, the document is created by the New
static function of
the CATDocumentServices class and a CATInit interface pointer is
retrieved. Thanks to this interface, the root container is retrieved with the GetRootContainer
method. The root container of a catalog document implements the CATICatalogChapterFactory
interface to create chapters.
This method closes the document, handled by the iDocument pointed, and saves
it under the name iDocumentName
in the directory given by the last
argument iOutputPath.
HRESULT CAACloseCatalogDocument(CATUnicodeString & iDocumentName, CATDocument & iDocument, CATUnicodeString & iOutputPath) { HRESULT rc = E_FAIL ; //1- Saving the document // ---------------------- CATUnicodeString DocumentSaveAsName = iDocumentName + ".catalog"; CATUnicodeString EmptyString ="" ; if ( EmptyString != iOutputPath ) { DocumentSaveAsName = iOutputPath + Slash + DocumentSaveAsName ; } rc = CATDocumentServices::SaveAs (iDocument,DocumentSaveAsName.CastToCharPtr()); if (FAILED(rc)) { cout << "Error in saving document "<< DocumentSaveAsName.CastToCharPtr() << endl; } //2- Removing the document from the session // ------------------------------------------ rc = CATDocumentServices::Remove(iDocument); if (FAILED(rc) ) { cout << "Error in closing document "<< DocumentSaveAsName.CastToCharPtr() << endl; } return rc ; } |
The name of the catalog document is given by the caller. As usual, the SaveAs
static function of the CATDocumentServices class is used to save the
document in a directory.
The second action consists in calling the Remove
static function
of the CATDocumentServices class. It results that the current catalog is
closed and removed from the current session. The closure of a catalog implies
that all documents pointed by this document are released (in fact unlocked).
As usual, if the count of links on a pointed document becomes zero, the pointed
document is also closed.
This function
enables to find a chapter by its name, ChapterName,
in a
given catalog, DocumentName,
located in a given directory path, DocumentPath.
HRESULT CAAFindChapterInCatalog(CATUnicodeString & iDocumentName, CATUnicodeString & iDocumentPath, CATUnicodeString & iChapterName, const IID & iInterfaceIdentifier, void ** opInterface) { HRESULT rc = E_FAIL ; if (NULL == opInterface) return rc ; *opInterface = NULL ; // 1-Building the storage name of the document // ------------------------------------------- CATDocument * pDocument = NULL ; CATUnicodeString EmptyString ="" ; CATUnicodeString ModelDocName = iDocumentName + ".catalog" ; if ( EmptyString != iDocumentPath ) { ModelDocName = iDocumentPath + Slash + ModelDocName ; } // 2-Opening the document // ---------------------- CATDocumentServices::Open(ModelDocName.CastToCharPtr(), pDocument); if ( NULL == pDocument ) { return rc ; } // 3-Retrieving the root container // -------------------------------- CATInit *pInitOnDoc = NULL ; rc = pDocument->QueryInterface(IID_CATInit,(void **) &pInitOnDoc); if ( FAILED(rc) ) { cout << "Error in retrieving the CATInit interface"<< endl; }else { CATIContainer *pIRootCont = NULL ; pIRootCont = (CATIContainer*)pInitOnDoc->GetRootContainer("CATIContainer"); if ( NULL == pIRootCont ) { cout << "The root container is NULL"<< endl; rc = E_FAIL ; }else { // 4-Retrieving its CATICatalogChapterFactory interface pointer // ----------------------------------------------------------- CATICatalogChapterFactory * pICatalogChapterFactory = NULL ; rc = pIRootCont->QueryInterface(IID_CATICatalogChapterFactory, (void **) &pICatalogChapterFactory); if ( FAILED(rc) ) { cout << "Error in retrieving the CATICatalogChapterFactory interface"<< endl; }else { // 5- Researching the chapter // --------------------------- CATICatalogChapter *pICatalogChapter = NULL ; rc = pICatalogChapterFactory->FindChapter(iChapterName,pICatalogChapter); if ( SUCCEEDED(rc) ) { rc = pICatalogChapter->QueryInterface(iInterfaceIdentifier, (void **) opInterface); pICatalogChapter->Release(); pICatalogChapter = NULL ; } pICatalogChapterFactory->Release() ; pICatalogChapterFactory = NULL ; } pIRootCont->Release(); pIRootCont = NULL ; } pInitOnDoc->Release(); pInitOnDoc = NULL ; } if ( (NULL != pDocument) && ( NULL == piInterface ) ) { rc = CATDocumentServices::Remove(pDocument); if (FAILED(rc) ) { cout << "Error in closing document "<< DocumentSaveAsName.CastToCharPtr() << endl; } } return rc ; } |
To retrieve a chapter by its name into a catalog, the FindChapter
method of the CATICatalogChapterFactory interface is used. Refer to the
use case "Browsing a Catalog" [6]
for details about this method.
In this function the pDocument
document is opened, two cases can
append:
CAATool
catalogCAATool
catalog [3]In these two cases, the closure of the CAATool
catalog will
close the document pointed by pDocument
. You can always use the
CATLockDocument
global function to keep a pointer on the
document. When the pointer will be useless, you will call the opposite
global function CATUnLockDocument.
This method enables to retrieve the first design table of a Part document given
by its complete name iDocumentName
.
HRESULT CAARetrieveDTInPartDocument(CATUnicodeString & iDocumentName, CATIDesignTable ** opDesignTable) { HRESULT rc = E_FAIL ; if ( NULL == opDesignTable ) return rc ; *opDesignTable = NULL ; // 1- Opening the document CATDocument * pDocument = NULL ; rc = CATDocumentServices::Open(iDocumentName.CastToCharPtr(),pDocument); if ( SUCCEEDED(rc) ) { CATInit *pInitOnDoc = NULL ; rc = pDocument->QueryInterface(IID_CATInit,(void **) &pInitOnDoc); if ( FAILED(rc) ) { cout << "Error in retrieving the CATInit interface"<< endl; }else { // 2- Retrieving the root container CATIPrtContainer *pIPrtCont = NULL ; pIPrtCont = (CATIPrtContainer*)pInitOnDoc->GetRootContainer("CATIPrtContainer"); if ( NULL == pIPrtCont ) { cout << "The root container is NULL"<< endl; rc = E_FAIL ; }else { // 3- Retrieving the MechanicalPart feature CATISpecObject_var spSpecObjectPart = pIPrtCont->GetPart(); if ( NULL_var == spSpecObjectPart ) { cout << "The MechanicalPart is NULL"<< endl; rc = E_FAIL ; }else { // 4-Retrieving the list of design table CATIParmPublisher * pIParmPublisher = NULL ; rc = spSpecObjectPart->QueryInterface(IID_CATIParmPublisher,(void **) &pIParmPublisher); if ( SUCCEEDED(rc) ) { CATLISTV (CATISpecObject_var) DesignTableList ; pIParmPublisher->GetAllChildren("CATIDesignTable",DesignTableList); int NbDesignTable = DesignTableList.Size(); if ( NbDesignTable >= 1 ) { CATISpecObject_var specObj = DesignTableList[1] ; rc = specObj->QueryInterface(IID_CATIDesignTable,(void**) opDesignTable); } pIParmPublisher->Release(); pIParmPublisher = NULL ; } } pIPrtCont->Release(); pIPrtCont = NULL ; } pInitOnDoc->Release(); pInitOnDoc = NULL ; } } return rc ; } |
The design table are retrieved thanks to the GetAllChildren
method of the CATIParmPublisher. In this case, it is the MechanicalPart
feature, those returned by the GetPart
method on the root container, pIPrtCont
,
which implements this interface.
[Top]
This use case illustrates how to create a catalog document in using the following interfaces:
[Top]
Version: 1 [Jul 2002] | Document created |
[Top] |
Copyright © 2002, Dassault Systèmes. All rights reserved.