AbstractThis 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 |
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]
CAAEhiMultiBundleSegment is a use case of the CAAElecHarnessItf.edu framework that illustrates the ElecHarnessItf framework capabilities.
[Top]
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]
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"
InstallRootDirectory\OS\resources\graphic\CAA_EHIMultiSegmentSample
where InstallRootDirectory is the root directory of your CAA V5 installation, and OS is a directory the name of which depends on the operating system. Refer to [2] to get the list of the currently supported operating systems and their associated directory names.
[Top]
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]
There are seven main logical steps in CAAEhiMultiBundleSegment:
We will now comment each of those sections by looking at the code.
[Top]
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]
... 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]
... 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]
... 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]
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]
... 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]
... rc = CATDocumentServices::Remove(*pDoc); ... rc = ::Delete_Session(sessionName); . |
Opened documents are removed and session is deleted before exit.
[Top]
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 :
Initialize
method
of CATIEleDocServices.GetAllChildren
method of CATIProductListBundleSegments
of CATIEhiBundleSegmentGetElecCurve
of CATIEhiBundleSegment.ListLinkedSupports
of CATIEhiBundleSegment.[Top]
[1] | Browsing a Product Structure |
[2] | Building and Launching a CAA V5 Use Case |
[Top] |
Version: 1 [Janv 2003] | Document created |
[Top] |
Copyright © 2003, Dassault Systèmes. All rights reserved.