AbstractThis use case explains how to create your proper algorithm to compute the Equivalent Young Modulus, Equivalent RatioToBend and Equivalent RatioToTwist of a segment. We call "segment" a portion of a bundle segment where the physical properties are constant. |
The dictionary is called CAAElecHarnessItf.edu.dic and is located in the following path :
Windows | InstallRootDirectory\CAAElecHarnessItf.edu\CNEXT\code\dictionary |
Unix | InstallRootDirectory/CAAElecHarnessItf.edu/CNEXT/code/dictionary |
where InstallRootDirectory
is the root directory of your CAA V5
installation.
To activate your code, you have to uncomment the following line :
#ElecBranchableC CATIEhiFLEX libCAAEhiFLEXImpl |
The interface dictionary declares that the ElecBranchableC object implements the CATIEhiFLEX interface and that the code to load into memory to use this interface is located in the libCAAEhiFLEXImpl shared library or DLL. To have more details, you can refer to the referenced articles [1] and [2]
[Top]
CAAEhiFLEXImpl is a CATIA component exposing the CATIEhiFLEX interface. For the definition of components and interfaces, you can refer to the referenced articles [1] and [2]
[Top]
The goal of CAAEhiFLEXImpl is to compute the Equivalent Young Modulus, the Equivalent RatioToBend and the Equivalent RatioToTwist of a segment function of the wires, wiregroups and internal splices inside the segment, the protections covering it and its geometrical characteristics.
[Top]
To launch CAAEhiFLEXImpl, you will need to set up the build time environment, then compile CAAEhiFLEXImpl along with its prerequisites as described in [3]
To do that, you must use the mkmk command (refer to [4] for more explanations)
$ cd ws_root_dir/CAAElecHarnessItf.edu/CAAEhiFLEXImpl.m
$ mkmk
or
$ cd ws_root_dir/CAAElecHarnessItf.edu
$ mkmk CAAEhiFLEXImpl.m
After, to test your component, you will have to run CATIA typing CNEXT on the command line (refer to [5]) , and to follow the scenario given in the referenced chapter [4 ]
[Top]
CAAEhiFLEXImpl code is located in the CAAEhiFLEXImpl.m module of the CAAElecHarnessItf.edu framework:
Windows | InstallRootDirectory\CAAElecHarnessItf.edu\CAAEhiFLEXImpl.m |
Unix | InstallRootDirectory/CAAElecHarnessItf.edu/CAAEhiFLEXImpl.m |
where InstallRootDirectory
is the root directory of your CAA V5
installation. It is made of a unique source file named CAAGetFLEXEquivalentModulusExt.cpp.
[Top]
The extension class is called CAAGetFLEXEquivalentModulusExt.h and is located in the LocalInterfaces of the CAAEhiFLEXImpl.m module of the CAAElecHarnessItf.edu framework:
Windows | InstallRootDirectory\CAAElecHarnessItf.edu\CAAEhiFLEXImpl.m\LocalInterfaces |
Unix | InstallRootDirectory/CAAElecHarnessItf.edu/CAAEhiFLEXImpl.m/LocalInterfaces |
#ifndef CAAGetFLEXEquivalentModulusExt_H #define CAAGetFLEXEquivalentModulusExt_H #include "CATBaseUnknown.h" #include "CATIEhiFLEX.h" class CATListValCATBaseUnknown_var; //----------------------------------------------------------------------- /** * Class extending the object "ElecBranchableC". * <br> * It implements the interfaces : * <ol> * <li>@see ElecHarnessItf.CATIEhiFLEX * </ol> * Using this prefered syntax will enable mkdoc to document your class. */ class CAAGetFLEXEquivalentModulusExt: public CATBaseUnknown { CATDeclareClass; public: // Standard constructors and destructors for an implementation class // ----------------------------------------------------------------- CAAGetFLEXEquivalentModulusExt (); virtual ~CAAGetFLEXEquivalentModulusExt (); /** * Implements the method GetFLEXEquivalentModulus from the interface * CATIEhiFLEX * * Returns the value of the Equivalent Young Modulus (in N/m2) and * Equivalent RatioToBend and Equivalent RatioToTwist function of * the values of the wires/wiregroups and protections contained * in it. Also function of the profile type and dimensions of the * segment, and the flexibility of the bundle segment. * * @param iListOfWireWireGroup * The list of the Wire(s) and/or WireGroup(s) in the segment. * * @param iOrderedListOfProtectionReference * The list of the Protections(s) covering successively the segment. * * @param ipInternalSpliceReferenceList |
For more details about what is an extension class, you can refer to the referenced article [1]
The code of the implemented method is contained in the source file named CAAGetFLEXEquivalentModulusExt.cpp.
Firstly we include the adhesion of our class CAAGetFLEXEquivalentModulusExt with interface CATIEhiFLEX as like :
#include "TIE_CATIEhiFLEX.h" TIE_CATIEhiFLEX(CAAGetFLEXEquivalentModulusExt); CATImplementClass( CAAGetFLEXEquivalentModulusExt, CodeExtension, CATBaseUnknown, ElecBranchableC); |
The unique method is called GetFLEXEquivalentModulus. It takes as input
the list of the routable objects wires and/or wiregroups contained in the
segment (CATListValCATBaseUnknown_var *), the ordered stack of protections over
the segment (CATListValCATBaseUnknown_var *), the type of profile
(CATEhiProfileType) of this segment and its dimensions in mm (double), the
value flexibility of the flexibility slider of the corresponding bundle
segment.
It returns the value of the Equivalent Young Modulus (in N/m2) and Equivalent
RatioToBend and Equivalent RatioToTwist of the segment.
The calculation is based upon the desired combination of all the input parameters.
First we initialize the HRESULT and the respective size of the list of routable objects and the list of protections.
... //========================================================================== // GetFLEXEquivalentModulus //========================================================================== HRESULT CAAGetFLEXEquivalentModulusExt::GetFLEXEquivalentModulus(CATListValCATBaseUnknown_var * ipListOfWireWireGroup , CATListValCATBaseUnknown_var * ipOrderedListOfProtectionReference , |
Then we structure our code based on the type of profile given as input.
... if(iProfile == Circular) { ... } else if(iProfile == Elliptical) { ... } else if(iProfile == Rectangular) { ... } else { ... } ... |
Concerning the circular type of profile we based the calculation on the number of protections covering in the segment and their type.
if(iProfile == Circular) { oYoungModulusEquivalent=1.24*10e09; oEquivalentRatioToBend=1/1000; oEquivalentRatioToTwist=10; const CATUnicodeString ElecType("_Elec_Type"); CATUnicodeString ProtectionType; for(int i=1;i<=nbOfProtections ;i++) { CATIProduct_var hProtection =(*ipOrderedListOfProtectionReference )[i]; CATIElecAttrAccess_var hElecAttrAccess(hProtection); CATICkeParm_var hTypeCkeParm; HRESULT RC = hElecAttrAccess->GetAttribute(ElecType, hTypeCkeParm); if (!!hTypeCkeParm) ProtectionType = hTypeCkeParm->Value()->AsString(); if(ProtectionType=="ElecTape") { if(oEquivalentRatioToBend<1) oEquivalentRatioToBend=oEquivalentRatioToBend*3; oEquivalentRatioToTwist=oEquivalentRatioToTwist*2; } else { if(oEquivalentRatioToBend<=1/100 && oEquivalentRatioToTwist<=100) { oEquivalentRatioToBend=oEquivalentRatioToBend*100; oEquivalentRatioToTwist=oEquivalentRatioToTwist*10; } else { oEquivalentRatioToBend=1; oEquivalentRatioToTwist=100; } } } |
Concerning the elliptical type of profile we based the calculation on its dimensions and the Flexibility slider.
else if(iProfile == Elliptical) { if(iProfileLength1 < 10 && iProfileLength2 > 2 ) { oYoungModulusEquivalent=10e08; oEquivalentRatioToBend=1/100; oEquivalentRatioToTwist=10; } else { if(iBundleSegmentFlexibility<3) { oYoungModulusEquivalent=1.24*10e11; oEquivalentRatioToBend=1; oEquivalentRatioToTwist=100; } else { oYoungModulusEquivalent=10e10; oEquivalentRatioToBend=1/2; oEquivalentRatioToTwist=10; } } HR=S_OK; } |
Concerning the rectangular type of profile we based the calculation on the number of routable objects in the segment.
else if(iProfile == Rectangular) { oYoungModulusEquivalent=1.24*10e11; oEquivalentRatioToBend=1/10; oEquivalentRatioToTwist=10; if(nbOfWiresWireGroups<2) { oYoungModulusEquivalent=10e07; } else { oYoungModulusEquivalent=1.24*10e11; } HR=S_OK; } |
Finally we return whether the implementation succeeded or not.
... return HR; } |
[Top]
[1] | Creating components |
[2] | Creating interfaces |
[3] | Building and Launching a CAA V5 Use Case |
[4] | Testing your own computation algoritm |
[5] | Using mkmk |
[Top] |
Version: 1 [December 2004] | Document created |
[Top] |
Copyright © 2004, Dassault Systèmes. All rights reserved.