AbstractThis article discusses the CAAGsiUserTools Object. This use case explains how to insert a feature in an open body. |
The procedural view is the representation of the associative feature creation in the CATIA V5 frame.
Once the feature is created , its representation is generated (build, update) and it is visualized in CATIA in the 3D window and in graph
This article is intended to help you make your first steps in programming with CATIA Shape Design [1]. Its main intent is to show you how to insert a feature in procedural view.
[Top]
CAAGsiUserTools is a usefull class in CAAGsiToolkit.m module of the CAAGSMInterfaces.edu framework that illustrates GSMInterfaces framework object standard use.
CAAGsiUserTools is a toolkit object that encapsulate three aspects of CAA development in Wireframe and Shape Design
Two first aspects are general behaviors to re-use to instanciate any GSD features of GSMInterfaces in CATIA V5 frame.
The second aspect is presented in this article
[Top]
The CAAGsiUserTools Object is made of a single class named CAAGsiUserTools located in the CAAGsiToolkit.m module of the CAAGSMInterfaces.edu framework:
Windows | InstallRootDirectory\CAAGSMInterfaces.edu\CAAGsiToolkit.m\ |
Unix | InstallRootDirectory/CAAGSMInterfaces.edu/CAAGsiToolkit.m/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
Since release V5R12
Before release CATIA V5R12
[Top]
HRESULT
CAAGsiUserTools::InsertInProceduralView(const CATISpecObject_var& ispObjectToAppend,
const CATISpecObject_var& ispInputParent)
{
// V5R12 AND FOLLOWING VERSIONS: Tool to Insert into the procedural view
// ----------------------------------------------------------------------------
HRESULT rc = E_FAIL;
CATIGSMProceduralView_var curobj = ispObjectToAppend;
if (NULL_var != curobj ) {
rc = curobj->InsertInProceduralView(ispInputParent);
}
return rc ;
}
|
The interface is implemented for all GSD feature and it allows to directly
insert the current feature in the procedural view
It encapsulates the previous proposed methodology to insert a feature in an Open
Body
If the input father feature is not set (NULL_var) then the current feature is
used as reference for inserting.
Note: If object is already inserted, nothing is done.
Some additionnal arguments can be setted (which values are default defined)
The interface is much more straight forward for inserting GSD feature and it is recommended to use it since V5R12.
HRESULT CAAGsiUserTools::InsertInProceduralView(const CATISpecObject_var &ispObjectToAppend, const CATISpecObject_var &ispInputParent) { CATIGSMTool_var spTool = ispInputParent; if (NULL_var == spTool) spTool = GetCurrentGSMTool("",1); ... |
We first get a CATIGSMTool smart pointer from the ispInputParent
smart pointer. If the given CATISpecObject Smart Pointer ispInputParent
equals NULL_var then we call the GetCurrentGSMTool
method to
retrieve a GMTool. If we call InsertInProceduralView
with a null ispInputParent
then we will retrieve the GSMTool automatically.
We have stored the _pFact pointer in the CAAGsiUserTools class in the method Init
that has to be called before doing anything, we call the GetCurrentGSMTool()
method to retrieve a Current GSMTool or create one and set it current. This
enable the user to directly call InsertInProceduralView()
without
calling CreateGSMTool()
before.
The main drawback of this, is that we will make a lot of unuseful calls to retrieve the Part, the current Tool and finally insert a feature in the GSMTool.
The smart pointer spPart
to the CATIPrtPart interface
enables us to retrieve the active Tool (One always one.) Then, we try to get a CATIGSMTool
smart pointer on the spCurrentTool
CATIBasicTool smart
pointer, if spCurrentTool
is a GSMTool then spTool
is
not null.
At this stage, we have to check that the tool retrieved is not the open body
dedicated to store external references (Multi-model links). If it is the case,
we set spTool
to NULL_var which means that we need to create
another GSMTool feature for our need. We finally call the CreateGSMTool
method [3]. We will create this open body with the
default argument (iSetAsCurrent = 1 and iTopLevel = 0). This open body will
appear after the current open body in procedural view.
In some case, we will insert two features at a time in the procedural view: a feature and an open body.
[Top]
Now that we have retrieved (or created) an open body, we can aggregate the shape design feature inside it.
HRESULT CAAGsiUserTools::InsertInProceduralView() { ... if ( NULL_var != ispObjectToAppend && NULL_var != spTool) { CATIDescendants_var spParent = spTool; if ( NULL_var != spParent) spParent->Append ( ispObjectToAppend ); else return E_FAIL; } else return E_FAIL; return S_OK; |
We get a CATIDescendants interface smart pointer from the spTool
smart pointer, in order to aggregate the ispObjectToAppend in the
GSMTool.
A shape design feature is created without any parent, but in order to see them in 3D and to manipulate them in the CATIA V5 applications, we have to aggregate them in open bodies.
We call the Append
method of spParent in order to add to its
descendant the ispObjectToAppend
feature.
[Top]
[Top]
[1] | About Generative Shape Design Features |
[2] | Building and Launching a CAA V5 Use Case |
[3] | Creating an Open Body |
[4] | CAAGsiNozzle Use case |
[Top] |
Version: 1 [Apr 2000] | Document created |
Version: 2 [Apr 2003] | Documentset as Technical Article |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.