# AutoCAD exercise: a stepped shaft

> Draw a stepped shaft in AutoCAD: half its outline as a polyline, chamfered, mirrored about the axis, and its lengths as chain dimensions. Free, step by step.

Draw this stepped shaft in side view, in millimetres: 150 long, with diameters of 30, 40 and 30 over lengths of 40, 60 and 50, and both ends chamfered 2 by 2. Draw the half above the axis as one polyline, chamfer it and mirror it; then the edges seen across the shaft, the axis and the lengths. The diameters are the ones given here.

- **Exercise:** Intermediate · Mechanical · 2D
- **Commands:** [`PLINE`](https://mellowcad.com/docs/commands/pline.md), [`CHAMFER`](https://mellowcad.com/docs/commands/chamfer.md), [`MIRROR`](https://mellowcad.com/docs/commands/mirror.md), [`LINE`](https://mellowcad.com/docs/commands/line.md), [`DIMLINEAR`](https://mellowcad.com/docs/commands/dimlinear.md), [`DIMCONTINUE`](https://mellowcad.com/docs/commands/dimcontinue.md)
- **In the editor:** [Open it with its drawing](/draw?drawing=shaft), dimensioned beside where you draw yours

## The drawing

A stepped shaft in side view, 150 long, its lengths dimensioned in a chain.

## Step by step

The engine draws each step and writes its history as you would type it: the prompts in AutoCAD 2027's order, with the same option letters. After a command's first point, a typed point is measured from the last one, as dynamic input measures it, and the history writes it with @; \# measures from the origin.

### 1. Draw the upper half

On the Outline layer, one [`PLINE`](https://mellowcad.com/docs/commands/pline.md) from `0,0`: up `0,15`, along `40,0`, up `0,5`, along `60,0`, down `0,-5`, along `50,0` and down `0,-15`, back to the axis. Enter ends it.

1. Draw the upper half

```text
Command: PLINE
Specify start point: 0,0
Current line-width is 0.00
Specify next point or [Arc/Halfwidth/Length/Undo/Width]: @0,15
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: @40,0
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: @0,5
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: @60,0
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: @0,-5
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: @50,0
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: @0,-15
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]:
```

### 2. Chamfer the ends

[`CHAMFER`](https://mellowcad.com/docs/commands/chamfer.md), then `Distance`: `2`, and Enter takes `2` for the second distance too. `Multiple` chamfers one corner after another without starting again: pick the two segments at each end's corner.

2. Chamfer the ends

```text
Command: CHAMFER
(TRIM mode) Current chamfer Dist1 = 0.00, Dist2 = 0.00
Select first line or [Undo/Polyline/Distance/Multiple]: D
Specify first chamfer distance <0.00>: 2
Specify second chamfer distance <2.00>:
Select first line or [Undo/Polyline/Distance/Multiple]: M
Select first line or [Undo/Polyline/Distance/Multiple]:
Select second line or shift-select to apply corner or [Distance]:
Select first line or [Undo/Polyline/Distance/Multiple]:
Select second line or shift-select to apply corner or [Distance]:
Select first line or [Undo/Polyline/Distance/Multiple]:
```

### 3. Mirror it

[`MIRROR`](https://mellowcad.com/docs/commands/mirror.md): pick the polyline, press Enter, then the mirror line from `0,0` to `150,0`, the axis, and Enter to keep the original.

3. Mirror it

```text
Command: MIRROR
Select objects: 1 found
Select objects:
Specify first point of mirror line: 0,0
Specify second point of mirror line: @150,0
Erase source objects? [Yes/No] <No>:
```

### 4. Draw the edges

With [`LINE`](https://mellowcad.com/docs/commands/line.md), the edges seen across the shaft, each `0,30` up from the bottom: from `2,-15` and `148,-15` at the chamfers, and from `40,-15` and `100,-15` at the shoulders.

4. Draw the edges

```text
Command: LINE
Specify first point: 2,-15
Specify next point or [Undo]: @0,30
Specify next point or [Undo]:
Command: LINE
Specify first point: 40,-15
Specify next point or [Undo]: @0,30
Specify next point or [Undo]:
Command: LINE
Specify first point: 100,-15
Specify next point or [Undo]: @0,30
Specify next point or [Undo]:
Command: LINE
Specify first point: 148,-15
Specify next point or [Undo]: @0,30
Specify next point or [Undo]:
```

### 5. Draw the axis

On Centre lines, the axis: a line from `-8,0` to `166,0` further on.

5. Draw the axis

```text
Command: LINE
Specify first point: -8,0
Specify next point or [Undo]: @166,0
Specify next point or [Undo]:
```

### 6. Dimension it

On Dimensions, [`DIMLINEAR`](https://mellowcad.com/docs/commands/dimlinear.md) for the first length, 40, placed below. [`DIMCONTINUE`](https://mellowcad.com/docs/commands/dimcontinue.md) carries on from its second extension line: `#100,-20`, then `#150,-15`, typed from the origin with #, and Enter twice to end it. A last [`DIMLINEAR`](https://mellowcad.com/docs/commands/dimlinear.md) gives the whole length, 150, further below.

6. Dimension it

```text
Command: DIMLINEAR
Specify first extension line origin or <select object>: 0,-13
Specify second extension line origin: @40,-7
Non-associative dimension created.
Specify dimension line location or [Text/Angle/Horizontal/Vertical/Rotated]:
Dimension text = 40
Command: DIMCONTINUE
Specify second extension line origin or [Select/Undo] <Select>: #100,-20
Dimension text = 60
Specify second extension line origin or [Select/Undo] <Select>: #150,-15
Dimension text = 50
Specify second extension line origin or [Select/Undo] <Select>:
Select continued dimension:
Command: DIMLINEAR
Specify first extension line origin or <select object>: 0,-13
Specify second extension line origin: @150,-2
Non-associative dimension created.
Specify dimension line location or [Text/Angle/Horizontal/Vertical/Rotated]:
Dimension text = 150
```

## More exercises

- [AutoCAD isometric exercise: a stepped block](https://mellowcad.com/docs/exercises/isometric-block.md): Intermediate · Mechanical · Isometric
- [AutoCAD 3D exercise: a pulley](https://mellowcad.com/docs/exercises/pulley.md): Intermediate · Mechanical · 3D solid
- [AutoCAD exercise: a link with tangent lines](https://mellowcad.com/docs/exercises/link.md): Advanced · Mechanical · 2D
- [AutoCAD practice exercises](https://mellowcad.com/docs/exercises.md)
