Mechanical Design

Aerospace Sheet Metal Design

Creating and Modifying a Surfacic Flange

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

Use Case

Abstract

This article discusses the CAAStmSurfacicFlange use case. This use case explains how to create or modify a Surfacic Flange feature. A Surfacic Flange is a feature to stiffen another aerospace sheet metal feature.[1]


What You Will You Learn With This Use Case

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

The CAAStmSurfacicFlange Use Case

CAAStmSurfacicFlange is a use case of the CAAAerospaceSheetMetal.edu framework that illustrates the creation or modification of a Surfacic Flange feature.

What Does CAAStmSurfacicFlange Do

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

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 Surfacic Flange 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 Surfacic Flange with features read in CAATestCreateFlangeSurf.CATPart :

Remark that the Sheet Metal Parameters feature and the Base Feature (i.e. : Web.1 ) must exist in the input Part ( see the spec tree above ).

The sample will create a SurfacicFlange with Web.1 as Base Feature and Extrude.1 as Support :

[Top]

How to Launch CAAStmSurfacicFlange

To launch CAAStmSurfacicFlange, you will need to set up the build time environment, then compile CAAStmSurfacicFlange 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 CAATestCreateFlangeSurf.txt is found

[Top]

Where to Find the CAAStmSurfacicFlange Code

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

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

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

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

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

[Top]

Step-by-Step

There are 7 main steps in CAAStmSurfacicFlange :

  1. Read and analyse input data
  2. Create a session
  3. Create the SurfacicFlange feature
  4. Set of the SurfacicFlange 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 CAAStmSurfacicFlange.cpp.

[Top]

Read and analyse input data

CAAStmSurfacicFlange sample will first read and analyse an input data file.

Note : some services are provided in the class CAAStmServices.

     ...
    CAAStmServices CAASmaTools;

    rc = CAASmaTools.AnalyseSurfacicFlangeInputData (InputDataFilePath, CAASurfacicFlangeInput);
    ...

The method AnalyseSurfacicFlangeInputData 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 = "CAAStmSurfacicFlange";
  CATSession * pSession     = NULL; 
    
  rc = Create_Session (pSessionName, pSession); 
    
  ...
  
  // Load the input Document

  rc = CATDocumentServices::OpenDocument((CAAFlangeInput.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 SurfacicFlange feature

Create a SurfacicFlange feature using CreateSurfacicFlange method of CATIAerospaceSheetMetalFactory : this method will create all internal features and links between the attributes of the SurfacicFlange. If a modification is asked the Surfacic Flange will be retrieved :

 
    ...
    if(CAAFlangeInput.GetModifFlange())
      {
      // Try to retrieve the SurfacicFlange Feature :
      rc = CAASmaTools.FindFeatureInSpecTree (spPrtPartSpec, CAAFlangeInput.ModifFlangeName, &piFlangeSurfSpec);
      ...
      
    else
      {
      // creation of a new SurfacicFlange
      rc = piAslFactory -> CreateSurfacicFlange ((CATISpecObject *) spPrtPartSpec, &piFlangeSurfSpec);
      ... 

[Top]

Set of the SurfacicFlange parameters

Set the SurfacicFlange parameters according to the the values stored in CAAFlangeInput

i.e : Support Geometry : set a CATISpecObject pointer

 
      ...
      if(SUCCEEDED(rc) && (CAAFlangeInput.GetSupportGeomToSet()))
        {
        // Search the Support input specification :
        CATISpecObject * pSupportSpec = NULL;

        rc = CAASmaTools.FindFeatureInSpecTree (spPrtPartSpec, CAAFlangeInput.SupportGeomName, &pSupportSpec);

        if(SUCCEEDED(rc) && (NULL != pSupportSpec))  
          {
          // Set the Support Geometry :
          rc = piStmFlangeSurf -> SetSupport (pSupportSpec);
          ...

i.e : EOP : Length From OML : Valuate a CATICkeParm pointer

 
      ...
      if(SUCCEEDED(rc) && (CAAFlangeInput.GetEOPLengthToSet()))
        {
        if((CAAFlangeInput.EOPTypeName) == "Length From OML")
          {
          CATICkeParm * piEOPLengthParam = NULL;

          rc = piStmFlangeSurf -> GetEOPLength (&piEOPLengthParam);
      
          if(SUCCEEDED(rc) && (NULL != piEOPLengthParam))
            {
            // Valuate the Literal ::
            double MKSVal = CAASmaTools.ConvertLengthToMKS (CAAFlangeInput.LengthUnit,
                                                            CAAFlangeInput.EOPLengthValue);  // MKS Units

            piEOPLengthParam -> Valuate(MKSVal);
            ...

i.e : Base Feature orientation : set a CATOrientation

 
      ...
      if(SUCCEEDED(rc) && (CAAFlangeInput.GetBaseFeatureOrientToSet()))
        { 
        rc = piStmFlangeSurf -> SetBaseFeatureOrient (CAAFlangeInput.BaseFeatureOrient);
        ...

[Top]

Update the Part feature

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

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

Before updating the Surfacic Flange it is necessary to check the internal links :

 
      ...
      // Check Surfacic Flange Internal Structure before updating :
      if(SUCCEEDED(rc))
        {
        rc = piStmFlangeSurf -> CheckInternalStructure ((CATISpecObject *) spPrtPartSpec);
        ...

Update the Part :

    
    ...
    // Update the Part : to ensure all internal Surfacic Flange links 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, (CAAFlangeInput.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 != piStmFlangeSurf)
    {
    piStmFlangeSurf -> Release();
    piStmFlangeSurf = NULL;
    }
  if(NULL != piFlangeSurfSpec)
    {
    piFlangeSurfSpec -> Release();
    piFlangeSurfSpec = 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 Surfacic Flange 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.