# Cách vẽ mặt bằng nhà trong AutoCAD

> Cách vẽ mặt bằng nhà trong AutoCAD: tường bằng lệnh OFFSET, tường ngăn, lỗ cửa cắt bằng TRIM, cửa đi với cung mở cửa, cửa sổ và kích thước.

Mặt bằng là ngôi nhà được cắt ngang ở độ cao khoảng một mét rưỡi và nhìn từ trên xuống: mỗi bức tường là hai đường với bề dày tường ở giữa, các lỗ cửa trên tường, cửa đi vẽ ở trạng thái mở cùng cung mở cửa, cửa sổ và kích thước. Hướng dẫn này vẽ một ngôi nhà hai phòng, 8 × 6 mét, theo centimet: một đơn vị là một centimet, nên tường ngoài dày 20 và tường ngăn dày 10. Mỗi bước hiển thị bản vẽ và lịch sử dòng lệnh đúng như bạn sẽ gõ. [Mở trình vẽ](/vi/draw) bên cạnh trang này và làm theo.

## Tạo các lớp

Mỗi loại đối tượng nằm trên một lớp riêng, với màu riêng, để bạn có thể tắt bất kỳ lớp nào: “Tường”, “Cửa đi”, “Cửa sổ” và “Kích thước”. Tạo chúng trong Trình quản lý thuộc tính lớp, lệnh `LAYER`, và trước mỗi bước, đặt lớp phù hợp làm lớp hiện hành trong danh sách thả xuống Lớp. Để kích thước đọc được ở cỡ một ngôi nhà, đặt tỷ lệ tổng thể của kiểu kích thước trong lệnh `DIMSTYLE`: ở đây là 12, nên chữ kích thước cao 30.

## Vẽ tường ngoài

Trên lớp “Tường”, lệnh `RECTANG` (vẽ hình chữ nhật) từ `0,0` đến `800,600`: mặt ngoài của tường. Lệnh `OFFSET` (sao chép song song) tạo mặt trong: gõ bề dày, `20`, chọn hình chữ nhật và nhấp vào bên trong nó.

Tường ngoài: một hình chữ nhật và bản sao song song của nó, cách 20 vào trong.

```text
Command: RECTANG
Specify first corner point or [Chamfer/Elevation/Fillet/Thickness/Width]: 0,0
Specify other corner point or [Area/Dimensions/Rotation]: @800,600
Command: OFFSET
Current settings: Erase source=No  Layer=Source  OFFSETGAPTYPE=0
Specify offset distance or [Through/Erase/Layer] <Through>: 20
Select object to offset or [Exit/Undo] <Exit>:
Specify point on side to offset or [Exit/Multiple/Undo] <Exit>:
Select object to offset or [Exit/Undo] <Exit>:
```

## Vẽ tường ngăn

Một đoạn thẳng bằng lệnh `LINE` từ `500,20`, `0,560` lên tới mặt trong của tường ngoài, và `OFFSET` `10` sang bên phải nó: bức tường giữa hai phòng.

Tường ngăn: một đoạn thẳng và bản sao song song, cách 10 về bên phải.

```text
Command: LINE
Specify first point: 500,20
Specify next point or [Undo]: @0,560
Specify next point or [Undo]:
Command: OFFSET
Current settings: Erase source=No  Layer=Source  OFFSETGAPTYPE=0
Specify offset distance or [Through/Erase/Layer] <20.00>: 10
Select object to offset or [Exit/Undo] <Exit>:
Specify point on side to offset or [Exit/Multiple/Undo] <Exit>:
Select object to offset or [Exit/Undo] <Exit>:
```

## Cắt lỗ cửa

Một lỗ cửa được cắt giữa hai đường ngang qua tường, là hai mép của lỗ cửa. Vẽ chúng bằng `LINE`, rồi dùng lệnh `TRIM` (cắt xén) cắt các đường của tường nằm giữa chúng, mỗi đoạn một lần chọn: cửa chính, rộng 90, từ `100,0`; cửa đi bên trong, rộng 80, từ `500,200`; các cửa sổ, rộng 120, từ `200,580` ở tường phía trên và `780,250` ở tường bên phải.

Bốn lỗ cửa: mỗi lỗ hai mép, và các đường của tường được cắt giữa chúng.

```text
Command: LINE
Specify first point: 100,0
Specify next point or [Undo]: @0,20
Specify next point or [Undo]:
Command: LINE
Specify first point: 190,0
Specify next point or [Undo]: @0,20
Specify next point or [Undo]:
Command: LINE
Specify first point: 500,200
Specify next point or [Undo]: @10,0
Specify next point or [Undo]:
Command: LINE
Specify first point: 500,280
Specify next point or [Undo]: @10,0
Specify next point or [Undo]:
Command: LINE
Specify first point: 200,580
Specify next point or [Undo]: @0,20
Specify next point or [Undo]:
Command: LINE
Specify first point: 320,580
Specify next point or [Undo]: @0,20
Specify next point or [Undo]:
Command: LINE
Specify first point: 780,250
Specify next point or [Undo]: @20,0
Specify next point or [Undo]:
Command: LINE
Specify first point: 780,370
Specify next point or [Undo]: @20,0
Specify next point or [Undo]:
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]:
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]:
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]:
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]:
```

