Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / ParametersPlugin / doc / parameterFeature.rst
1 .. _parameter:
2
3 Create parameter
4 ================
5
6 The parameter can be defined in form *variable=expression*.
7
8 To create a parameter in the active partset or part:
9
10 #. select in the Main Menu *Part - > Parameter* item or
11 #. click **Parameter** button in the toolbar:
12
13 .. image:: images/expression.png
14    :align: center
15
16 .. centered::
17    **Parameter** button
18
19 The following property panel appears.
20    
21 .. image:: images/parameter.png
22    :align: center
23
24 .. centered::
25    Parameter property panel
26
27 **Input fields**:
28
29 - .. image:: images/expression.png
30       :align: left
31   defines parameter name following the naming rules of the python language for variables;
32
33 - 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.
34
35 - **Comment** contains any text. This field is optional.
36
37
38 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.
39
40 **TUI Command**: *model.addParameter(Part_doc, Name, Value, Comment)*
41
42 **Arguments**:  1 Part + 1 string + 1 value + 1 string
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