Indexes   

Parameters (Collection)

Represents the Parameters collection of the part or the product.
The following example shows how to retrieve it:
	Dim CATDocs As Documents
 Set CATDocs = CATIA.Documents
 Dim part1 As Document
 Set part1   = CATDocs.Add("CATPart")
 Dim parameterList As Parameters
  Set parameterList = part1.Part.Parameters
  

Property Index

RootParameterSet
Returns the root parameter set of a document.
Units
Returns the collection of units.

Method Index

CreateBoolean
Creates a boolean parameter and adds it to the part's collection of parameters.
CreateDimension
Creates a user dimension and adds it to the part's collection of parameters.
CreateInteger
Creates an integer parameter and adds it to the part's collection of parameters.
CreateList
Creates a list parameter and adds it to the part's collection of parameters.
CreateReal
Creates a real parameter and adds it to the part's collection of parameters.
CreateSetOfParameters
Creates a set of parameters and appends it to argument iFather.
CreateString
Creates a string parameter and adds it to the part's collection of parameters.
GetNameToUseInRelation
Returns a correct name of a feature to use it in a relation.
Item
Retrieves a parameter using its index or its name from the from the Parameters collection.
Remove
Removes a parameter from the Parameters collection.
SubList
Returns a sub-collection of parameters aggregated to an object.

Properties


o Property RootParameterSet() As (Read Only)
Returns the root parameter set of a document. If it doesn't exist, it is created.
o Property Units() As (Read Only)
Returns the collection of units.

Methods


o Func CreateBoolean( iName,
iValue) As
Creates a boolean parameter and adds it to the part's collection of parameters.
Parameters:
iName
The parameter name
iValue
The parameter value
Example:
This example creates the checked boolean parameter and adds it to the newly created part:
	Dim CATDocs As Documents
 Set CATDocs = CATIA.Documents
 Dim part1 As Document
 Set part1   = CATDocs.Add("CATPart")
 Dim chk As BooleanParam
  Set chk = part1.Part.Parameters.CreateBoolean ("checked", False)
 
o Func CreateDimension( iName,
iMagnitude,
iValue) As
Creates a user dimension and adds it to the part's collection of parameters.
Parameters:
iName
The dimension name
iMagnitude
The dimension magnitude. Units are those of the IS system. Valid magnitudes are:
  • "LENGTH": the unit is the meter.
  • "ANGLE": the unit is the radian.
The
Dimension object provides the Dimension.ValuateFromString method with which you may express the value in any unit for a given dimension (see the example below).
iValue
The dimension value provided as a real number
Example:
This example creates a LENGTH dimension and adds it to the newly created part. The initial value is expressed in meters. The new value is expressed in millimeters.
 Dim depth As Dimension
 Set depth = parameters.CreateDimension("depth", "LENGTH", 20)
 depth.ValuateFromString("300mm");
 
o Func CreateInteger( iName,
iValue) As
Creates an integer parameter and adds it to the part's collection of parameters.
Parameters:
iName
The parameter name
iValue
The parameter value
Example:
This example creates the RevisionNumber integer parameter and adds it to the newly created part:
	Dim CATDocs As Documents
 Set CATDocs = CATIA.Documents
 Dim part1 As Document
 Set part1   = CATDocs.Add("CATPart")
 Dim revision As IntParam
  Set revision = part1.Part.Parameters.CreateInteger ("RevisionRumber", 17)
 
o Func CreateList( iName) As
Creates a list parameter and adds it to the part's collection of parameters.
Parameters:
iName
The parameter name
Example:
This example creates the ListName list parameter and adds it to the newly created part:
  Set CATDocs = CATIA.Documents
  Set part1   = CATDocs.Add("CATPart")
  Set list1 = part1.Part.Parameters.CreateList ("ListName")
 
o Func CreateReal( iName,
iValue) As
Creates a real parameter and adds it to the part's collection of parameters.
Parameters:
iName
The parameter name
iValue
The parameter value
Example:
This example creates the ReliabilityRate real parameter and adds it to the newly created part:
	Dim CATDocs As Documents
 Set CATDocs = CATIA.Documents
 Dim part1 As Document
 Set part1   = CATDocs.Add("CATPart")
 Dim rate As RealParam
  Set rate = part1.Part.Parameters.CreateReal ("ReliabilityRate", 2.5 )
 
o Sub CreateSetOfParameters( iFather)
Creates a set of parameters and appends it to argument iFather.
o Func CreateString( iName,
iValue) As
Creates a string parameter and adds it to the part's collection of parameters.
Parameters:
iName
The parameter name
iValue
The parameter value
Example:
This example creates the responsible string parameter and adds it to the newly created part:
  Set CATDocs = CATIA.Documents
  Set part1   = CATDocs.Add("CATPart")
  Set density = part1.Part.Parameters.CreateString ("responsible", "The Boss")
 
o Func GetNameToUseInRelation( iObject) As
Returns a correct name of a feature to use it in a relation.
o Func Item( iIndex) As
Retrieves a parameter using its index or its name from the from the Parameters collection.
Parameters:
iIndex
The index or the name of the parameter to retrieve from the collection of parameters. As a numerics, this index is the rank of the parameter in the collection. The index of the first parameter in the collection is 1, and the index of the last parameter is Count. As a string, it is the name you assigned to the parameter using the
AnyObject.Name property or when creating the parameter.
Example:
This example retrieves the last parameter in the parameters collection:
 Set lastParameter = parameters.Item(parameters.Count)
 
o Sub Remove( iIndex)
Removes a parameter from the Parameters collection.
Parameters:
iIndex
The index or the name of the parameter to remove from the collection of parameters. As a numerics, this index is the rank of the parameter in the collection. The index of the first parameter in the collection is 1, and the index of the last parameter is Count. As a string, it is the name you assigned to the parameter using the
AnyObject.Name property or when creating the parameter.
Example:
This example removes the "depth" parameter from the parameters collection.
 parameters.Remove("depth")
 
o Func SubList( iObject,
iRecursively) As
Returns a sub-collection of parameters aggregated to an object.
Parameters:
iObject
The object used to filter the whole parameter collection to get the resulting sub-collection.
iRecursively
A flag to specify if children parameters are to be searched for in the returned collection
Example:
This example shows how to retrieve a collection of parameters that are associated to a Pad.
 Dim Parameters1 As Parameters
 Set Parameters1 = CATIA.ActiveDocument.Part.Parameters gets the collection of parameters in the part
 Dim Body0 As AnyObject
 Set Body0 = CATIA.ActiveDocument.Part.Bodies.Item  ( "MechanicalTool.1" ) 
 Dim Pad1 As AnyObject
 Set Pad1 = Body0.Shapes.Item  ( "Pad.1" ) gets the pad Pad.1
 Dim Parameters2 As Parameters
 Set Parameters2 = Parameters1.SubList(Pad1,TRUE) gets the collection of parameters that are under the pad Pad.1
 

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