3D PLM Enterprise Architecture |
V4 Access |
Retrieving Tubing Data From a V4 DocumentGet the information contained in a model |
Use Case |
AbstractThis article shows how to retrieve tubing data from a V4 document. |
mkrun -c CAAV4iEduGetTubingData InputModel OutputFile
Where:
InputModel : the full path of the modelYou can use the model TUBING.model
and TUBING2.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\CAAV4iEduGetTubingData.m\ |
Unix | InstallRootDirectory/CAACATIAV4Interfaces.edu/CAAV4iEduGetTubingData.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.
// Get the tubing line Outside
Diameter
double
Diameter = 0.0;
double
BendRadius = 0.0;
double
Angle = 0.0;
double
Extremity1[3];
double
Extremity2[3];
double
Center[3];
double
Udir[3];
double
Vdir[3];
int
iReturnElbowTubeData = CATV4iGetElbowTubeData (element, Diameter,
BendRadius, Angle, Extremity1,
Extremity2, Center, Udir, Vdir); if (iReturnElbowTubeData == -1)outputFile << "CATV4iGetElbowTubeData failed" << endl; else if (iReturnElbowTubeData == 0){ outputFile << "CATV4iGetElbowTubeData succeeded" << endl;outputFile << "Elbow tube Diameter = " << Diameter << endl;outputFile << "Elbow tube BendRadius = " << BendRadius << endl;outputFile << "Elbow tube Angle = " << Angle << endl; |
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.