Equipment & Systems Engineering

Electrical Wire Routing

Computing Bundle Segment Dimensions

How to implement your own algorithm to compute bundle segment dimensions
Use Case

Abstract

This use case explains how to create your proper algorithm to compute the dimensions (i.e. diameter and minimum bend radius) of a bundle segment according on the wires its contains


Modifying the interface dictionary of the framework CAAElecRoutingItf.edu

The dictionary is called CAAElecRoutingItf.edu.dic and is located in the following path :
Windows InstallRootDirectory\CAAElecRoutingItf.edu\CNEXT\code\dictionary
Unix InstallRootDirectory/CAAElecRoutingItf.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 :
#ElecBundleSegmentE           CATIEwrUipBundleSegment         libCAAEwrRoutingImpl
#ElecBundleSegmentC           CATIEwrUipBundleSegment         libCAAEwrRoutingImpl

The interface dictionary declares that the ElecBundleSegment object implements the CATIEwrUipBundleSegment interface and that the code to load into memory to use this interface is located in the libCAAEwrRoutingImpl shared library or DLL. To have more details, you can refer to the referenced articles [1] and [2]

Top]

Building the CAAEwrRoutingImpl component

 

CAAEwrRoutingImpl is a CATIA component exposing the CATIEwrUipBundleSegment interface. For the definition of components and interfaces, you can refer to the referenced articles [1] and [2]

[Top]

What does CAAEwrRoutingImpl do ?

The goal of CAAEwrRoutingImpl is to calculate the diameter and the minimum bend radius of a bundle segment according to the wires contained in it.

[Top]

How to build CAAEwrRoutingImpl ?

To launch CAAEwrRoutingImpl, you will need to set up the build time environment, then compile CAAEwrRoutingImpl along with its prerequisites as described in [3]

To do that, you must use the mkmk command (refer to [5] for more explanations)

$ cd ws_root_dir/CAAElecRoutingItf.edu/CAAEwrRoutingImpl.m
$ mkmk

or

$ cd ws_root_dir/CAAElecRoutingItf.edu
$ mkmk CAAEwrRoutingImpl.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]

Where to find the CAAEwrRoutingImpl code?

CAAEwrRoutingImpl code is located in the CAAEwrRoutingImpl.m module of the CAAElecRoutingItf.edu framework:

Windows InstallRootDirectory\CAAElecRoutingItf.edu\CAAEwrComputeBundleSegment.m
Unix InstallRootDirectory/CAAElecRoutingItf.edu/CAAEwrComputeBundleSegment.m

where InstallRootDirectory is the root directory of your CAA V5 installation. It is made of a unique source file named CAAEwrUipBundleSegmentExt.cpp.

[Top]

Description of the extension class

The extension class is called CAAEwrUipBundleSegmentExt.h and is located in the LocalInterfaces of the CAAEwrRoutingImpl.m module of the CAAElecRoutingItf.edu framework:

Windows InstallRootDirectory\CAAElecRoutingItf.edu\CAAEwrComputeBundleSegment.m\LocalInterfaces
Unix InstallRootDirectory/CAAElecRoutingItf.edu/CAAEwrComputeBundleSegment.m/LocalInterfaces
#ifndef CAAEwrUipBundleSegmentExt_H
#define CAAEwrUipBundleSegmentExt_H

// COPYRIGHT DASSAULT SYSTEMES 2002

// inherited from
#include "CATBaseUnknown.h"

// forward declaration
#include "CATListOfDouble.h"


class CAAEwrUipBundleSegmentExt: public CATBaseUnknown
{
  CATDeclareClass;
  
public:
  
  CAAEwrUipBundleSegmentExt();
  virtual ~CAAEwrUipBundleSegmentExt();
  
