Equipment & Systems Engineering |
Electrical Wire Routing |
Listing conductors going through a Route SegmentHow to list the conductors (wires and/or wire groups) going through a route segment |
Use Case |
AbstractThis 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. |
The following operations are detailed is this use case:
[Top]
CAAEwrListWiresInBundleSegment is a use case of the CAAElecRoutingItf.edu framework that illustrates the use of the CATIEwrRouteSegment interface capabilities of the ElecRoutingItf framework .
[Top]
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]
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"
Unix | InstallRootDirectory/CAAElecRoutingItf.edu/CNext/resources/graphic/CAAEwrListWiresInBundleSegment/Electrical-External-data-start.CATProduct |
Windows | InstallRootDirectory\CAAElecRoutingItf.edu\CNext\resources\graphic\CAAEwrListWiresInBundleSegment\Electrical-External-data-start.CATProduct |
[Top]
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]
There are six steps in CAAEwrListWiresInBundleSegment:
We will now comment each of those sections by looking at the code.
[Top]
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]
To initialize the electrical environment, use the CATIElecDocServices interface:
... CATIEleDocServices * piElecDocServices = NULL; rc = pDoc->QueryInterface(IID_CATIEleDocServices,(void**) &piElecDocServices ); ... |
[Top]
Use the CATIProduct::GetAllChildren method to retrieve the geobundles.
... CATListValCATBaseUnknown_var *pListGeoBundle = piRootProduct->GetAllChildren(CATIEhiGeoBundle::ClassName()); ... |
[Top]
To retrieve the bundle segments in a geobundle use the CATIGeoBundle::ListBundleSegments method.
... CATListValCATBaseUnknown_var* pListBundleSegment = NULL; rc = piGeoBundle->ListBundleSegments(&pListBundleSegment); ... |
[Top]
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]
... 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]
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]
[1] | Building and Launching a CAA V5 Use Case |
[2] | Creating a New Document |
[Top] |
Version: 1 [Nov 2004] | Document created |
[Top] |
Copyright © 2004, Dassault Systèmes. All rights reserved.