Salome HOME
Documentation: use 'figure' instead of 'image'; improve caption layout; fix warnings.
[modules/shaper.git] / src / ParametersPlugin / doc / parameterFeature.rst
1 .. |expression.icon|    image:: images/expression.png
2
3 .. _parameter:
4
5 Create parameter
6 ================
7
8 The parameter can be defined in form *variable=expression*.
9
10 To create a parameter in the active partset or part:
11
12 #. select in the Main Menu *Part - > Parameter* item or
13 #. click |expression.icon| **Parameter** button in the toolbar:
14
15
16 The following property panel appears.
17    
18 .. figure:: images/parameter.png
19    :align: center
20
21    Parameter property panel
22
23 **Input fields**:
24
25 - |expression.icon| defines parameter name following the naming rules of the python language for variables;
26
27 - 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.
28
29 - **Comment** contains any text. This field is optional.
30
31
32 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.
33
34 **TUI Command**:
35
36 .. py:function:: model.addParameter(Part_doc, Name, Value, Comment)
37
38     :param part: The current part object
39     :param string: The parameter name
40     :param number: The parameter value
41     :param string: The parameter comment
42     :return: Created object.
43
44 **See Also** a sample TUI Script of a :ref:`tui_parameterFeature` operation.
45
46 Result
47 ------
48
49 The created parameter and its current value are displayed in the Object Browser, in a special section **Parameters**. 
50
51 .. figure:: images/object_browser_parameter.png
52    :align: center
53
54    **Parameter** in object browser