Mechanical Design | Drafting | Editing Generated Geometry in a Generative ViewHow to access generated geometry |
Use Case |
AbstractThis article discusses the CAADrwGeomAccess use case. This use case explains how to a geometrical elements generated from 3D elements in a Drawing document. From now on, These elements will be called GenItem.
|
What You Will Learn With This Use Case
This use case is intended to show you how to access to a GenItem elements in generative view.
[Top]
The CAADrwGeomAccess Use Case
CAADrwGeomAccess is a use case of the CAADraftingInterfaces.edu framework that illustrates DraftingInterfaces framework capabilities.
[Top]
What Does CAADrwGeomAccess Do?
Fig. 1 represents the Drawing document on which a front view has been created from a Part document. The document is not provided with the use case.
Fig. 2 represents the Drawing document modified by the use case program:
- The red color has be been applied to all GenItem elements generated by the section plane.
- The green color has been applied to all GenItem elements generated by the projection.
[Top]
How to Launch CAADrwGeomAccess
To launch CAADrwGeomAccess, you will need to set up the build time environment, then compile CAADrwGeomAccess along with its prerequisites, set up the run time environment, and then execute the use case [1].
When you launch the use case, pass the full pathname of the Drawing file as argument. A Drawing file is deliverry in the following path: CAADraftingInterfaces.edu\FunctionTests\InputData\DrawingForGenGeomAccessUseCase.CATDrawing.
- With Windows
e:> mkrun -c cmd CAADrwGeomAccess c:\...\DrawingForGenGeomAccessUseCase.CATDrawing c:\DrawingTestOutput.CATDrawing
- With UNIX
$ mkrun -c cmd CAADrwGeomAccess /u/users/.../DrawingForGenGeomAccessUseCase.CATDrawing /u/users/DrawingTestOutput.CATDrawing
[Top]
Where to Find the CAADrwGeomAccess Code
The CAADrwGeomAccess use case is made of a single source file named CAADrwGeomAccess.cpp located in the CAADrwGeomAccess.m module of the CAADraftingInterfaces.edu framework:
Windows | InstallRootDirectory\CAADraftingInterfaces.edu\CAADrwGeomAccess.m\ |
Unix | InstallRootDirectory/CAADraftingInterfaces.edu/CAADrwGeomAccess.m/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM is installed.
[Top]
Step-by-Step
There are six steps in CAADRWGeomAccess:
- Creating and Initializing the Document
- Accessing the Drawing in the Document
- Navigating through the Drawing and Get the current View
- Getting the Part document pointed by the Current View
- Reading and Coloring the Generated Geometry in the Current View
- Saving the Document and Exiting
[Top]
Creating and Initializing the Document
|
This section represents the usual sequence for loading a CATIA document [2].
[Top]
Accessing the Drawing in the Document
|
The root feature of a drawing document is the Drawing, that is, the feature that implements the CATIDrawing interface. We can get a pointer to CATIDrawing using the CATIDftDocumentServices interface, which is implemented by the document. The GetDrawing
method first argument is the CATIDrawing interface IID.
[Top]
Navigating through the Drawing and Sheet to Get the Current View
|
A drawing may contain several sheets, but only one is current at a time. The current sheet is the sheet containing the active view, that is the view currently edited. The methods of the CATISheet and CATIView interfaces do return handlers, so we don’t need to care about releasing them. The drawing variable is a pointer to CATIDrawing, so we have to release when it's no longer used.
[Top]
Getting the Part Document Pointed by Current View
|
A link is created between a generative view and the CATPart document associated to keep the 2D/3D associativity. So, we have to load the CATPart document from this link.
[Top]
Reading and Coloring the Generated Geometry in the Current View
|
Note:
- Color modification is done by using CATIVisProperties interface capabilities [4].
- These modifications are not kept after view update process because GenItem elements are deleted and recreated.
[Top]
Saving the Document and Exiting
|
This section represents the usual sequence for saving a newly created CATIA document [3].
[Top]
In Short
This use case shows the way to :
- Open a Drawing document.
- Get the current view.
- Get the Part Document pointed by the generative view and open it.
- Scan all the generated geometry of the view.
- Modify the color of the aggregated curve to the GenItem elements by using CATVisProperties interfaces.
[Top]
References
[1] | Building and Lauching CAA V5 Samples |
[2] | Load an existing Document |
[3] | Modifying Object Graphical Properties |
[Top] |
History
Version: 1 [Dec 2002] | Document created |
[Top] |
Copyright © 2002, Dassault Systèmes. All rights reserved.