Mechanical Design

Aerospace Sheet Metal Design

Creating and modifying a Joggle

Using the aerospace sheet metal factory and public interface to create or modify a Joggle feature

Use Case

Abstract

This article discusses the CAAStmJoggle use case. This use case explains how to create or modify a Joggle feature. A Joggle is a Feature that introduce a local deformation (twist) on a Web or a Surfacic Flange.[1]


What You Will You Learn With This Use Case

This use case learns how to use the aerospace sheet metal factory and the Joggle public interface to create , display or modify a Joggle. Its main intent is to introduce important concepts about the way to create or modify aerospace sheet metal features.

The CAAStmJoggle Use Case

CAAStmJoggle is a use case of the CAAAerospaceSheetMetal.edu framework that illustrates the creation or modification of a Joggle feature.

;What Does CAAStmJoggle Do

This use case will show you the different steps to create or modify a Joggle.

More precisely this sample :

With this sample, you will have in batch mode the same capabilities than an interactive session.

The input data file contains the same fields than the UI Joggle command panel :

Some samples of input data are provided in Data.d directory.

The structure of this file is simple :

KEYWORD: when a keyword is encountered a boolean is set to TRUE : the corresponding data is to set.

More details about available KEYWORDS are provided in front of the sample source file.

i.e. : The input data file above will create a Joggle with features read in CAATestCreateJoggle.CATPart :

Remark that the Sheet Metal Parameters feature must exist in the input Part ( see the spec tree above ).

The sample will create a Joggle with Plane.4 as Plane :

[Top]

How to Launch CAAStmJoggle

To launch CAAStmJoggle, you will need to set up the build time environment, then compile CAAStmJoggle along with its prerequisites, and set up the run time environment, and then execute the use case [2].

Launch the use case as follows:

where:

inputDirectory The directory into which CAATestCreateJoggle.txt is found

[Top]

Where to Find the CAAStmJoggle Code

The CAAStmJoggle use case is made of main program located in the CAAStmJoggle.m module of the CAAAerospaceSheetMetal.edu framework:

Windows InstallRootDirectory\CAAAerospaceSheetMetal.edu\CAAStmJoggle.m\
Unix InstallRootDirectory/CAAAerospaceSheetMetal.edu/CAAStmJoggle.m/

The input CAATestCreateJoggle.txt and CAATestCreateJoggle.CATPart are proposed in Data.d directory of CAAAerospaceSheetMetal.edu

Windows InstallRootDirectory\CAAAerospaceSheetMetal.edu\Data.d\Joggle
Unix InstallRootDirectory/CAAAerospaceSheetMetal.edu/Data.d/Joggle

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

[Top]

Step-by-Step

There are 7 main steps in CAAStmJoggle :

  1. Read and analyse input data
  2. Create a session
  3. Create the Joggle feature
  4. Set of the Joggle parameters
  5. Update the Part feature
  6. Save the result
  7. Close the session

We will now comment each of those sections by looking at the code of the main method of the file CAAStmJoggle.cpp.

[Top]

Read and analyse input data

Note : some services are provided in the class CAAStmServices.

    
      ...
    CAAStmServices CAASmaTools;

    rc = CAASmaTools.AnalyseJoggleInputData (InputDataFilePath, CAAJoggleInput);
    ...

The method AnalyseJoggleInputData will read the input data file and store the data in the class CAAStmInputData: i.e : if the method GetSupportGeomToSet() returns TRUE it means that the Support is to set.

    
      ...
