Indexes   

Parameter (Object)

Represents the parameter.
It can be computed from a relation: formula, program, or check. It is an abstract object which is not intended to be created as such, but from which the integer, bolean, real, and string parameters derive. Here is an example to create one:
	Dim CATDocs As Documents
 Set CATDocs = CATIA.Documents
 Dim part1 As Document
 Set part1   = CATDocs.Add("CATPart")
 Dim density As RealParam
 Set density = part1.Part.Parameters.CreateReal("density", 2.5)
 
See also:
IntParam, BoolParam, RealParam, StrParam, Formula, Rule, Check

Property Index

Comment
Returns or sets the parameter object comment.
Context
Returns the context of the parameter : a part, a product, a drafting, a process, depending where the parameter is.
Hidden
Returns or sets wether the parameter is hidden or should be hidden.
IsTrueParameter
Returns a boolean saying if the parameter is a true one (real, dimension, string, etc.
OptionalRelation
Returns the relation that can be used to compute the parameter.
ReadOnly
Returns whether the parameter can be modified.
Renamed
Returns a boolean saying if the parameter is a renamed parameter or not.
UserAccessMode
Returns the user access mode of the parameter.

Method Index

Rename
Renames the parameter.
ValuateFromString
Valuates a parameter using a string as input.
ValueAsString
Returns the value of the parameter as a string.

Properties


o Property Comment() As
Returns or sets the parameter object comment.
o Property Context() As (Read Only)
Returns the context of the parameter : a part, a product, a drafting, a process, depending where the parameter is.
o Property Hidden() As
Returns or sets wether the parameter is hidden or should be hidden. or not.
o Property IsTrueParameter() As (Read Only)
Returns a boolean saying if the parameter is a true one (real, dimension, string, etc.) or a geometrical one (isolated points, curves, surfaces).
o Property OptionalRelation() As (Read Only)
Returns the relation that can be used to compute the parameter. As this relation might not exist, NULL may be returned, so a test is required.
Example:
This example checks if there is a relation to compute the param1 parameter, and if no relation exists, displays a message box:
 Set param1_rel = param1.OptionalRelation
 If param1_rel is Nothing Then
      MsgBox "No relation to compute param1"
 End If
 
o Property ReadOnly() As (Read Only)
Returns whether the parameter can be modified.
Example:
This example checks if the param1 parameter can be modified, and if it cannot, displays a message box:
 If ( param1.ReadOnly ) Then
      MsgBox "No way to change param1"
 End If
 
o Property Renamed() As (Read Only)
Returns a boolean saying if the parameter is a renamed parameter or not.
o Property UserAccessMode() As (Read Only)
Returns the user access mode of the parameter.
0
Read only parameter (cannot be destroyed).
1
Read/write parameter (cannot be destroyed).
2
User parameter (can be read, written and destroyed).

Methods


o Sub Rename( iName)
Renames the parameter.
Parameters:
iName
The new name of the parameter. If iName contains "Local:" prefix the rename will affect the local name. If not, it will affect the global name.
Example:
This example renames the param1 parameter to PartSeatbodyMinimumThickness:
 Call param1.Rename("PartSeatbodyMinimumThickness")
 
o Sub ValuateFromString( iValue)
Valuates a parameter using a string as input. The string depends on parameter nature :

"True" or "False" for Boolean

a numerical value for Integer or Real

a numerical value with or without a unit for Dimension

Parameters:
iValue
The value to assign to the dimension parameter
Example:
This example sets the value of the existing dimension parameter to a new value:
 dimension.ValuateFromString("300mm");
 
o Func ValueAsString() As
Returns the value of the parameter as a string.

Example:
This example gets the value of the existing dimension parameter and shows it in a message box
 Dim str
 str = dimension.ValueAsString;
 MessageBox str
 

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