(defun c:Ve_KetCau_BTCT ()
(command "layer" "make" "BE_TONG" "color" "7" "" ) ;; Lớp bê tông
(command "layer" "make" "COT_THEP" "color" "1" "" ) ;; Lớp cốt thép
;; Kích thước các cấu kiện
(setq x0 0 y0 0) ;; Gốc tọa độ
(setq L_san 6915) ;; Nhịp dài của sàn (mm)
(setq W_san 2842) ;; Nhịp ngắn của sàn (mm)
(setq h_san 110) ;; Chiều dày sàn (mm)
(setq L_dp 6915) ;; Nhịp dầm phụ (mm)
(setq W_dp 200) ;; Chiều rộng dầm phụ (mm)
(setq H_dp 300) ;; Chiều cao dầm phụ (mm)
(setq L_dc 6915) ;; Nhịp dầm chính (mm)
(setq W_dc 300) ;; Chiều rộng dầm chính (mm)
(setq H_dc 600) ;; Chiều cao dầm chính (mm)
;; Vẽ bản sàn
(command "rectang" (list x0 y0) (list (+ x0 L_san) (+ y0 W_san)))
;; Vẽ dầm phụ
(setq x_dp (+ x0 (/ W_san 2)))
(command "rectang" (list x_dp y0) (list (+ x_dp W_dp) (+ y0 L_dp)))
;; Vẽ dầm chính
(setq y_dc (+ y0 W_san))
(command "rectang" (list x0 y_dc) (list (+ x0 L_dc) (+ y_dc H_dc)))
;; Vẽ cốt thép bản sàn
(command "layer" "set" "COT_THEP" "")
(setq n_thep 18) ;; Số lượng thanh thép D6 bố trí
(setq s_thep (/ L_san n_thep))
(setq i 0)
(while (< i n_thep)
(command "line" (list (+ x0 (* i s_thep)) y0) (list (+ x0 (* i s_thep)) (+ y0 W_san)))
(setq i (+ i 1))
)
;; Vẽ cốt thép dầm phụ
(setq n_thep_dp 7)
(setq s_thep_dp (/ L_dp n_thep_dp))
(setq i 0)
(while (< i n_thep_dp)
(command "line" (list (+ x_dp (* i s_thep_dp)) y0) (list (+ x_dp (* i s_thep_dp)) (+ y0 W_dp)))
(setq i (+ i 1))
)
;; Vẽ cốt thép dầm chính
(setq n_thep_dc 8)
(setq s_thep_dc (/ L_dc n_thep_dc))
(setq i 0)
(while (< i n_thep_dc)
(command "line" (list (+ x0 (* i s_thep_dc)) y_dc) (list (+ x0 (* i s_thep_dc)) (+ y_dc H_dc)))
(setq i (+ i 1))
)
(princ "\nBản vẽ kết cấu đã được tạo! Sử dụng AutoCAD để kiểm tra.")
)