Inspection Process Definition

Inspection

Accessing Tolerances

Accessing tolerance related information
Use Case

Abstract

This article discusses the CAADNBInsTolCmd use case. This use case explains how to access the TTRSList and get the component list.


What You Will Learn With This Use Case

This use case is intended to help you get the details regarding accessing the tolerance related parameters.You can also know more about tolerance information like extracting tolerance values in the Tolerance modeler where further details would be given.

[Top]

The CAADNBInsTolerance Use Case

CAADNBInsTolCmd is a use case of the CAADNBInsTolerance.m module in the CAADNBInspectInterfaces.edu framework that illustrates CAADNBInspectInterfaces framework capabilities.

[Top]

What Does CAADNBInsTolCmd Do

The use case allows the user to get the TTRSList and to get the component list .

[Top]

How to Launch CAADNBInsTolCmd

To launch CAADNBInsTolCmd, you will need to set up the build time environment, then compile CAADNBInsTolCmd along with its prerequisites, set up the run time environment [1], open the Process document, load the Geometry, define a feature associated to the geometry and then execute the command.

[Top]

Where to Find the CAADNBInsTolCmd Code

The CAADNBInsTolCmd use case is located in the CAADNBInsTolerance.m module of the CAADNBInspectInterfaces.edu framework:

Windows InstallRootDirectory\CAADNBInspectInterfaces.edu\CAADNBInsTolerance.m\
Unix InstallRootDirectory/CAADNBInspectInterfaces.edu/CAADNBInsTolerance.m/

where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

[Top]

Step-by-Step

Following are the  logical steps in CAADNBInsTolCmd:

  1. Prolog
  2. PickFeature
  3. Epilog

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

[Top]

Prolog

The use case is executed after a Geometry is loaded and a feature is defined which is associated to the geometry. It allows the user to get the TTRSList and the component list .

[Top]

PickFeature

//=============================================================================
// PickFeature : When the Feature is picked this method is called and
//               this method gets TTRSList , then the ComponentList
//=============================================================================
CATBoolean
CAADNBInsTolCmd::PickFeature( void *data )
{
  HRESULT rc=E_FAIL;
  CATBaseUnknown *cbu=NULL;
  cbu = _ProcessAgent->GetElementValue();
  if( NULL == cbu )
    return(FALSE);  
  
  // Get a Handler to the DNBIInsFtrPosition Interface
  DNBIInsFtrPosition *fp=NULL;
  rc=cbu->QueryInterface(IID_DNBIInsFtrPosition,(void **)&fp);
  cbu->Release();
  cbu=NULL;
  if(FAILED(rc)||NULL==fp)
    return(FALSE);
  
  // Get the List of TTRS
  CATListValCATBaseUnknown_var ListOfTTRS;
  rc = fp->GetTTRSList(ListOfTTRS);
  
  // realease the Handler
  fp->Release();
  fp=NULL;
  
  if( ListOfTTRS.Size() == 1 )
  {
    // Get the First Element from the TTRS list
    CATITTRS_var pTTRS( ListOfTTRS[1] );
    if( NULL_var == pTTRS )
      return(FALSE);
    
    // Get the component list
    CATLISTV(CATBaseUnknown_var) ComponentList;
    rc = pTTRS -> GetComponents (ComponentList);
  }
  
  return TRUE;
}

When the feature is picked this method retrieves the TTRS list and the component list.

[Top]

Epilog

The use case finishes retrieving the TTRS List and the Component list.

[Top]


In Short

This use case has demonstrated the way to get the TTRS list and the component list for a feature related to a geometry.

The use case :

[Top]


References

[1] Building and Launching a CAA V5 Use Case
[Top]

[Top]


History
Version: 1 [Mar 2002] Document created

[Top]


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