class ExportedByCAAStmServices CAAStmInputData
  {
  public:
    
    CAAStmInputData();
    virtual ~CAAStmInputData();
    
    /**
     * Role: Methods to get the Input Data.
     *
     */
    
    // General Data :
    // --------------

    CATUnicodeString          GetInputPartPath  ();
    CATUnicodeString          GetOutputPartPath ();
    CATUnicodeString          GetLengthUnit     ();
    
    CATBoolean                GetDisplay ();
    
     ...

[Top]

Create a session and Check the input Part

Create a session and open the CATPart Document : this step has no specificity. It is a call to standard functionalities :

     
  ...
 
  // create a session
  char *       pSessionName = "CAAStmJoggle";
  CATSession * pSession     = NULL; 
    
  rc = Create_Session (pSessionName, pSession); 
    
  ...
  
  // Load the input Document

  rc = CATDocumentServices::OpenDocument((CAAJoggleInput.InputPartPath).ConvertToChar(), pDocument);
  
  ...
  
  // Retrieve the Part Feature and the Aerospace Sheet Metal Factory :
      
    CATIPrtContainer * piPrtCont = (CATIPrtContainer *) piInit -> GetRootContainer("CATIPrtContainer");
    
    if(NULL != piPrtCont)
      { 
      spPrtPartSpec = piPrtCont -> GetPart(); 
    
      if(NULL_var != spPrtPartSpec)
        {
        ...
  
        rc = piPrtCont -> QueryInterface(IID_CATIAerospaceSheetMetalFactory, (void **)& piAslFactory);
  
        ...

[Top]

Create the Joggle feature

Create a Joggle feature using CreateJoggle method of CATIAerospaceSheetMetalFactory : this method will create all internal features and links between the attributes of the Joggle. If Modification is asked the joggle will be retrieved :

 
    ...
     if(CAAJoggleInput.GetModifJoggle())
      {
      // Try to retrieve the Joggle Feature :
      rc = CAASmaTools.FindFeatureInSpecTree (spPrtPartSpec, CAAJoggleInput.ModifJoggleName, &piJoggleSpec);
      ...
      
     else
       {
       // creation of a new Joggle
       rc = piAslFactory -> CreateJoggle ((CATISpecObject *) spPrtPartSpec, &piJoggleSpec);
       ...

[Top]

Set of the Joggle parameters

Set the Joggle parameters according to the values stored in CAAJoggleInput

!!! Before setting the parameters it is mandatory to store the previous Joggle Support :

 
    ...
    if(SUCCEEDED(rc) && (NULL != piStmJoggle))  
      {
      // Retrieve the previous Joggle Support to manage other Joggles on Support ( see : ManageOnSupport )
      
      HRESULT rcPrev = piStmJoggle -> GetSupport (&piPrevSupportSpec);
      ...

i.e : Plane : set a CATISpecObject pointer

 
      ...
      if(SUCCEEDED(rc) && (CAAJoggleInput.GetPlaneGeomToSet()))
        {
        // Search the Joggle Plane Geom input specification :
        CATISpecObject * pPlaneGeomSpec = NULL;
      
        rc = CAASmaTools.FindFeatureInSpecTree (spPrtPartSpec, CAAJoggleInput.PlaneGeomName, &pPlaneGeomSpec);
      
        if(SUCCEEDED(rc) && (NULL != pPlaneGeomSpec))  
          {
          // Set the Joggle Plane :
          rc = piStmJoggle -> SetPlane (pPlaneGeomSpec);
          ...

i.e : Runout : valuate a CATICkeParm pointer

 
      ...
      if(SUCCEEDED(rc) && (CAAJoggleInput.GetRunoutValueToSet()))
        { 
        CATICkeParm * piRunoutValueParam = NULL;

        rc = piStmJoggle -> GetRunout (&piRunoutValueParam);

        if(SUCCEEDED(rc) && (NULL != piRunoutValueParam))
          {
          // Valuate the Literal :
          double MKSVal = CAASmaTools.ConvertLengthToMKS (CAAJoggleInput.LengthUnit,
                                                          CAAJoggleInput.RunoutValue);  // MKS Units

          piRunoutValueParam -> Valuate(MKSVal);
         
          // Inactivate the Formula if any :
          CATICkeRelation_var spRelation = piRunoutValueParam -> Relation();
          if(NULL_var != spRelation) 
            {
            if(spRelation -> IsActivated()) spRelation -> Desactivate();          
            ...

i.e : Depth orientation : set a CATOrientation

 
      ...

      if(SUCCEEDED(rc) && (CAAJoggleInput.GetDepthOrientToSet()))
        {
        rc = piStmJoggle -> SetMaterialOrient(CAAJoggleInput.DepthOrient);
        ...

[Top]

Update the Part feature

We suggest to update the Part Feature instead of the Joggle to force all internal links of the Joggle to re-build :

This step is NOT applied if "DISPLAY:" has been chosen.

!!! Before updating the Joggle it is manadatory to call a method to manage internal links :

   
        ...   
        //   Manage the Joggle impacted Features.
        //   A call to this method is mandatory BEFORE updating the Joggle.
        //
        //    - if the Support has been modified : 
        //      the Joggle will be removed from its Previous Support (if any).
        //    - if the Joggle Plane has been modified : 
        //      the Joggle will be inserted on the Support according with other Joggles (if any).
        //    - a new OFFSET Surface of the Support will be created if necessary.

        rc = piStmJoggle -> ManageOnSupport ((CATISpecObject *) spPrtPartSpec, piPrevSupportSpec);  
        ...

Update the Part

    
    ...
    // Update the Part : to force all internal impacted Specs by the Joggle to re-build
    
    rc = CAASmaTools.Update ((CATISpecObject *) spPrtPartSpec);
    ...

[Top]

Save the result

Save the result Part in a new CATPart file.

This step is not necessary if "DISPLAY:" has been chosen.

   
    ...
    // Save the Document 
    
    rc = CATDocumentServices::SaveAs (*pDocument, (CAAJoggleInput.OutputPartPath).ConvertToChar());
    ...

[Top]

Close the session

Release the interface pointers and close the session.

  
  ...
  // Releases on Interfaces :
  if(NULL != piAslFactory)
    {
    piAslFactory -> Release();
    piAslFactory = NULL;
    }
  if(NULL != piPrtPartSpec)
    {
    piPrtPartSpec -> Release();
    piPrtPartSpec = NULL;
    }
  if(NULL != piStmJoggle)
    {
    piStmJoggle -> Release();
    piStmJoggle = NULL;
    }
  if(NULL != piJoggleSpec)
    {
    piJoggleSpec -> Release();
    piJoggleSpec = NULL;
    }

  // Close the document
  rc = CATDocumentServices::Remove (*pDocument);
  
  ...
  
  // End session
  rc = Delete_Session (pSessionName);
  ...

[Top]


In Short

This use case has demonstrated the way to create, display or modify a Joggle feature.

[Top]


History

Version: 1 [January 2005] Document created
[Top]

References

[1] An Overview of the Aerospace Sheet Metal Design Features
[2] Building and Launching a CAA V5 Use Case
[Top]

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