1 .. _create_sketch_rectangle:
6 .. |rectangle.icon| image:: images/Rectangle.png
8 Rectangle feature creates a rectangle by two opposite points in the current Sketch.
10 The result is represented in form of four Lines which compose a rectangle.
11 Two lines have Vertical constraint and two others have Horizontal constraint.
13 To add a new Rectangle to the Sketch:
15 #. select in the Main Menu *Sketch - > Rectangle* item or
16 #. click |rectangle.icon| **Rectangle** button in Sketch toolbar:
18 There are 2 algorithms for creation of a Rectangle:
20 .. figure:: images/rectangle_start_end.png
24 **By start and end points** creates a rectangle with the given two corners points.
26 .. figure:: images/rectangle_center_end.png
30 **By center and end point** creates a rectangle with center and end point as corner.
32 -------------------------------------------------------------------------------------------
34 By start and end points
35 """"""""""""""""""""""""""
37 .. figure:: images/Rectangle_start_end_panel.png
42 Click in the view once to set the first corner, then move the mouse and click a second time to set the opposite corner.
43 If an existing object is clicked, a constraint for the point will be created automatically.
45 Start and end points coordinates are displayed in the property panel.
49 .. py:function:: Sketch_1.addRectangle(X1, Y1, X2, Y2)
51 :param real: X1 corner X value.
52 :param real: Y1 corner Y value.
53 :param real: X2 opposite corner X value.
54 :param real: Y2 opposite corner Y value.
55 :return: Result object.
57 By center and end point
58 """"""""""""""""""""""""""
60 .. figure:: images/Rectangle_center_end_panel.png
65 Click in the view once to set the center, then move the mouse and click a second time to set the corner.
66 If an existing object is clicked, a constraint for the point will be created automatically.
68 Center and end points coordinates are displayed in the property panel.
72 .. py:function:: Sketch_1.addRectangleCentered(X1, Y1, X2, Y2)
74 :param real: X1 center X value.
75 :param real: Y1 center Y value.
76 :param real: X2 corner X value.
77 :param real: Y2 corner Y value.
78 :return: Result object.
83 Created rectangle appears in the view.
85 .. figure:: images/Rectangle_res2.png
90 **See Also** a sample TUI Script of :ref:`tui_create_rectangle` operation.