Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 38 ยท Drawing Commands

The LINE Command and Direct Distance Entry

Draw lines in AutoCAD with the LINE command: points, relative and polar entry, direct distance entry, Close and Undo options, Continue, Construction lines and rays, with worked examples.

LINE is the first command everyone learns and the one you will use for the rest of your career. A line is the simplest entity, two points, yet there is a lot of craft in drawing lines quickly and exactly. This lesson shows each way of drawing lines, how the options work, and how to avoid common traps such as lines that look joined but are not.

Starting LINE

Click Home > Draw > Line, or type L and Enter. The prompts are:

TEXT
Specify first point:
Specify next point or [Undo]:
Specify next point or [Undo]:      (after the second segment)
Specify next point or [Close/Undo]:

Each pair of consecutive points creates a separate line object, even though you drew them in one command. (A polyline, covered in Polylines and Splines, makes one connected object instead.) Press Enter or Esc to finish.

Ways to give each point

You can supply a point in several ways, and mix them in one command:

  1. Click with object snap on existing geometry (endpoint, midpoint, ...).
  2. Absolute coordinates: 100,50.
  3. Relative coordinates: @30,0 for 30 right.
  4. Polar: @45<30.
  5. Direct distance: move the cursor (with Ortho or Polar) and type 45.

Example: draw a 3 m by 2 m rectangle starting at the origin using direct distance entry: L, 0,0, cursor right, 3000, cursor up, 2000, cursor left, 3000, then C. The last C joins to the start and ends the command.

The Close and Undo options

  • Close (C) adds a line from the last point to the first and ends the command (it is only offered after at least two segments).
  • Undo (U) removes the last segment and lets you continue from the previous point. Repeating U steps back further.

Continuing from a previous line or arc

Start LINE and press Enter at the first-point prompt: AutoCAD begins at the end of the most recent line or arc. If the last object was an arc, the new line starts tangent to it (a smooth transition); the same trick works the other way when you begin ARC and press Enter.

Lines at an exact angle and length

Combine a snap and polar entry: L, snap to an endpoint, then type @120<135 to draw a line 120 long at 135 degrees. For an angle measured from an existing line, run the line then use ROTATE or use a polar tracking additional angle.

Perpendicular, tangent and parallel lines

Object snap overrides do geometry for you:

  • Type PER at the second-point prompt and hover a line: the new line ends at its foot of perpendicular.
  • Type TAN to end on a tangent point of a circle or arc; with TAN on both points you draw a common tangent between two circles.
  • PAR (Parallel) lets you draw parallel to an existing line: hover over it until the parallel marker shows, then move.

Construction helpers: XLINE and RAY

XLINE (Construction Line) draws an infinite line; RAY draws one starting at a point and running to infinity. They are guide objects for projecting alignments: for example XLINE, H draws a horizontal infinite line through a pick point, and B bisects an angle. You trim them or place them on a non-plotting layer (such as Defpoints-style or a "Construction" layer you set not to print), so they do not clutter plots. Use them sparingly; modern tracking often replaces them.

Gaps, overlaps and "almost joined" lines

If two lines look touching but you used no snap, there may be a micro gap. Symptoms: hatch will not fill, OFFSET of a joined shape fails, PEDIT Join does nothing. Prevention: use endpoint snaps; to inspect, use LIST or DIST; to fix, use FILLET with radius 0, or EXTEND/TRIM.

Stand-in: draw with direct distance entry

AutoCAD has the distances you type and a cursor direction (determined by Polar/Ortho). This stand-in builds a chain of lines from direction and distance, closes the shape and reports the closing error (should be zero for a good rectangle).

Python Stand-in: a chain of LINE segments from direct distances

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Four separate objects were created even though one command drew them, exactly as in AutoCAD.

Stand-in: finding a gap

This checker looks for segment endpoints that are almost, but not exactly, equal. It is the same kind of tolerance test CAD uses to decide whether lines join.

Python Stand-in: detect nearly-touching endpoints

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Tips for speed

  • Turn on Dynamic Input, Polar Tracking (90 degrees) and a small running snap set.
  • Keep one hand on the Enter key for the last point and Close.
  • Use direct distance for rectilinear shapes; use @dist<angle for the rest.
  • Prefer a rectangle or polyline when you need one object; LINE is for individual segments.

Common mistakes

  • Expecting LINE shapes to be a single object. Selecting one side selects only that segment.
  • Not closing with C, leaving the start corner as two overlapping endpoints rather than a join.
  • Drawing in the wrong direction because Polar/Ortho was off.
  • Typing a distance with the cursor in the wrong direction: the sign of a direct distance does not reverse direction; move the cursor instead.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. After drawing four connected lines with one LINE command, how many objects exist?

    LINE creates one object per segment. Use PLINE or RECTANG for a single connected object.
  2. 2. Pressing Enter at the first-point prompt of LINE does what?

    It continues from the previous line or arc end, tangent if the last object was an arc.
  3. 3. Which object snap override ends a line at a right angle to another line?

    PER finds the foot of the perpendicular on the picked object.
  4. 4. Why might a hatch refuse to fill a shape drawn with lines?

    A micro gap leaves the boundary open, so the hatch cannot find a closed area.

Summary

  • LINE makes separate two-point objects; Close and Undo manage the sequence.
  • Points can be snapped, absolute, relative, polar or given by direct distance.
  • Enter at the first prompt continues from the last line or arc.
  • Object snap overrides PER, TAN and PAR do geometry for you.
  • XLINE and RAY are infinite construction helpers; keep them off the plot.

Next: Circles, Arcs and Ellipses