How do I draw a line outwards from the exact middle of a rectangle's edge, and combine the paths in Inkscape?


I want to draw this shape in Inkscape:

enter image description here

The line coming from the side needs to be aligned to exactly the middle of the edge, coming out at a right angle.

It must also be part of the rectangle object, so that when I alter the color or width of the line, I don't have to do it separately for either object (the line and the rectangle).

What is the simplest way of drawing a line outwards from the centre of a rectangles edge, and then combining the paths, in Inkscape?

5/9/2014 11:21:00 PM

Accepted Answer

Align and distribute

  1. Draw a stroke and a box in random order

    enter image description here

  2. Select stroke to make it horizontal by adjusting its height to 0 in the top toolbar

    enter image description here

  3. Adjust stroke style width (Object > Fill and Strike) to desired values

    enter image description here

  4. Choose Object > Align and Distribute tool

    • relative to biggest object (or first selected depending on workflow)
    • align right edges of the object to left edges of the anchor
    • align center on the horizontal axis

    enter image description here

    enter image description here

  5. Select both the line and the box to then choose Object > Group Ctrl D

  6. Now changing fill or stroke of this group will affect all children

    enter image description here

5/10/2014 5:54:00 AM