IVariables¶
- class IVariables¶
Bases:
ImpactCOMWrapperBase,Iterable- Description:
A collection of IVariable objects.
Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance
- property count¶
Gets Count.
- Description:
The number of variables in the collection.
- Returns:
The value of Count.
- Return type:
count (int)
- add(name, group, value, variable_type)¶
- Description:
Creates a new variable.
- Remarks:
If a variable already exists with the name specified by the ‘Name’ parameter then a variable will NOT be created.
- Returns:
If a variable was successfully created an IVariable object is returned representing the new variable, otherwise this method returns NULL.
- Parameters:
name (str) – The name of the new variable. This cannot be an empty string or contain any spaces.
group (str) – The group to add the variable to. If the group doesn’t exist it will be created. If no group is specified then the ‘Default’ group will be used.
value (any) – The value of the new variable.
variable_type (ipVariableType) – The type of the variable create.
- delete(name)¶
- Description:
Deletes a variable with a specified name.
- Returns:
Indicates whether the deletion was successful.
- Parameters:
name (str) – The name of the variable to delete.
- delete_all()¶
- Description:
Deletes all variables in the collection.
- Remarks:
Introduced in Impact 12.0.0.157
- Returns:
Indicates whether the deletion was successful.
- delete_all_except_material_variables()¶
- Description:
Deletes all variables in the collection except those associates with a standard material.
- Remarks:
Introduced in Impact 12.0.0.157
- Returns:
Indicates whether the deletion was successful.
- item(index)¶
- Description:
Gets a variable with a specified name or index.
- Parameters:
index (any) – The name or index of the variable to get.
- recalculate()¶
- Description:
Recalculate the values of all variables and their dependant variables.
- Remarks:
This method ensures all dependant variables whose values are based on formulas containing other variables are recalculated. Dependant variables are not normally recalculated after a variable is modified, calling this method ensures they are. You can modify multiple variables before calling this method.