
Sketching lines
To illustrate how to sketch lines, we will sketch the following shape. Note that the sketch is fully defined, and so SOLIDWORKS will show it filled in with black after it's been sketched. Also, take note of the relations and dimensions shown in the following image; the dimensions are in millimeters:

Let's go ahead and start constructing the shown sketch. To do that, we will go through two stages: outlining and defining.
In the outlining stage, our aim will be to draw a rough outline of the final shape. Here, we will not pay much attention to dimensions or relations. We will follow these steps in the outlining stage:
- Start a new part file.
- Set the document's measurement system to MMGS (millimeter, gram, second) if it isn't already.
- Navigate to the Sketch mode using the Top Plane.
- Select the Line sketch command, move the mouse cursor into the canvas, and click on the origin. To start drawing the triangle, move your cursor to the right and, once the line is drawn, left-click on your mouse. Note that the shape of the cursor will change into a pen.
- Next, move the mouse more upward to create the second line, and then left-click on the mouse again.
- Move the cursor again to draw a line linking back to the origin. This concludes the creation of a shape that looks like a triangle, as shown in the following image:

- Now, we can draw the last line, which links the origin point to any point on the vertical line so that we end up with the following image. Note that the sketch on the screen is blue, indicating that it is under defined.
- Exit the Line sketching command by pressing Esc on the keyboard:

In the defining stage, we will work on defining our outline with the necessary dimensions and relations to fully define our sketch. Note that some of the relations are set automatically by SOLIDWORKS, according to how we place our lines. Follow these steps for the defining stage:
- Click on line 1, as indicated by the preceding sketch.
- A new panel will appear on the left, in place of the design tree. It will be titled Line Properties, as shown in the following screenshot. Under Add Relations, click on Horizontal. This will add a horizontal relation to the line. You will see a small icon appear next to the line, showing that the line is horizontal:

- Click on line 2 and add a Vertical relation.
- Press and hold down Ctrl on your keyboard, click on the endpoint of line 4, which is located at line 2, and then click on line 2. From the properties that appear on the left, select the Midpoint relation.
- On the command bar, select the Smart Dimension command, as shown in the following screenshot:

- Go back to the canvas and click on line 1. A dimension will appear, displaying the current length of the line. Left-click on an empty space in the canvas once more. You will be prompted to enter a length value for the line. Type in the value 30 and then click on the green checkmark, as shown in the following screenshot. After that, you will notice that the line's length changes to match the new length. Also, note that the line, including its endpoints, turns black:

- Click on line 1 again, and then click on line 4. Note that the specified dimension changed to the angle between the two lines, which is the dimension we want to specify. Left-click anywhere on the canvas once more to confirm the dimension's location. In the box, type 25, which indicates the degree, and then click the green checkmark.
- Exit the smart dimension mode by pressing Esc on the keyboard or clicking on the Smart Dimension command on the command bar.
At this point, we will see that the sketch is fully black, indicating that it is fully defined. This concludes our first sketching exercise. In this simple exercise, we have covered many essential sketching features that we'll keep using when we model with SOLIDWORKS throughout this book, including the following:
- How to start sketching
- How to sketch lines
- How to set up lengths and angles using smart dimensions
- How to set up geometric relations such as vertical, horizontal, and midpoint
These sketching commands are essential to sketching using SOLIDWORKS sketching tools. In the next section, we will use these skills to sketch rectangles and squares.