3D PLM PPR Hub Open Gateway

Knowledge Modeler

Using Manipulators

How to create a manipulator and associate it with a literal

Use Case

Abstract

This article explains how to associate a manipulator with a literal.


What You Will Learn With This Use Case

In this use case, you will learn to create a manipulator and specify its value range.

[Top]

Reminder about Parameter Edition

When editing a parameter, right-clicking the value field displays a contextual menu which provides you with commands to help you select the value to be assigned to a parameter.

When you modify the parameter value, you use the use the arrows to increment or decrement the amount to be specified. This object which appears to the end user as up and down arrows is called a spinner. The object which describes how the spinner behaves is called a manipulator.

You can describe a manipulator as an object which has bounds, which increments or decrements its value by a certain number of the appropriate units etc., but a manipulator is only meaningful when applied to a parameter.

The manipulator dictates the lower and upper bounds of the parameter value (Range command in the contextual menu), the number of steps to be memorized by the system when you add a new step from the Change Step command or a list of authorized values for multiple-value parameters.

Other data related to parameters (tolerance, measure and comments) are not controlled by manipulators.

[Top]

The CAALifParametersMani Use Case

CAALifParametersMani is a use case of the CAALiteralFeatures.edu framework that illustrates KnowledgeInterfaces framework capabilities.

[Top]

What Does CAALifParametersMani Do

The CAALifParametersMani sample:

[Top]

How to Launch CAALifParametersMani

To launch CAALifParametersMani, you will need to set up the build time environment, then compile CAALifParametersMani along with its prerequisites, set up the run time environment, and then execute the use case [1].

[Top]

Where to Find the CAALifParametersMani Code

The CAALifParametersMani use case is located in:

Windows InstallRootDirectory\CAALiteralFeatures.edu\CAALifParameters.m\
Unix InstallRootDirectory/CAALiteralFeatures.edu/CAALifParameters.m/

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

The CAALifParametersMani is in the CAALifParametersMani .cpp file. The main program related to this file is CAALifParametersMain.

[Top]

Step-by-Step

The CAALifParametersMani use case is made up of eight steps:

  1. Creating a Manipulator
  2. Creating a Manipulator
  3. Specifying the Manipulator Range
  4. Creating a Length Type Parameter
  5. Assigning a Value Length Type Parameter
  6. Testing the Assigned Value
  7. Testing Another Value
  8. Assigning Other Values

[Top]

Creating a Manipulator

// Create a manipulator
CATICkeParmFactory_var spFact = cont;
CATIParmManipulator_var spManip = spFact->CreateParmManipulator ();

A manipulator is created by using the CATICkeParmFactory::CreateParmManipulator method which returns a CATIParmManipulator.

[Top]

Making a Manipulator Persistent

Code to Provide
      

A manipulator is not persistent. In a global application, you have to create it the first time you enter the editor.

[Top]

Specifying the Manipulator Range

// Specify the manipulator range 
spManip->SetAccurateRange (10,1,20,2);

The lower and upper bounds of the manipulator are specified.

The CATIParmManipulator::SetAccurateRange takes as its arguments:

  1. The lower bound of the value range (10)
  2. A number which specifies whether the lower bound can be included in the parameter value range:
    1. 0, when no minimum is defined
    2. 1, when the lower bound can be one of the value of the defined range. This is the value specified in our example.
    3. 2, when the lower bound is to be excluded from the parameter value range.
  3. The upper bound of the value range (20)
  4. A number which specifies whether the lower bound can be included in the parameter value range:
    1. 0, when no maximum is defined
    2. 1, when the upper bound can be one of the value of the defined range
    3. 2, when the upper bound is to be excluded from the parameter value range. This is the value specified in our example.

[Top]

Creating a Length Type Parameter

The "lengthParam" length type parameter is created [2].

[Top]

Assigning a Value Length Type Parameter

...
s->ValuateStored (15);
...

The "lengthParam" parameter is assigned a value in model unit. Let's remind you that the model unit for length is the mm.

This means that the parameter value is 15 mm.

[Top]

Testing the Assigned Value

Code to Provide
      

A test is performed to determine whether the value 10 is authorized. Normally, it should be.10 is the lower bound but the lower bound has been specified as a possible value. The value returned by the CATIParmManipulator::TestValue method is described by the enum below:

enum TestRC
{
  Ok =0,
  MinReached =1,
  NotInEnum =3,    // only for enumerated type
  NotAuthorized =4 // value type is wrong
};

0 is returned.

[Top]

Testing Another Value

Another test is performed to determine whether the value 21 is authorized. Normally, it should not be as 21 is beyond the upper bound. The value returned by CATIParmManipulator::TestValue is 2 indicating that the upper bound has been overtaken.

[Top]

Assigning Other Values

Testing a value does not mean that the value is applied to the parameter. Now, the value 10 is assigned to "lengthParam". Displaying the actual parameter value gives 10.

The value 20 is assigned to "lengthParam". Displaying the actual parameter value gives 10, the last authorized value assigned to the parameter.

[Top]


In Short

A manipulator allows you to define how the parameter values can be specified in terms of bounds, increment/decrement amounts, steps to be memorized. A manipulator is to be associated with a parameter.

[Top]


References

[1] Building and Launching CAA V5 Samples
[2] Using Persistent Parameters
[Top]

History

Version: 1 [Jun 2000] Document created
[Top]

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