Salome HOME
efd7849bad01508e9b21fec8c7f3a320bc65dd84
[modules/shaper.git] / src / ParametersPlugin / doc / parameterFeature.rst
1 .. _parameter:
2 .. |expression.icon|    image:: images/expression.png
3
4 Create parameter
5 ================
6
7 The parameter can be defined in form *variable=expression*.
8
9 To create a parameter in the active partset or part:
10
11 #. select in the Main Menu *Part - > Parameter* item or
12 #. click |expression.icon| **Parameter** button in the toolbar:
13
14
15 The following property panel appears.
16    
17 .. image:: images/parameter.png
18    :align: center
19
20 .. centered::
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 .. image:: images/object_browser_parameter.png
52    :align: center
53
54 .. centered::
55    **Parameter** in object browser