ParameterManager (hwx.common.parameterManager.ParameterManager)#
- class ParameterManager#
Bases:
object
Defines a variable for the use in sketching and geometric tools.
Variables can be created, updated or deleted from the model. It is accessible like a dict.
Attribute Table# Name
Type
onAboutToExport
Signal
onAboutToImport
Signal
preparse_conversions
dict
unitsManager
Method Table# Name
Description
add
(self, name, type, expression, comment=’’, allvalues=None, displayVal=None)Creates a new Variable.
clear
(self)Clears all variables and list variables.
exportToFile
(self, file)Exports all the variable into a csv file.
get
(self, name)Returns a variable or list variable by the specified name.
importFile
(self, file)Imports variables from a specified csv file.
isImporting
(self)Variables are importing from a specified csv file.
isListVariableType
(self, type) -> boolremove
(self, name)Removes a variable or list variable by its specified name.
rename
(self, oldName, newName)Renames the variable or list variable from the specified old name to new name.
update
(self, name, type=None, expression=None, comment=None)Updates the variable from the specified variable name.
- get(name)#
Returns a variable or list variable by the specified name.
- Parameters:
name (str) – Name of the variable or list variable to return.
- Returns:
The found variable. ListVariable : The found list variable.
- Return type:
Variable
- add(name, type, expression, comment='', allvalues=None, displayVal=None)#
Creates a new Variable.
- Parameters:
name (str) – Name of the variable or ListVariable.
type (str | None) – Specifies the type of Variable or ListVariable. A Variable can be: Length, Angle, String and Unitless. A ListVariable can be: Material. None value can be passed, if type is not defined.
expression (str, float) – Value of the variable on basis of the type. For ListVariable, it can be a list of checked values. The display value is chosen as the first value in the list.
comment (str) – User added comments for the variable or list variable.
- update(name, type=None, expression=None, comment=None)#
Updates the variable from the specified variable name.
- Parameters:
name (str) – Name of the variable or list variable.
type (str) – Specifies the type of Variable or ListVariable. A Variable can be: Length, Angle, String and Unitless. A ListVariable can be: Material.
expression (str, float) – Value of the variable on basis of the type. ListVariable: List of checked values or display value depending on the expression.
comment (str) – User added comments for the variable or list variable.
- rename(oldName, newName)#
Renames the variable or list variable from the specified old name to new name.
- Parameters:
oldName (str) – The old variable name.
newName (str) – The new variable name.
- remove(name)#
Removes a variable or list variable by its specified name.
- Parameters:
name (str) – Name of the variable or list variable.
- clear()#
Clears all variables and list variables.
- importFile(file)#
Imports variables from a specified csv file.
- Parameters:
file (str) – Csv file to import.
- exportToFile(file)#
Exports all the variable into a csv file.
- Parameters:
file (str) – Csv file path to export all the variables.
- isImporting()#
Variables are importing from a specified csv file.
Note: This is True only when the importing process is in progress, after it is finished it becomes False