Equipment & Systems Engineering

Electrical Harness Installation

Analyzing a Branchable Bundle Segment

How to analyse bundle segments and find all support linked on bundle segments of a branchable bundle segment
Use Case

Abstract

This article discusses the CAAEhiMultiBundleSegment use case. This use case explains how to analyse a branchable bundle segment and to find all support linked with each bundle segment of the branchable bundle segment


What You Will Learn With This Use Case

This use case is intended to show you how to browse the content of a harness branch (geometrical bundles) and to get geometrical definition of bundle segments.

Following operations are detailed is this use case:

Top]

The CAAEhiMultiBundleSegment Use Case

CAAEhiMultiBundleSegment is a use case of the CAAElecHarnessItf.edu framework that illustrates the ElecHarnessItf framework capabilities.

[Top]

What Does CAAEhiMultiBundleSegment Do

The goal of CAAEhiMultiBundleSegment is to navigate within an product structure and to retrieve and analyze geometrical bundle content. The existing product structure is found under the pathname of the document passed as an argument to this program.

Above is a CATIA image of a product structure we will use as an example to browse electrical harness components.

[Top]

How to Launch CAAEhiMultiBundleSegment?

To launch CAAEhiMultiBundleSegment, you will need to set up the build time environment, then compile CAAEhiMultiBundleSegment.cpp along with its prerequisites, set up the run time environment, and then execute the sample. This is fully described in the referenced article [2].

To launch the use case, execute the following command:

mkrun -c "CAAEhiMultiBundleSegment input.CATProduct"

[Top]

Where to Find the CAAEhiMultiBundleSegment Code?

CAAEhiMultiBundleSegment code is located in the CAAEhiMultiBundleSegment.m use case module of the CAAElecHarnessItf.edu framework:

Windows InstallRootDirectory/CAAElecHarnessItf.edu/CAAEhiMultiBundleSegment.m
Unix InstallRootDirectory\CAAElecHarnessItf.edu\CAAEhiMultiBundleSegment.m

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

[Top]

Step-by-Step

There are seven main logical steps in CAAEhiMultiBundleSegment:

  1. Prolog
  2. Initializing Electrical Environment
  3. Retrieving all Geometrical Bundle under Root Product and  Analyse the first.
  4. Retrieving all Bundle Segments under Selected Geometrical Bundle and  Analyse it.
  5. Retrieving Electrical Curve ( Bundle Segment Route )
  6. Retrieving all Supports Linked to Bundle Segment
  7. Epilog.

We will now comment each of those sections by looking at the code.

 

 

[Top]

Prolog

Once the current session has been created, the CATProduct document can be loaded into the session . pDoc is a pointer to this document.

The root product of the document is retrieved . pRootProduct is a CATIProduct handle to the root product .

Methodology describing how to load a CATProduct document and how to retrieve the root product is described in [1].

[Top]

Initialize Electrical Environment

...
CATIEleDocServices * piElecDocServices = NULL;
  
  rc = pDoc->QueryInterface(IID_CATIEleDocServices,(void**) &piElecDocServices );
  if ( SUCCEEDED(rc) && piElecDocServices )
  {
    rc = piElecDocServices->Initialize();
  }

...

Initializing the electrical environment is mandatory to enable access to electrical object or electrical attributes.

[Top]

Retrieving all Geometrical Bundle under Root Product and Selecting the first to Analyse

...
  CATListValCATBaseUnknown_var* pListGeoBundle = NULL;
  pListGeoBundle = piRootProduct->GetAllChildren(CATIEhiGeoBundle::ClassName());
  piRootProduct -> Release();
  piRootProduct = NULL ;
  
  int NumberOfGeoBundle = 0;
  if ( (NULL!=pListGeoBundle) && pListGeoBundle->Size() ) 
  {
    NumberOfGeoBundle = pListGeoBundle->Size();	

...

We use generic method CATIProduct::GetAllChildren to retrieve all geometric bundles under root product.

...
  CATIEhiGeoBundle * piGeoBundle = NULL;
  rc = (*pListGeoBundle)[1]->QueryInterface(IID_CATIEhiGeoBundle,(void**) &piGeoBundle);

...

First element in list of geometric bundle is selected.

[Top]

Retrieving all Bundle Segments under Selected Geometrical Bundle and Selecting one to Analyse

...
  CATListValCATBaseUnknown_var* pListBundleSegment = NULL;
  rc = piGeoBundle->ListBundleSegments(&pListBundleSegment);

...

We use CATIEhiBundleSegment::ListBundleSegments to retrieve list of bundle segments under selected geometric bundle.

...
  CATIEhiBundleSegment * piBundleSegment = NULL;
  
  int rank = 1;
  rc = (*pListBundleSegment)[rank]->QueryInterface(IID_CATIEhiBundleSegment,(void**) &piBundleSegment);

...

We select first element in list of bundle segments.

[Top]

Retrieving Electrical Curve ( Bundle Segment Route )

We select each bundle segment in the list and we find its electrical curve and the list of its linked supports.

...
for(int rank =1 ; rank<=TailleListBundleSegment; rank++)
  {
...
    rc = (*pListBundleSegment)[rank]->QueryInterface(IID_CATIEhiBundleSegment,(void**) &piBundleSegment);
...    
    
    CATIGSMSpline * piSpline = NULL;
    rc = piBundleSegment->GetElecCurve(&piSpline);


We get flexible curve linked to bundle segment . This curve may be manipulated using CATIGSMSpline interface.

 

[Top]

Retrieving all Supports Linked to Bundle Segment

... 
    CATListValCATBaseUnknown_var* pListInstanceSupport = NULL;
    int numberOfSupport = 0;
    rc = piBundleSegment->ListLinkedSupports(&pListInstanceSupport);
...
    numberOfSupport=pListInstanceSupport->Size();
...
...

Method ListLinkedSupports is used to retrieve all support instances linked to bundle segment.

...
  CATListValCATBaseUnknown_var* pListReferenceSupport = new CATLISTV(CATBaseUnknown_var);
  
  ...
  
  // --- compute list of support references 
  cout << "   get list of reference  "<< endl << flush;
  int numberOfReference = 0;
  for ( i=1; i<=numberOfSupport; i++ )
  {
    (*pListInstanceSupport)[i]->QueryInterface(IID_CATIProduct,(void**) &piInstanceProduct);
    if ( NULL !=  piInstanceProduct )
    {
      CATIProduct_var spReferenceProduct = piInstanceProduct->GetReferenceProduct();
      if ( NULL_var !=  spReferenceProduct ) pListReferenceSupport->Append(spReferenceProduct);

...

Second part illustrates the way to retrieve support references from list of support instances.

 

[Top]

Epilog

...
rc = CATDocumentServices::Remove(*pDoc);
...
rc = ::Delete_Session(sessionName);
.

Opened documents are removed and session is deleted before exit.

[Top]

 


In Short

This use case is has demonstrated how to browse the content of a harness branch and to get geometrical definition of bundle segments contained in a geometrical bundle.

Following operations have been detailed is this use case :

[Top]


References

[1] Browsing a Product Structure
[2] Building and Launching a CAA V5 Use Case
[Top]

History

Version: 1 [Janv 2003] Document created
[Top]

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