Create a Straight Line in Illustrator CC
A basic function of Adobe Illustrator CC’s Pen tool is to create a simple path. You can create a simple, straight line with the Pen tool by following these steps:
Press D or click the small black-and-white color swatches at the bottom of the Tools panel.
You revert to the default colors of a black stroke and a white fill. With black as a stroke, you can see your path clearly.
The trick of pressing D to change the foreground and background colors to the default of black and white also works in Photoshop and InDesign.
Click the Fill swatch, at the bottom of the Tools panel, to ensure that the Fill swatch is in front of the Stroke swatch, and then press the forward slash (/) key to change the fill to None.
Open a new blank page and select the Pen tool.
Notice that when you move the mouse over the artboard, the Pen cursor appears with an X beside it, indicating that you’re creating the first anchor point of a path.
Click the artboard to create the first anchor point of a line.
The X disappears.
Avoid dragging the mouse or you’ll end up creating a curve rather than a straight segment.
Click anywhere else on the document to create the ending anchor point of the line.
Illustrator creates a path between the two anchor points. Essentially, the path looks like a line segment with an anchor point at each end. (See the figure.)A path connected by two anchor points.