============================= ParameterManager (hwx.common) ============================= 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. -------------- Public Methods -------------- +----------------------------------------------------------------+ | add_ (self, name, type, expression, comment='') | +----------------------------------------------------------------+ | clear_ (self) | +----------------------------------------------------------------+ | exportToFile_ (self, file) | +----------------------------------------------------------------+ | get_ (self, name) | +----------------------------------------------------------------+ | importFile_ (self, file) | +----------------------------------------------------------------+ | remove_ (self, name) | +----------------------------------------------------------------+ | rename_ (self, oldName, newName) | +----------------------------------------------------------------+ | update_ (self, name, type=None, expression=None, comment=None) | +----------------------------------------------------------------+ -------------- Method Details -------------- .. _add: .. method:: add(self, name, type, expression, comment='') Creates a new Variable. :param name: Name of the variable. :type name: str :param type: Specifies the type of Variable. It can be: Length, Angle, String and Unitless. :type type: UnitType :param expression: Value of the variable on basis of the type. :type expression: str, float :param comment: User added comments for the variable. :type comment: str .. _clear: .. method:: clear(self) Clears all the variables. .. _exportToFile: .. method:: exportToFile(self, file) Exports all the variable into a csv file. :param file: Csv file path to export all the variables. :type file: str .. _get: .. method:: get(self, name) Returns a variable by the specified name. :param name: Name of the variable to return. :type name: str :returns: The found variable. :rtype: Variable .. _importFile: .. method:: importFile(self, file) Imports variables from a specified csv file. :param file: Csv file to import. :type file: str .. _remove: .. method:: remove(self, name) Removes a variable by its specified name. :param name: Name of the variable. :type name: str .. _rename: .. method:: rename(self, oldName, newName) Renames the variable from the specified old name to new name. :param oldName: The old variable name. :type oldName: str :param newName: The new variable name. :type newName: str .. _update: .. method:: update(self, name, type=None, expression=None, comment=None) Updates the variable from the specified variable name. :param name: Name of the variable. :type name: str :param type: Specifies the type of Variable. It can be: Length, Angle, String and Unitless. :type type: UnitType :param expression: Value of the variable on basis of the type. :type expression: str, float :param comment: User added comments for the variable. :type comment: str