3D PLM Enterprise Architecture |
V4 Access |
Scanning a Model to Retrieve V4 ElementsWorking with the elements of model |
Use Case |
AbstractThis article shows how to scan a model. |
--*MASTER
----*SET1
------*CST1
------*CRV1
------*SOL1
------*DIT4
------*DIT5
----*SET2
------*SOL3
------*SOL5
----*SET5
------*DIT6
------*DIT7
--DETAIL-1
----*SET3
------*SOL7
------*SOL9
--DETAIL-2
----*SET4
------*SOL11
------*SOL13
mkrun -c CAAV4iEduModelScan InputModel OutputFile
Where:
InputModel : the full path of the model to scanYou can use the model DITTOS.model
located in CAA
CATIAV4Interfaces
.edu/InputData
InstallRootDirectory\CAA
CATIAV4Interfaces
.edu\InputData
InstallRootDirectory/CAA
CATIAV4Interfaces
.edu/InputData
Windows | InstallRootDirectory\CAACATIAV4Interfaces.edu\CAAV4iEduModelScan.m\ |
Unix | InstallRootDirectory/CAACATIAV4Interfaces.edu/CAAV4iEduModelScan.m/ |
where InstallRootDirectory is the directory where the CAA CD-ROM is installed.
... ofstream outputFile (argv[2]); ... |
The second argument of CAAV4iEduModelScan is the full path of the output file.
... char* pathname = argv[1]; CATDocument * doc=NULL; CATUnicodeString filename( pathname ); CATDocumentServices::OpenDocument( filename, doc, readOnlyFlag ); ... |
To access to the data of the model, a CATDocument is needed.
The path of the model passed in argument is converted to a CATString and is used
to open the model in "read only" mode.
... if (! CATV4iGetMaster(doc, wspElem, ier) ) { while(!endWsp && !ier) { if (wspElem) outputFile << "--"<<wspElem->GetId()<<endl; // the sets of the workspace wspElem are retrieved here ... if ( ! CATV4iGiswsp(wspElem, nextWspElem, wspType, endWsp, ier) ) { ... wspElem=nextWspElem; } } } ... |
This part of code consist in retrieving the workspaces of the model.
CATV4iGetMaster(doc, wspElem, ier) retrieves the MASTER workspace in
wspElem.
Then, while endWsp is false, the identificator of the workspace is
printed in the output file and the next workspace is searched using CATV4iGiswsp
... if (! CATV4iGisset(wspElem, setElem, endSet, ier) ) { while(!endSet && !ier) { if (setElem) outputFile << "----"<<setElem->GetId()<<endl; // the elements of the set setElem are retrieved here ... if (! CATV4iGisset(setElem, nextSetElem, endSet, ier) ) { ... setElem=nextSetElem; } } } ... |
This part of code consist in retrieving the set of a workspace.
CATV4iGisset(wspElem, setElem, endSet, ier) retrieves the first set of
the workspace wspElem.
Then, while endSet is false, the identificator of the set is printed in
the output file and the next set is searched using CATV4iGisset(setElem,
nextSetElem, endSet, ier)
... if (! CATV4iGisels(setElem, NULL, element, endEls, ier) ) { while(!endEls && !ier) { if (element) outputFile << "------"<<element->GetId()<<endl; ... if (! CATV4iGisels(setElem, element, nextElement, endEls, ier) ) { ... element=nextElement; } } } ... |
This part of code consist in retrieving the element of a set.
CATV4iGisels(setElem, NULL, element, endEls, ier) retrieves the first
element of the set setElem.
Then, while endEls is false, the identificator of the element is printed
in the output file and the next set is searched using CATV4iGisels(setElem,
element, nextElement, endEls, ier)
[1] | Building and Launching a CAA V5 Use Case |
[Top] |
Version: 1 [Jul 2003] | Document created |
[Top] |
Copyright © 1994-2003, Dassault Systèmes. All rights reserved.