3D PLM PPR Hub Open Gateway

Knowledge Modeler

Parameters Naming

To be clear when using naming methods for parameters

Technical Article

Abstract

The purpose of this article is to help you to choose the correct method when you need to manipulate the name of your applicative parameters.


Introduction

When you manipulate the parameters [1] of your object, depending on where you watch them in CATIA (editors or specification tree), or depending on which API you use in your application, you will have different names. It may seem complicated, but it especially offers a richness of treatments. You may want to manipulate the basic name of your parameter, or to see its path in the model or in a specific context, or you may want to assign it a nickname ... The aim of this article is to make a status once for all on the parameter naming.

[Top]

Modelisation

We distinguish 2 names for a same parameter:

    - the internal role.

    - the variable name.

The internal role is the name given to the parameter at creation. If the parameter has been created by an application, generally, it is not modified afterwards, because the application can use this internal role to recognize this parameter among the others. But it is possible interactivly through the  Parameters Explorer.

The variable name is the name given by the user when he explicitely renames it in F(x) or in the Parameter's Explorer. In theory, applications don't use this variable name.

In the image below, Point.1 has 3 coordinates parameters. X, Y and Z are their internal role assigned at their creation. The first coordinate X has been renamed by the end user in Point1_X: it is the variable name of the parameter.

                                                                                       

[Top]

What you see in CATIA and what you can do interactivly?

In F(x):

    - A parameter is seen with its variable name if it exists and otherwise with its pathname (built on the internal role).

    - You can rename a parameter. This action modifies its variable name.

    - You can delete its variable name by entering an empty string in the "Name" field. This action re-displays the pathname automatically.

                                                           

[Top]

In the Specification Tree:

    - A parameter is seen with its variable name if it exists and otherwise with its internal role.

In the Parameters Explorer:

    - The "Local Name" field displays the internal role.

    - The "Name" field displays the variable name.

    - The internal role can be modied for user parameters. In the other case, this name can used by the application.

    - The variable name can be modified and deleted. In this case the pathname appears automatically.

                                                                                       

[Top]

What to know when developping your application?

About Parameter Creation:

When you create a parameter with a method of CATICkeParmFactory like CreateLength("H", 47.477mm), the first argument becomes the internal role of the parameter: here "H".

About the CATICkeParm services manipulating parameter naming:

    CATICkeParm::InternalRole() :

   Returns the Internal Role of the parameter.

    CATICkeParm::Role() :

In the case of a non user parameter, this method tries to translate in NLS the Internal Role by searching in the NLS file equivalent to the startup catalog of the aggregating feature. In other words, the Role of the parameter H aggregated under a point will be searched as the translation of "H" in the file CATHybridShapeNLS.CATNls equivalent to the CATHybridShape.feat catalog containing the point startup.

    CATICkeParm::PathName() :

This pathname is NLS. It is the concatenation of the CATICkeParm::Role of the parameter, with the CATIAlias::GetAlias of the father features of the parameter.

    CATICkeParm::Name() :

 Returns the variable name if it exists otherwise it returns the pathname.

    CATICkeParm::Rename :

Modifies the variable name.

    CATICkeParm::IsNamed() :  

Indicates if the parameter has a variable name.

    CATICkeParm::RelativeName() :

Does the same as Name(). But it has a supplementary argument which is the aggregating object where we stop the naming.

[Top]

About CATIAlias:

An alias is the name seen by the end user. It can be translated (NLS). For a parameter, the method CATIAlias::GetAlias returns the value of CATICkeParm::Name(). The method SetAlias calls CATICkeParm::Rename().

[Top]

Where else is used the internal role?:

The internal role is used in the default implementation of CATIInstance. The methods CATIInstance::GetValue("H") and CATIInstance::SetValue("H", 50mm) are scanning  parameters with the CATIParmPublisher::VisitChildren service looking for the one with the Internal Role "H".

As a consequence, the method GetAttributeReal("H") available in Knowledge Expert and based on CATIInstance works by comparing its argument to the Internal Role. The SetAttributeReal method creates the parameter if it doesn't exist and appends it to the object (It has the same effect as interactivly through the Parameters Explorer).

[Top]

About VB and CATIAParameters:

In a macro VB, When you create a parameter through the collection of parameters CATIAParameters, it is aggregated under the feature on which you get the collection, and the name to specify in argument is the internal role.

The Item method of CATIAParameters works either on the alias (variable name or pathname) or on the RelativeName with the feature in argument. Item is sensitive to NLS.

[Top]

About parameters in User Defined Feature:

Note the following current limitation: be carefull with User Defined Feature (UDF) because they have a particular behavior. when you publish a parameter embedded into a UDF, its variable name is put into its internal role, and the variable name is then deleted (CATICkeParm::Rename("")). The "Name" field accessible in the "Parameters" tab of a UDF is the internal role.

Before the publication of the parameter Point1_X                                                                      After the publication, by checking the button "Published".

   

As you can see in the Parameters Explorer, the "Name" field displays the pathname and the variable name has been copied in the internal role.

[Top]


References

[1] Literal Feature Overview
[Top]

History

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

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