From 918a3d31f5de6b4e01ff0bce10cca5c1cf348b6a Mon Sep 17 00:00:00 2001 From: Alexey Kondratyev Date: Wed, 13 Oct 2021 13:52:11 +0300 Subject: [PATCH] [bos #26444] [EDF] (2021) SHAPER: Improve treatment of parameters Update documentation. --- src/ParametersPlugin/doc/TUI_parameterFeature.rst | 1 + src/ParametersPlugin/doc/examples/File.txt | 3 +++ src/ParametersPlugin/doc/examples/parameter.py | 1 + src/ParametersPlugin/doc/managerFeature.rst | 9 +++++++++ src/ParametersPlugin/doc/parameterFeature.rst | 5 +++++ 5 files changed, 19 insertions(+) create mode 100644 src/ParametersPlugin/doc/examples/File.txt diff --git a/src/ParametersPlugin/doc/TUI_parameterFeature.rst b/src/ParametersPlugin/doc/TUI_parameterFeature.rst index bf120a891..ae2b0cb14 100644 --- a/src/ParametersPlugin/doc/TUI_parameterFeature.rst +++ b/src/ParametersPlugin/doc/TUI_parameterFeature.rst @@ -9,4 +9,5 @@ Create Parameter :language: python :download:`Download this script ` +:download:`Download file for script ` diff --git a/src/ParametersPlugin/doc/examples/File.txt b/src/ParametersPlugin/doc/examples/File.txt new file mode 100644 index 000000000..5f5a7bc97 --- /dev/null +++ b/src/ParametersPlugin/doc/examples/File.txt @@ -0,0 +1,3 @@ +ax 10.0 +bx 15.0 +cx ax+bx \ No newline at end of file diff --git a/src/ParametersPlugin/doc/examples/parameter.py b/src/ParametersPlugin/doc/examples/parameter.py index dc269a6e0..39d6fdb45 100644 --- a/src/ParametersPlugin/doc/examples/parameter.py +++ b/src/ParametersPlugin/doc/examples/parameter.py @@ -3,4 +3,5 @@ from salome.shaper import model model.begin() partSet = model.moduleDocument() model.addParameter(partSet, "angle", "60*3.141/180", "main angle") +model.importParameters(partSet, "File.txt") model.end() diff --git a/src/ParametersPlugin/doc/managerFeature.rst b/src/ParametersPlugin/doc/managerFeature.rst index 8d4c5eb50..fe1ed998d 100644 --- a/src/ParametersPlugin/doc/managerFeature.rst +++ b/src/ParametersPlugin/doc/managerFeature.rst @@ -41,4 +41,13 @@ Sample.txt: | |param_up| one string higher in the table, | |param_down| one string lower in the table. +**TUI Command**: + +.. py:function:: model.importParameters(Part_doc, filename) + + :param part: The current part object + :param filename: The txt file with parameters + :return: Created objects. + +**See Also** a sample TUI Script of a :ref:`tui_parameterFeature` operation. **See Also** :ref:`parameter` operation. diff --git a/src/ParametersPlugin/doc/parameterFeature.rst b/src/ParametersPlugin/doc/parameterFeature.rst index 757a023f0..24e6bc06a 100644 --- a/src/ParametersPlugin/doc/parameterFeature.rst +++ b/src/ParametersPlugin/doc/parameterFeature.rst @@ -41,6 +41,11 @@ The property panel checks validity of the expression. For an invalid expression :param string: The parameter comment :return: Created object. +Write error in Python console if: +- parameter name is empty. +- parameter don't have unique name. +- parameter expression is empty or incorrect. + **See Also** a sample TUI Script of a :ref:`tui_parameterFeature` operation. Result -- 2.39.2