## Vẽ cửa đi

Trên lớp “Cửa đi”, mỗi cửa gồm cánh cửa, vẽ ở trạng thái mở bằng `LINE`, và cung mở cửa, một cung tròn vẽ bằng lệnh `ARC`: chọn lựa chọn tâm (Center), rồi cho bản lề làm tâm, điểm đầu và điểm cuối của cung. Cả hai đầu cung đều là những điểm đã vẽ, góc của mép lỗ cửa và đầu cánh cửa: gõ `_END`, truy bắt điểm cuối (Endpoint) cho một điểm, và chọn từng điểm.

Mỗi cửa: cánh cửa mở 90° và cung mở cửa.

```text
Command: LINE
Specify first point: 100,20
Specify next point or [Undo]: @0,90
Specify next point or [Undo]:
Command: ARC
Specify start point of arc or [Center]: C
Specify center point of arc: 100,20
Specify start point of arc: _END of
Specify end point of arc (hold Ctrl to switch direction): _END of
Command: LINE
Specify first point: 510,200
Specify next point or [Undo]: @80,0
Specify next point or [Undo]:
Command: ARC
Specify start point of arc or [Center]: C
Specify center point of arc: 510,200
Specify start point of arc: _END of
Specify end point of arc (hold Ctrl to switch direction): _END of
```

## Vẽ cửa sổ

Trên lớp “Cửa sổ”, lệnh `RECTANG` lấp đầy mỗi lỗ cửa tính từ mép của nó, và một đoạn thẳng qua giữa thể hiện tấm kính.

Các cửa sổ: một hình chữ nhật trong mỗi lỗ cửa và một đường cho tấm kính.

```text
Command: RECTANG
Specify first corner point or [Chamfer/Elevation/Fillet/Thickness/Width]: 200,580
Specify other corner point or [Area/Dimensions/Rotation]: @120,20
Command: LINE
Specify first point: 200,590
Specify next point or [Undo]: @120,0
Specify next point or [Undo]:
Command: RECTANG
Specify first corner point or [Chamfer/Elevation/Fillet/Thickness/Width]: 780,250
Specify other corner point or [Area/Dimensions/Rotation]: @20,120
Command: LINE
Specify first point: 790,250
Specify next point or [Undo]: @0,120
Specify next point or [Undo]:
```

## Ghi kích thước mặt bằng

Trên lớp “Kích thước”, dùng `DIMLINEAR` ghi các kích thước bao ngoài, rồi các phòng từ phía trong: chiều rộng phòng thứ nhất bằng `DIMLINEAR`, rồi tường ngăn và phòng thứ hai bằng `DIMCONTINUE` (ghi kích thước nối tiếp), gõ tính từ gốc tọa độ với `#`.

Mặt bằng đã ghi kích thước: 800 × 600 bên ngoài, các phòng bên trong.

```text
Command: DIMLINEAR
Specify first extension line origin or <select object>: 0,0
Specify second extension line origin: @800,0
Non-associative dimension created.
Specify dimension line location or [Text/Angle/Horizontal/Vertical/Rotated]:
Dimension text = 800
Command: DIMLINEAR
Specify first extension line origin or <select object>: 0,0
Specify second extension line origin: @0,600
Non-associative dimension created.
Specify dimension line location or [Text/Angle/Horizontal/Vertical/Rotated]:
Dimension text = 600
Command: DIMLINEAR
Specify first extension line origin or <select object>: 20,20
Specify second extension line origin: @480,0
Non-associative dimension created.
Specify dimension line location or [Text/Angle/Horizontal/Vertical/Rotated]:
Dimension text = 480
Command: DIMCONTINUE
Specify second extension line origin or [Select/Undo] <Select>: #510,20
Dimension text = 10
Specify second extension line origin or [Select/Undo] <Select>: #780,20
Dimension text = 270
Specify second extension line origin or [Select/Undo] <Select>:
Select continued dimension:
```

## Tiếp theo

- Ghi tên từng phòng bằng `TEXT`, và tô tường bằng `HATCH` (vẽ mặt cắt), chọn một điểm giữa hai đường của tường.
- Luyện tập với các [bài tập](https://mellowcad.com/vi/docs/exercises.md): [mặt bằng cầu thang](https://mellowcad.com/vi/docs/exercises/stairs.md) và [bàn tròn và ghế](https://mellowcad.com/vi/docs/exercises/round-table.md) cũng được vẽ theo centimet.
- [Tọa độ](https://mellowcad.com/vi/docs/coordinates.md): mọi cách nhập một điểm.
