X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParametersPlugin%2Fdoc%2FparameterFeature.rst;h=efd7849bad01508e9b21fec8c7f3a320bc65dd84;hb=918e097c6c3f8e02abf72c74f7a117c3b5adab61;hp=f0c4785c10ff7c179ee968cde59e8ce1f058b2da;hpb=c5ec43297b55923e1cf2ee39978bf42d733ee465;p=modules%2Fshaper.git diff --git a/src/ParametersPlugin/doc/parameterFeature.rst b/src/ParametersPlugin/doc/parameterFeature.rst index f0c4785c1..efd7849ba 100644 --- a/src/ParametersPlugin/doc/parameterFeature.rst +++ b/src/ParametersPlugin/doc/parameterFeature.rst @@ -1,3 +1,55 @@ +.. _parameter: +.. |expression.icon| image:: images/expression.png Create parameter ================ + +The parameter can be defined in form *variable=expression*. + +To create a parameter in the active partset or part: + +#. select in the Main Menu *Part - > Parameter* item or +#. click |expression.icon| **Parameter** button in the toolbar: + + +The following property panel appears. + +.. image:: images/parameter.png + :align: center + +.. centered:: + Parameter property panel + +**Input fields**: + +- |expression.icon| defines parameter name following the naming rules of the python language for variables; + +- panel **Expression** evaluates the expression input manually as a real number by python *eval()* function. In the simplest case an expression is a real number. Some standard python modules (like math) are imported by default before evaluation. + +- **Comment** contains any text. This field is optional. + + +The property panel checks validity of the expression. For an invalid expression **Apply** button is disabled and an error message generated by python interpreter during the evaluation is shown in the status bar and in pop-up of **Apply** button. + +**TUI Command**: + +.. py:function:: model.addParameter(Part_doc, Name, Value, Comment) + + :param part: The current part object + :param string: The parameter name + :param number: The parameter value + :param string: The parameter comment + :return: Created object. + +**See Also** a sample TUI Script of a :ref:`tui_parameterFeature` operation. + +Result +------ + +The created parameter and its current value are displayed in the Object Browser, in a special section **Parameters**. + +.. image:: images/object_browser_parameter.png + :align: center + +.. centered:: + **Parameter** in object browser