Shape Design& Styling

Generative Shape Design

Updating Shape Design Features

Update and check linearity for Shape Design features
Technical Article

Abstract

This article discusses the CAAGsiObjectUpdate service.

What is new in the update of Shape Design features

Shape Design features can now be inserted in Body, OGS and GS.
Body and OGS are new set of features in which shape design features can be inserted
They proposed enhanced mechanisms for feature (Absorbed main input, Current feature for Shapes ) that required additional actions at update for feature in Body and OGS context (GS is the former "Ooen Body")

The CAAGsiObjectUpdate Service of CAAGsiService,h header - Update Shape Design features

CAAGsiServices encapsulates generic sequences of code.
CAAGsiObjectUpdate is an update method available for Shape Design features, Part Design features to be used when features are inserted in Body, OGS and GS

[Top]

Where to Find the CAAGsiServices Code

The CAAGsiServices header export a list of self-contain tools , is located in PublicInterfaces of CAAGSMInterfaces.edu and is implements in the CAAGsiServices.m module of the CAAGSMInterfaces.edu framework:

Windows InstallRootDirectory\CAAGSMInterfaces.edu\CAAGsiServices.m\
Unix InstallRootDirectory/CAAGSMInterfaces.edu/CAAGsiServices.m/

where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

[Top]

Step-by-Step

CAAGsiServices , CAAGsiObjectUpdate Step by Step

  1. Use standard Mechanical Modeler Update on feature
  2. Check insert location set and manage linearity if needed

[Top]


Use standard Mechanical Modeler Update on feature

Mechanical Modeler update standard mechanism

// Update 
// ---------------------------------------------------------------------------
ExportedByCAAGsiServices HRESULT 
CAAGsiObjectUpdate(const CATISpecObject_var & ispSpec)
{
   ... 
   HRESULT rc = S_OK ; 
   CATTry { 
    iStat = ispSpec -> Update();
    ...
    }
   // This block is specific for Update Errors
   CATCatch(CATMfErrUpdate,error) {
       cerr << " Update Error: " << (error-> GetDiagnostic()).ConvertToChar() << endl; 
       return E_FAIL; 
   } 
   // This block treats every other exception
   CATCatch(CATError,error) {
       cerr << " Error: " << (error->GetMessageText()).ConvertToChar() << endl; 
       return E_FAIL; 
   }
   CATEndTry;
   return rc ; 
}

Check insert location set and manage linearity if needed

To be done after feature update

...
// check Linearity / useful for absorbent feature inserted in OGS 
CATISpecObject_var spFather = ispSpec->GetFather();
if ( NULL_var != spFather )
{
   spFather -> Release();
   CATIGSMTool *piGSMToolFather = NULL;
   rc =spFather->QueryInterface ( IID_CATIGSMTool, (void**)&piGSMToolFather);
   if ( SUCCEEDED(rc) ) { 
     int IsAnAbsorbantSet = -1 ;
     piGSMToolFather->GetType(IsAnbsorbantSet) ;
     if ( 1 == IsAnAbsorbantSet ) {
        CATBaseUnknown_var spUnkwnSpec = ispSpec;
        rc = CATMmrLinearBodyServices::Insert(spUnkwnSpec) ; 
    } 
   piGSMToolFather->Release() ; piGSMToolFather=NULL; 
}
... 

Most of the case, it is recommended in applicative code to call afterwards SetCurrentFeature method of CATIPrtPart Interface on the just updated object : in CATIAV5 interactive function : Object just created or just edited are set as current (Body and OGS)


In Short

This service demonstrated how to implement absorbent mechanism at feature update for shape design and part design features inserted in Body and/or OGS

[Top]

References

[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]

History

Version: 1 [May 2004] Document created
[Top]

Copyright © 2004, Dassault Systèmes. All rights reserved.