Equipment & Systems Engineering

Electrical Wire Routing

Listing conductors going through a Route Segment

How to list the conductors (wires and/or wire groups) going through a route segment
Use Case

Abstract

This article discusses the CAAEwrListWiresInBundleSegment use case. This use case explains how to list conductors (wires and/or wire groups) going through a route segment using the CATIEwrRouteSegment interface.


What You Will Learn With This Use Case

The following operations are detailed is this use case:

[Top]

The CAAEwrListWiresInBundleSegmentUse Case

CAAEwrListWiresInBundleSegment is a use case of the CAAElecRoutingItf.edu framework that illustrates the use of the CATIEwrRouteSegment interface capabilities of the ElecRoutingItf framework .

[Top]

What Does CAAEwrListWiresInBundleSegment Do

The goal of CAAEwrListWiresInBundleSegment is to list the conductors going through a route segment.

Above is a CATIA V5 image of the data used in this sample.

[Top]

How to Launch CAAEwrListWiresInBundleSegment

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

To launch the use case, execute the following command:

mkrun -c "CAAEwrListWiresInBundleSegment input_data.CATProduct"

[Top]

Where to Find the CAAEwrListWiresInBundleSegment Code

CAAEwrListWiresInBundleSegment code is located in the CAAEwrListWiresInBundleSegment.m use case module of the CAAElecRoutingItf.edu framework:

Unix InstallRootDirectory/CAAElecRoutingItf.edu/CAAEwrListWiresInBundleSegment.m/src/CAAEwrListWiresInBundleSegment.cpp
Windows InstallRootDirectory\CAAElecRoutingItf.edu\CAAEwrListWiresInBundleSegment.m\src\CAAEwrListWiresInBundleSegment.cpp

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

[Top]

Step-by-Step

There are six steps in CAAEwrListWiresInBundleSegment:

  1. Prolog
  2. Initializing Electrical Environment
  3. Retrieving all Geometrical Bundle under the Root Product and Selecting one to analyze
  4. Retrieving all Bundle Segments under the Geometrical Bundle and Selecting one to analyze
  5. List the Wires going through the bundle segment
  6. Epilog.

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

[Top]

Prolog

Creating a session. For more detail see[2].

...
      
int main (int argc, char * argv[] )
{ ...
CATSession *pSession = NULL;

char *sessionName = "CAAEwrListWiresInBundleSegment_Session";
HRESULT rc = ::Create_Session(sessionName,pSession);
...

  CATDocument *pDoc = NULL;
  RC = CATDocumentServices::Open(argv[1], pDoc);
...
CATIProduct* piRootProduct = NULL;// piRootProduct is a handle to document root product

CATIDocRoots * pDocRoots = NULL;
rc = pDoc->QueryInterface(IID_CATIDocRoots,(void**) &pDocRoots);
if ( FAILED(rc) || (NULL==pDocRoots) ) return 3;
CATListValCATBaseUnknown_var* pListRootProduct = pDocRoots->GiveDocRoots();
...

[Top]

Initializing Electrical Environment

To initialize the electrical environment, use the CATIElecDocServices interface:

...
  CATIEleDocServices * piElecDocServices = NULL;

rc = pDoc->QueryInterface(IID_CATIEleDocServices,(void**) &piElecDocServices );

...

[Top]

Retrieving all Geometrical Bundle under the Root Product and Selecting one to analyze

Use the CATIProduct::GetAllChildren method to retrieve the geobundles.

...
 CATListValCATBaseUnknown_var *pListGeoBundle = piRootProduct->GetAllChildren(CATIEhiGeoBundle::ClassName());
...

[Top]

Retrieving all Bundle Segments under the Geometrical Bundle and Selecting one to analyze

To retrieve the bundle segments in a geobundle use the CATIGeoBundle::ListBundleSegments method.

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

[Top]

List the Wires going through the bundle segment

Bundle segments and back shells bind to the CATIEwrRouteSegment interface. Use the method ListConductors to list the wires and/or the group wires going through the route segment

...
  CATIEwrRouteSegment *piEwrRouteSegment = NULL;
rc = piBundleSegment->QueryInterface(IID_CATIEwrRouteSegment, (void **)&piEwrRouteSegment);
...
CATListValCATBaseUnknown_var* pListConductors = NULL;
rc = piEwrRouteSegment->ListConductors(pListConductors);

...

[Top]

Epilog

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

To remove the document,  use the CATDocumentServices::Remove  method. For more detail on managing documents see [2].

...
rc = ::Delete_Session(sessionName);
...

The session is deleted before exit.

[Top]


In Short

This use case has shown you how to create a schematic document, how to create in-line references of schematic entities, how to place those references on a sheet, how to assemble, and connect those entities and how to save the document.

Following operations have been detailed is this use case:

[Top]


References

[1] Building and Launching a CAA V5 Use Case
[2] Creating a New Document
   
   
   
   
[Top]

History

Version: 1 [Nov 2004] Document created
[Top]

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