Cách chèn nhanh 1 block vào autocad

Code chèn nhanh block bằng Lisp.

Các bạn copy code bên dưới và paste vào notepad, save lại với đuôi .lsp 
Thay chữ màu đỏ bằng tên block tương ứng. 
Thay thế chữ màu xanh bằng tên lệnh

;====Code chen block theo huong va scale theo ty le nhat dinh===
(defun c:MT() (if (= scale nil)  (setq scale (getreal "\nInput current scale: ")))  (setq pt1 (getpoint "\nPick the insert point :"))        (setq pt2 (getpoint "Pick the second point for rotate arrow :" pt1)) (setq ang (/ (* (angle pt1 pt2) 180) pi)) (command "INSERT" "muitenH" pt1 scale scale ang));defun

;=====Code chen block co thuoc tinh ==========================
(defun c:PIA() (setq pt1 (getpoint "\nPick the insert point :")) (command "INSERT" "PIA" pt1 1 1 0 1));defun


;=======Code chen block tinh=============================
(defun c:A() (setq pt1 (getpoint "\nPick the insert point :")) (command "INSERT" "A" pt1 1 1 0));defun




Bình luận

0 Nhận xét