Equipment & Systems Engineering |
Electrical Harness Installation |
Analyzing a Harness BranchHow to get geometrical definition of a harness branch |
Use Case |
AbstractThis article discusses the CAAEhiGeoBundle use case. This use case explains how to navigate within an existing product structure, searching geometrical bundles and bundle segments, and how to get geometrical definition of a 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]
CAAEhiGeoBundle is a use case of the CAAElecHarnessItf.edu framework that illustrates the ElecHarnessItf framework capabilities.
[Top]
The goal of CAAEhiGeoBundle 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 CAAEhiGeoBundle, you will need to set up the build time environment, then compile CAAEhiGeoBundle.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 "CAAEhiGeoBundle input.CATProduct"
InstallRootDirectory\OS\resources\graphic
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 [1] to get the list of the currently supported operating systems and their associated directory names.
[Top]
CAAEhiGeoBundle code is located in the CAAEhiGeoBundle.m use case module of the CAAElecHarnessItf.edu framework:
Windows | InstallRootDirectory/CAAElecHarnessItf.edu/CAAEhiGeoBundle.m |
Unix | InstallRootDirectory\CAAElecHarnessItf.edu\CAAEhiGeoBundle.m |
where InstallRootDirectory
is the root directory of your CAA V5
installation. It is made of a unique source file named CAAEhiGeoBundle.cpp.
[Top]
There are six logical steps in CAAEhiGeoBundle:
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)[NumberOfGeoBundle]->QueryInterface(IID_CATIEhiGeoBundle,(void**) &piGeoBundle); ... |
Last 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]
... 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); ... |
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]
... CATIElecAttrAccess * piElecAttribute = NULL; piBundleSegment->QueryInterface(IID_CATIElecAttrAccess,(void**) &piElecAttribute); ... // -- list attributes on object cout << " get list of attributes of bundle segment "<< endl << flush; CATListValCATUnicodeString* pAttNameList = NULL; // rc = piElecAttribute->ListAttributeNames ( pAttNameList ); ... |
We use CATIElecAttrAccess to get electrical attributes of bundle
segment. Using method ListAttributeNames
, we first get all
attributes of bundle segment .
... CATUnicodeString AttributeToRead = "Elec_LengthOUT"; double bns_length = 0.; CATICkeInst_var spCKEvalue ; cout << " get length of bundle segment ( MKSA unit system ) "<<endl << flush; cout << " . get value (MKSA) of attribute "<< AttributeToRead.ConvertToChar() <<endl << flush; rc = piElecAttribute->Get(AttributeToRead,spCKEvalue); if ( SUCCEEDED(rc) ) { if ( NULL_var != spCKEvalue ) bns_length = spCKEvalue->AsReal(); ... |
Second part illustrates method to get attribute values using CATIElecAttrAccess::GetValue
. Each attribute value is returned as a CATICkeInst interface
smart pointer.[3]
Real attribute values may be read using AsType
method of CATICkeInst interface where Type
may be Integer,Real,Boolean,String depending
of type of attribute. All values are given in MKSA unit system [4]
.
[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.ListAttributeNames
and
GetValue
of CATIElecAttrAccess.[Top]
[1] | Browsing a Product Structure |
[2] | Building and Launching a CAA V5 Use Case |
[3] | Using Persistent Parameters |
[4] | About Units |
[Top] |
Version: 1 [Jul 2001] | Document created |
[Top] |
Copyright © 2001, Dassault Systèmes. All rights reserved.