pycatia.knowledge_interfaces.parameters

Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445

Warning

The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.

class pycatia.knowledge_interfaces.parameters.Parameters(com_object)

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)

System.IUnknown
System.IDispatch
System.CATBaseUnknown
System.CATBaseDispatch
System.Collection
Parameters

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
all_parameters()
Returns:

list(Parameter())

create_boolean(i_name: str, i_value: bool) BoolParam

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func CreateBoolean(CATBSTR iName,
boolean iValue) As BoolParam

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)
Parameters:
  • i_name (str) –

  • i_value (bool) –

Return type:

BoolParam

create_dimension(i_name: str, i_magnitude: str, i_value: float) Dimension

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func CreateDimension(CATBSTR iName,
CATBSTR iMagnitude,
double iValue) As Dimension

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”);

The documentation from the CHM file is incomplete here as many more magnitude types are available. For example: TIME, MASS, VOLUME, DENSITY, AREA … If you need to find the magnitude value for the dimension type you wish to create use the macro recorder and manually create the parameter. The macro script generated will reveal the magnitude value required.

Parameters:
  • i_name (str) –

  • i_magnitude (str) –

  • i_value (float) –

Return type:

Dimension

create_integer(i_name: str, i_value: int) IntParam

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func CreateInteger(CATBSTR iName,
long iValue) As IntParam

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)
Parameters:
  • i_name (str) –

  • i_value (int) –

Return type:

IntParam

create_list(i_name: str) ListParameter

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func CreateList(CATBSTR iName) As ListParameter

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”)
Parameters:

i_name (str) –

Return type:

ListParameter

create_real(i_name: str, i_value: float) RealParam

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func CreateReal(CATBSTR iName,
double iValue) As RealParam

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 )
Parameters:
  • i_name (str) –

  • i_value (float) –

Return type:

RealParam

create_set_of_parameters(i_father: AnyObject) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub CreateSetOfParameters(AnyObject iFather)

Creates a set of parameters and appends it to argument iFather.
Parameters:

i_father (AnyObject) –

Return type:

None

create_string(i_name: str, i_value: str) StrParam

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func CreateString(CATBSTR iName,
CATBSTR iValue) As StrParam

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”)
Parameters:
  • i_name (str) –

  • i_value (str) –

Return type:

StrParam

get_name_to_use_in_relation(i_object: AnyObject) str

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func GetNameToUseInRelation(AnyObject iObject) As CATBSTR

Returns a correct name of a feature to use it in a relation.
Parameters:

i_object (AnyObject) –

Return type:

str

has_parameters()
Returns:

bool

is_list_parameter(index: cat_variant)
Parameters:

index (cat_variant) – parameter name or parameter number

Returns:

bool

Return type:

bool

is_parameter(index: cat_variant)
Parameters:

index (cat_variant) – parameter name or parameter number

Return type:

bool

item(index: cat_variant) any_parameter

Note

CAA V5 Visual Basic help
Item
o Func Item( CATVariant iIndex) As Parameter

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 numeric, 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

activateLinkAnchor(‘AnyObject’,’Name’,’AnyObject.Name’) property or when
creating the parameter.
Examples:
This example retrieves the last parameter in the parameters
collection:

Set lastParameter = parameters.Item(parameters.Count)
Parameters:

index (cat_variant) –

Return type:

any_parameter

remove(i_index: cat_variant) None

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Sub Remove(CATVariant 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”)
Parameters:

i_index (cat_variant) –

Return type:

None

property root_parameter_set: ParameterSet

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property RootParameterSet() As ParameterSet (Read Only)

Returns the root parameter set of a document. If it doesn’t exist, it is
created.
Return type:

ParameterSet

sub_list(i_object: AnyObject, i_recursively: bool) Parameters

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445))
o Func SubList(AnyObject iObject,
boolean iRecursively) As Parameters

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
Parameters:
  • i_object (AnyObject) –

  • i_recursively (bool) –

Return type:

Parameters

property units: Units

Note

CAA V5 Visual Basic Help (2020-06-11 12:40:47.360445)
o Property Units() As Units (Read Only)

Returns the collection of units.
Return type:

Units