3D PLM Enterprise Architecture |
V4 Access |
Retrieving Data of an Element of a V4 DocumentGet the information contained in a model |
Use Case |
AbstractThis article shows how to retrieves data of a V4 element. |
mkrun -c CAAV4iEduV4DataAccess InputModel OutputFile
Where:
InputModel : the full path of the modelYou can use the model CUBE.model
located in CAADoc/
CAA
CATIAV4Interfaces
.edu/CNext/resources/graphic
InstallRootDirectory\CAADoc\CAA
CATIAV4Interfaces
.edu\CNext\resources\graphic
InstallRootDirectory/CAADoc/CAA
CATIAV4Interfaces
.edu/CNext/resources/graphic
Windows | InstallRootDirectory\CAACATIAV4Interfaces.edu\CAAV4iEduV4DataAccess.m\ |
Unix | InstallRootDirectory/CAACATIAV4Interfaces.edu/CAAV4iEduV4DataAccess.m/ |
where InstallRootDirectory is the directory where the CAA CD-ROM is
installed.
... 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.
... CATV4iV4Element* masterElem=NULL; CATV4iV4Element* setElem=NULL; CATV4iV4Element* element=NULL; int end =0; if (! CATV4iGetMaster(doc, masterElem, ier) ) { if (! CATV4iGisset(masterElem, setElem, end, ier) ) { if (! CATV4iGisels(setElem, NULL, element, end, ier) ) { ... |
CATV4iGetMaster is a functions that retrieves the first workspace of the
model : the MASTER. If doc is not a V4 document, the function fails.
CATV4iGisset retrieves the first set of the workspace masterElem.
CATV4iGisels retrieves the first element of the set setElem.
... CATString identificator=element->GetId(); ... int itp, its; element->GetType(itp, its); ... int layer =-1; result = CATV4iGirlay(element, layer, ier); ... int oShow=-1, oPick=-1, oCol=-1, oBlink=-1, oThick=-1, oLine=-1; result = CATV4iGirvis( element, oShow, oPick, oCol, oBlink, oThick, oLine, ier); ... |
If element has been correctly created by CATV4iGisels, the data can be
retrieved.
element->Id() retrieves the identificator of the element,
element->GetType(...) retrieves the primary and the secondary types of
element
...CATV4iGirlay(... retrieves the number of the layer
...CATV4iGirvis(... retrieves graphical data about the element : show,
pickable, color, blink, steady, thickness, line type.
[1] | Scanning the model |
[2] | 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.