Equipment & Systems Engineering |
Electrical Harness Installation |
Managing Protections on Bundle SegmentsHow to create and manage protections on bundle segments |
Use Case |
AbstractThis article discusses the CAAEhiCreateAndManageProtection use case. This use case explains how to create a protection on a bundle segment, and how to manage it. |
This use case is intended to show you how to create protections on bundle segments, and how to manage them.
Following operations are detailed is this use case:
[Top]
CAAEhiCreateAndManageProtection is a use case of the CAAElecHarnessItf.edu framework that illustrates the ElecHarnessItf framework capabilities.
[Top]
The goal of CAAEhiCreateAndManageProtection is to create a protection on a bundle segment, and to manage it.
[Top]
To launch CAAEhiCreateAndManageProtection, you will need to set up the build time environment, then compile CAAEhiCreateAndManageProtection.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 "CAAEhiCreateAndManageProtection InPathDir OutPathDir MainName ProtName"
The input documents can be found in:
InstallRootDirectory\OS\resources\graphic\CAA_EHIMultiBranchableSample
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]
CAAEhiCreateAndManageProtection code is located in the CAAEhiCreateAndManageProtection.m use case module of the CAAElecHarnessItf.edu framework:
Windows | InstallRootDirectory/CAAElecHarnessItf.edu/ CAAEhiCreateAndManageProtection.m |
Unix | InstallRootDirectory\CAAElecHarnessItf.edu\ CAAEhiCreateAndManageProtection.m |
where InstallRootDirectory
is the root directory of your CAA V5
installation. It is made of a unique source file named CAAEhiCreateAndManageProtection.cpp.
[Top]
There are seven main logical steps in CAAEhiCreateAndManageProtection:
We will now comment each of those sections by looking at the code.
[Top]
The root product of the document is retrieved . piRootProduct is a CATIProduct handle to the root product .
After, the CATPart document containing the protection is loaded into the session. pProtDoc is a pointer to this document.
Then, the root product of the protection document is retrieved, piProtRootProduct is a pointer to this document.
Methodology describing how to create 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 objects or electrical attributes .
Geometrical Bundle is retrieved using a query interface on CATIEhiGeoBundle on all the products. Only one geometrical bundle is retrieved in the document.
... CATListValCATBaseUnknown_var* pListProduct = NULL; pListProduct = piRootProduct->GetAllChildren(CATIProduct::ClassName()); int NumberOfProduct = pListProduct?pListProduct->Size():0; CATListValCATBaseUnknown_var* pListGeoBundle=new CATLISTV(CATBaseUnknown_var); CATIEhiGeoBundle* piEhiGbn=NULL; for ( i =1; i<=NumberOfProduct; i++ ) { if (NULL_var != (*pListProduct)[i]) { (*pListProduct)[i]->QueryInterface(IID_CATIEhiGeoBundle,(void**) &piEhiGbn); if ( NULL != piEhiGbn) { CATBaseUnknown_var hUnk=piEhiGbn; if (NULL_var != hUnk) pListGeoBundle->Append(hUnk); } } } // we keep the geometrical bundle CATIEhiGeoBundle * piGeoBundle = NULL; if (NULL_var != (*pListGeoBundle)[1]) { (*pListGeoBundle)[1]->QueryInterface(IID_CATIEhiGeoBundle,(void**) &piGeoBundle); } ... |
piGeoBundle is the pointer on the geometrical bundle.
[Top]
First step consists in retrieving all the bundle segments under the geometrical bundle.
Seven bundle segments are retrieved under the geometrical bundle.
... CATListValCATBaseUnknown_var* pListBundleSegments=new CATLISTV(CATBaseUnknown_var); rc = piGeoBundle->ListBundleSegments(&pListBundleSegments); ... |
pListBundleSegments is a pointer on the list of bundle segments.
Second step consists in filling the list containing the bundle segments to protect.
We choose to protect only the first bundle segment found in the previous list.
... CATListValCATBaseUnknown_var* pListBnsToProtect = new CATLISTV(CATBaseUnknown_var); // we fill the stack pListBnsToProtect->Append((*pListBundleSegments)[1]); ... |
To add a protection on the bundle segment, we use the method InstanciateProtection of CATIEhiGeoBundle interface :
... CATIEhiProtection * piProtection = NULL; double L1 = 0.1; double L2 = 0.8; rc = piGeoBundle->InstanciateProtection(piProtRootProduct,pListBnsToProtect,L1,L2,piProtection); ... |
in the
sample, the protection reference is a CATPart and an instance of this CATPart is
created every time the methode InstanciateProtection is used.
In fact, the reference of the protection must be stored in a catalog and you have to instantiate a new part from this reference every time you want to create a protection from this reference . Methodology describing how to store CATParts in a catalog and how to retrieve them from it is documented in [3].
[Top]
To manage protections on bundle segment, you can use the methods of CATIEhiProtection interface . The code sample shows how to set the extremities of a protection :
... L1 = 0.1; L2 = 0.1; rc = piProtection->SetProtectionExtremities(L1,L2); ... |
Above is a CATIA image showing the protection (yellow) covering the bundle segment..
[Top]
The main document is saved at the end.
... CATUnicodeString oFileRoot(argv[3]); rc = CATDocumentServices::SaveAs (*pMainDoc , oFileRoot ); ... |
Document is removed and session is deleted before exit.
... rc = CATDocumentServices::Remove(*pGbnDoc); ... rc = ::Delete_Session(sessionName); ... |
[Top]
This use case is has demonstrated how to create and manage protections on bundle segments.
Following operations have been detailed is this use case :
Initialize
method
of CATIEleDocServices.InstanciateProtection
method of CATIEhiGeoBundle.[Top]
[1] | Adding Components to a Product Structure |
[2] | Building and Launching a CAA V5 Use Case |
[3] | Instantiating a component from a catalog |
[Top] |
Version: 1 [Jan 2003] | Document created |
[Top] |
Copyright © 2002, Dassault Systèmes. All rights reserved.