Equipment & Systems

Distributive Systems

Accessing Stretchable Part Data

How to access stretchable part data
Use Case

Abstract

This article discusses the CAAPspStretchable use case.


What You Will Learn With This Use Case

This use case is intended to show you how to obtain data defining a stretchable object.

[Top]

The CAAPspStretchable Use Case

CAAPspStretchable is a use case of the CAAPlantShipInterfaces.edu framework that illustrates CATPlantShipInterfaces framework capabilities.

[Top]

What Does CAAPspStretchable Do

The goal of  CAAPspStretchable is to show you how to use the CATPlantShipInterfaces methods to query and obtain data defining stretchable objects. 

 [Top]

How to Launch CAAPspStretchable

To launch CAAPspStretchable, you will need to set up the build time environment, then compile CAAPspStretchable along with its prerequisites, set up the run time environment, and then execute the sample. This is fully described in the referenced article [1]. When launching the use case, you must pass the following arguments:

[Top]

Where to Find the CAAPspStretchable Code

CAAPspStretchable code is located in the CAAPspStretchable.m use case module of the CAAPlantShipInterfaces.edu framework:

Windows InstallRootDirectory\CAAPlantShipInterfaces.edu\CAAPspStretchable.m
Unix InstallRootDirectory/CAAPlantShipInterfaces.edu/CAAPspStretchable.m

where InstallRootDirectory is the root directory of your CAA V5 installation. It is made of  two unique source files named CAAPspStretchableMain.cpp and CAAPspStretchable.cpp.

Additional prerequisite code is located in the CAAPspUtilities.m directory of the same framework.

[Top]

Step-by-Step

There are four logical steps in CAAPspStretchable:

  1. Prolog
  2. Initializing the Environment
  3. Retrieving Stretchable Part Data

[Top]

Prolog

In this use case, we open an input document containing some Equipment and Piping Design objects. 

[Top]

Initializing the Environment

The CAAPspStretchable code is derived from the CAAPspBaseEnv base class. The base class contains functionality common to the other CAAPsp samples.   Initializing the environment involves the following methods:

CAAPspBaseEnv::CreateCATProductEnv
CAAPspBaseEnv::ApplicationInit

This method performs the following functions:

[Top]

Retrieving Stretchable Part Data

The CATIPspStretchableData interface is used to retrieve a list of points defining a stretchable part and a list of bend radius for each definition point.   In this sample, the CATIPspStretchableData interface pointer is obtained from a bendable pipe in the document. 

CATListValCATMathPoint ListOfPoints;
CATListOfDouble ListOfRadii;
if ( SUCCEEDED(piStretchable->ListDefinitionPoints(NULL,ListOfPoints)) )
{
   NumOfPts = ListOfPoints.Size();
   cout << "Number of pipe definition points: " << NumOfPts << endl;
   for ( int i = 1; i <= NumOfPts; i++ )
   {
      mPt = ListOfPoints[i];
      mPt.GetCoord(PtCoord);
      X = PtCoord[0]; 
      Y = PtCoord[1];
      Z = PtCoord[2];
   }
}
if ( SUCCEEDED(piStretchable->ListBendData(ListOfRadii)) )
{
   NumOfPts = ListOfRadii.Size();
   for ( int i = 1; i <= NumOfPts; i++ )
   {
      Radius = ListOfRadii[i];
   }
}

[Top]


In Short

This use case has demonstrated how to use the Psp interfaces to obtain stretchable part data.  Specifically, it has illustrated:

[Top]


References

[1] Building and Launching a CAA V5 Use Case

History

Version: 1 [April 2004] Document created
[Top]

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