From: gzy Date: Thu, 20 Sep 2018 13:30:32 +0000 (+0300) Subject: corrections to Python addons X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c8679411467bdf826ed18fe4765abdbab381f3f6;p=modules%2Fshaper.git corrections to Python addons --- diff --git a/src/PythonAddons/doc/addons_Features.rst b/src/PythonAddons/doc/addons_Features.rst index fe87c8a1c..26ba489c2 100644 --- a/src/PythonAddons/doc/addons_Features.rst +++ b/src/PythonAddons/doc/addons_Features.rst @@ -4,14 +4,14 @@ Python addons User can create his own custom features. -Corresponding folder should be created for each feature at ..\sources\src\PythonAddons\macros\. +Corresponding folder should be created for each feature at *../sources/src/PythonAddons/macros*. Feature description includes 4 files: -- widget.xml, +- widget.xml with description of property panel, - __init__.py, -- feature.py, -- icon.png located at sub-folder \icons. +- feature.py with python commands, +- icon.png with image of button in toolbar (file is located at sub-folder /icons). Two examples of custom features already created are: diff --git a/src/PythonAddons/doc/boxFeature.rst b/src/PythonAddons/doc/boxFeature.rst index 354c5422e..0d3674083 100644 --- a/src/PythonAddons/doc/boxFeature.rst +++ b/src/PythonAddons/doc/boxFeature.rst @@ -2,34 +2,25 @@ Box === -Custom feature box is located at ..\sources\src\PythonAddons\macros\box. +Custom files for feature **Box** are: -.. literalinclude:: examples/box/feature.py - :linenos: - :language: python +- empty __init__.py, +- :ref:`create_custom_box_py`, +- :ref:`create_custom_box_xml`, +- icon.png located at sub-folder */icons*. -:download:`Download this script ` - -.. literalinclude:: examples/box/widget.xml - :linenos: - :language: html - -:download:`Download this script ` +.. image:: images/box_ico.png + :align: center -The feature Box creates a box solid by extrusion of rectangle. +.. centered:: + File icon.png -Result in Shaper module is described below. +The custom feature **Box** creates a box solid by extrusion of rectangle. To create a Box in the active part: #. select in the Main Menu *Macros - > Box* item or -#. click **Box** button in the Macros toolbar: - -.. image:: images/box.png - :align: center - -.. centered:: - **Box** button +#. click **Box** button in the Macros toolbar corresponding to file icon.png: The following property panel appears. @@ -41,22 +32,17 @@ The following property panel appears. Input fields: -- **DX**, **DY**, **DZ** sizes of the box along corresponded coordinate axes. The box will be created starting from the origin. +- **Width**, **Length**, **Height** are sizes of the box along corresponding coordinate axes. The box will be created starting from the origin. Result """""" -The Result of operation will be a SOLID. The edges of the box will be parallel to the coordinate axes. - -Name is assigned automatically: - -* **Box_1**, **Box_2**, ... to Feature; -* **Box_1_1**, **Box_2_1**, ... to Result. +The Result of operation will be Extrusion and Sketch. -Example is shown below. +The edges of the box will be parallel to the coordinate axes. .. image:: images/Boxes.png :align: center .. centered:: - Box created + Box created \ No newline at end of file diff --git a/src/PythonAddons/doc/pyFile_boxFeature.rst b/src/PythonAddons/doc/pyFile_boxFeature.rst new file mode 100644 index 000000000..dd2f5fa21 --- /dev/null +++ b/src/PythonAddons/doc/pyFile_boxFeature.rst @@ -0,0 +1,11 @@ + + .. _create_custom_box_py: + +File feature.py +=============== + +.. literalinclude:: examples/box/feature.py + :linenos: + :language: python + +:download:`Download this script ` \ No newline at end of file diff --git a/src/PythonAddons/doc/pyFile_rectangleFeature.rst b/src/PythonAddons/doc/pyFile_rectangleFeature.rst new file mode 100644 index 000000000..bbe2eafdb --- /dev/null +++ b/src/PythonAddons/doc/pyFile_rectangleFeature.rst @@ -0,0 +1,11 @@ + + .. _create_custom_rectangle_py: + +File feature.py +=============== + +.. literalinclude:: examples/rectangle/feature.py + :linenos: + :language: python + +:download:`Download this script ` \ No newline at end of file diff --git a/src/PythonAddons/doc/rectangleFeature.rst b/src/PythonAddons/doc/rectangleFeature.rst index 3148b08e2..98b9247ae 100644 --- a/src/PythonAddons/doc/rectangleFeature.rst +++ b/src/PythonAddons/doc/rectangleFeature.rst @@ -1,3 +1,18 @@ Rectangle ========= + +Custom files for feature **Rectangle** are: + +- empty __init__.py, +- :ref:`create_custom_rectangle_py`, +- :ref:`create_custom_rectangle_xml`, +- icon.png located at sub-folder */icons*. + +.. image:: images/rectangle.png + :align: center + +.. centered:: + File icon.png + +Description of custom feature :ref:`create_sketch_rectangle` is given in Sketch plug-in. \ No newline at end of file diff --git a/src/PythonAddons/doc/xmlFile_boxFeature.rst b/src/PythonAddons/doc/xmlFile_boxFeature.rst new file mode 100644 index 000000000..cd3e5c872 --- /dev/null +++ b/src/PythonAddons/doc/xmlFile_boxFeature.rst @@ -0,0 +1,11 @@ + + .. _create_custom_box_xml: + +File widget.xml +=============== + +.. literalinclude:: examples/box/widget.xml + :linenos: + :language: html + +:download:`Download this script ` \ No newline at end of file diff --git a/src/PythonAddons/doc/xmlFile_rectangleFeature.rst b/src/PythonAddons/doc/xmlFile_rectangleFeature.rst new file mode 100644 index 000000000..1901d9629 --- /dev/null +++ b/src/PythonAddons/doc/xmlFile_rectangleFeature.rst @@ -0,0 +1,11 @@ + + .. _create_custom_rectangle_xml: + +File widget.xml +=============== + +.. literalinclude:: examples/rectangle/widget.xml + :linenos: + :language: html + +:download:`Download this script ` \ No newline at end of file diff --git a/src/SketchPlugin/doc/rectangleFeature.rst b/src/SketchPlugin/doc/rectangleFeature.rst index 5a27626ee..3e90a11d7 100644 --- a/src/SketchPlugin/doc/rectangleFeature.rst +++ b/src/SketchPlugin/doc/rectangleFeature.rst @@ -1,3 +1,4 @@ + .. _create_sketch_rectangle: Rectangle =========