  /**
  * Returns the value of bundle segment diameter (in mm) fonction
  * of the values of the diameters of the wires contained in it.     
  *  
  * iListOfWireDiameters
  *   The list of the diameters of the wires contained in the bundle segment
  *   (the diameters must be expressed in mm)
  * oBundleSegmentDiameter
  *   The value of the bundle segment diameter 
  *   (the diameter must be expressed in mm)
  */
  HRESULT ComputeDiameter (const CATListOfDouble iListOfWireDiameters , double & oBundleSegmentDiameter); 
  
  /**
  * Returns the value of bundle segment bend radius (in mm) fonction
  * of the values of the bend radii of the wires contained in it.     
  *  
  * iListOfWireBendRadius
  *   The list of the bend radii of the wires contained in the bundle segment
  *   (the bend radii must be expressed in mm)
  * oBundleSegmentBendRadius
  *   The value of the bundle segment bend radius
  *   (the value must be expressed in mm)
  */ 
  HRESULT ComputeBendRadius (const CATListOfDouble iListOfWireBendRadius, double & oBundleSegmentBendRadius);
  
private:
  
  CAAEwrUipBundleSegmentExt(const CAAEwrUipBundleSegmentExt &);
  CAAEwrUipBundleSegmentExt& operator=(const CAAEwrUipBundleSegmentExt &); 
  
};

#endif

For more details about what is an extension class, you can refer to the referenced article [1]

 

Description of the implemented methods

The code of the implemented methods is contained in the source file named CAAEwrUipBundleSegmentExt.cpp.

 

Firstly  we include the adhesion of our class CAAEwrUipBundleSegmentExt with interface CATIEwrUipBundleSegment as like : 

#include "TIE_CATIEwrUipBundleSegment.h"
TIE_CATIEwrUipBundleSegment(CAAEwrUipBundleSegmentExt);

CATBeginImplementClass(CAAEwrUipBundleSegmentExt, CodeExtension, CATBaseUnknown, ElecBundleSegmentE);
CATAddClassExtension(ElecBundleSegmentC);
CATEndImplementClass(CAAEwrUipBundleSegmentExt);

 

The first method is called ComputeDiameter. It takes as input the list of the diameters of the wires contained in the bundle segment (CATListOfDouble) and it returns the value of the bundle segment.

The calculation is based upon the whole area taken by all the wires.

...
//==========================================================================
// ComputeDiameter
//==========================================================================
HRESULT CAAEwrUipBundleSegmentExt::ComputeDiameter(const CATListOfDouble iListOfWireDiameters, 
                                                   double & oBundleSegmentDiameter)

{
  oBundleSegmentDiameter = 0.;
  
  int nbDiam = iListOfWireDiameters.Size();
  double Area = 0.;
  
  for (int ii=1;ii<=nbDiam;ii++)
    Area += CATPI * iListOfWireDiameters[ii] * iListOfWireDiameters[ii] /4.;
  

  oBundleSegmentDiameter = sqrt (Area * 4. / CATPI);;
  
  return S_OK;
  
}
...

The second method is called ComputeBendRadius. It takes as input the list of the bend radii of the wires contained in the bundle segment (CATListOfDouble) and it returns the value of the bundle segment bend radius.

The returned bend radius is equal to the maximum bend radius of the wires.

...
//==========================================================================
// ComputeBendRadius
//==========================================================================
HRESULT CAAEwrUipBundleSegmentExt::ComputeBendRadius(const CATListOfDouble iListOfWireBendRadius, 
                                                     double & oBundleSegmentBendRadius)
{
  
  oBundleSegmentBendRadius=0.;
  
  int nbRad=iListOfWireBendRadius.Size();
  
  for (int ii=1;ii<=nbRad;ii++)
  {
    if (iListOfWireBendRadius[ii] > oBundleSegmentBendRadius)
    {
      oBundleSegmentBendRadius = iListOfWireBendRadius[ii];
    }
  }
  
  return S_OK;
  
}
...

 

[Top]

 


References

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

History

Version: 1 [March 2002] Document created
[Top]

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