# AutoCAD exercise: a flange

> Draw a flange in AutoCAD: a bore with a keyway trimmed into it, eight holes in a polar array, centre lines and diameters, solved step by step. Free online.

Draw this flange, in millimetres: 140 across, a bore of 60 with a keyway 16 wide whose top is 36 from the centre, eight holes of 14 on a pitch circle of 110, and its centre lines. The keyway is a rectangle trimmed into the bore; the holes are one circle and a polar array.

- **Exercise:** Intermediate · Mechanical · 2D
- **Commands:** [`CIRCLE`](https://mellowcad.com/docs/commands/circle.md), [`RECTANG`](https://mellowcad.com/docs/commands/rectang.md), [`TRIM`](https://mellowcad.com/docs/commands/trim.md), [`ARRAYPOLAR`](https://mellowcad.com/docs/commands/arraypolar.md), [`LINE`](https://mellowcad.com/docs/commands/line.md), [`DIMDIAMETER`](https://mellowcad.com/docs/commands/dimdiameter.md), [`DIMLINEAR`](https://mellowcad.com/docs/commands/dimlinear.md)
- **In the editor:** [Open it with its drawing](/draw?drawing=flange), dimensioned beside where you draw yours

## The drawing

The flange, 140 across, with its keyway, eight holes and diameters.

## 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 circles

On the Outline layer, two circles at `0,0`, each by its `Diameter`: `140` and `60`.

1. Draw the circles

```text
Command: CIRCLE
Specify center point for circle or [3P/2P/Ttr (tan tan radius)]: 0,0
Specify radius of circle or [Diameter]: D
Specify diameter of circle: 140
Command: CIRCLE
Specify center point for circle or [3P/2P/Ttr (tan tan radius)]: 0,0
Specify radius of circle or [Diameter] <70.00>: D
Specify diameter of circle <140.00>: 60
```

### 2. Cut the keyway

[`RECTANG`](https://mellowcad.com/docs/commands/rectang.md) from `-8,20` to `16,16` further on: it crosses the bore. [`TRIM`](https://mellowcad.com/docs/commands/trim.md) cuts an object where the others cross it: pick the bore's arc between the rectangle's sides, then the rectangle's bottom, inside the bore. What is left is the keyway, its two sides and its top.

2. Cut the keyway

```text
Command: RECTANG
Specify first corner point or [Chamfer/Elevation/Fillet/Thickness/Width]: -8,20
Specify other corner point or [Area/Dimensions/Rotation]: @16,16
Command: TRIM
Current settings: Projection=UCS, Edge=None, Mode=Quick
Select object to trim or shift-select to extend or [cuTting edges/Crossing/mOde/eRase]:
Select object to trim or shift-select to extend or [cuTting edges/Crossing/mOde/eRase/Undo]:
Select object to trim or shift-select to extend or [cuTting edges/Crossing/mOde/eRase/Undo]:
```

### 3. Array the holes

A hole on the pitch circle: a circle at `55<22.5`, 55 from the origin at 22.5°, with a `Diameter` of `14`. [`ARRAYPOLAR`](https://mellowcad.com/docs/commands/arraypolar.md): pick it, press Enter and give the centre, `0,0`; `ASsociative` and `No` leave eight separate circles, which a dimension can pick, and `Items`, `8`, spreads them round the whole circle. Then, on Centre lines, the pitch circle at `0,0`, its diameter `110`.

3. Array the holes

```text
Command: CIRCLE
Specify center point for circle or [3P/2P/Ttr (tan tan radius)]: 55<22.5
Specify radius of circle or [Diameter] <30.00>: D
Specify diameter of circle <60.00>: 14
Command: ARRAYPOLAR
Select objects: 1 found
Select objects:
Type = Polar  Associative = Yes
Specify center point of array: 0,0
Select grip to edit array or [ASsociative/Items/Angle between/Fill angle/ROTate items/eXit]<eXit>: AS
Create associative array [Yes/No] <Yes>: N
Select grip to edit array or [ASsociative/Items/Angle between/Fill angle/ROTate items/eXit]<eXit>: I
Enter number of items in array <6>: 8
Select grip to edit array or [ASsociative/Items/Angle between/Fill angle/ROTate items/eXit]<eXit>: X
Command: CIRCLE
Specify center point for circle or [3P/2P/Ttr (tan tan radius)]: 0,0
Specify radius of circle or [Diameter] <7.00>: D
Specify diameter of circle <14.00>: 110
```

### 4. Draw the centre lines

Still on Centre lines, two lines with [`LINE`](https://mellowcad.com/docs/commands/line.md) through the centre, 156 long: from `-78,0`, `156,0` across; from `0,-78`, `0,156` up.

4. Draw the centre lines

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

### 5. Dimension it

On Dimensions, [`DIMDIAMETER`](https://mellowcad.com/docs/commands/dimdiameter.md) on the bore, a hole, the pitch circle and the outline, each picked where no dimension crosses it yet, then [`DIMLINEAR`](https://mellowcad.com/docs/commands/dimlinear.md) across the keyway's top: 16.

5. Dimension it

```text
Command: DIMDIAMETER
Select arc or circle:
Dimension text = 60
Specify dimension line location or [Text/Angle]:
Command: DIMDIAMETER
Select arc or circle:
Dimension text = 14
Specify dimension line location or [Text/Angle]:
Command: DIMDIAMETER
Select arc or circle:
Dimension text = 110
Specify dimension line location or [Text/Angle]:
Command: DIMDIAMETER
Select arc or circle:
Dimension text = 140
Specify dimension line location or [Text/Angle]:
Command: DIMLINEAR
Specify first extension line origin or <select object>: -8,36
Specify second extension line origin: @16,0
Non-associative dimension created.
Specify dimension line location or [Text/Angle/Horizontal/Vertical/Rotated]:
Dimension text = 16
```

## More exercises

- [AutoCAD exercise: a round table and chairs](https://mellowcad.com/docs/exercises/round-table.md): Intermediate · Architecture · 2D
- [AutoCAD exercise: a plot of land](https://mellowcad.com/docs/exercises/plot-of-land.md): Intermediate · Civil · 2D
- [AutoCAD exercise: a stepped shaft](https://mellowcad.com/docs/exercises/shaft.md): Intermediate · Mechanical · 2D
- [AutoCAD practice exercises](https://mellowcad.com/docs/exercises.md)
