Lisp lệnh T2ATT trong chủ đề “Chuyển text sẵn có thành ATT”
Search là thấy ngay cho bạn đây ^^
- Tải lisp
- 129984_t2att.lsp
Cách dùng
- Tải tệp 129984_t2att.lsp về máy.
- Trong AutoCAD gõ lệnh APPLOAD, chọn tệp vừa tải rồi bấm Load. Cũng có thể kéo thả tệp .lsp vào cửa sổ bản vẽ.
- Gõ lệnh T2ATT để chạy lisp.
Mã nguồn 129984_t2att.lsp
;; free lisp from cadviet.com
;;; this lisp was downloaded from https://www.cadviet.com/forum/topic/34032-chuy%E1%BB%83n-text-s%E1%BA%B5n-c%C3%B3-th%C3%A0nh-att/
;free lisp from cadviet.com posted by ketxu
(defun c:t2att (/ ss i en ed)
(while (not ss)
(princ "\nChon text de chuyen thanh ATT :")
(setq ss (ssget (list (cons 0 "TEXT")
(if (getvar "CTAB")
(cons 410 (getvar "CTAB"))
(cons 67 (- 1 (getvar "TILEMODE"))))))))
(setq i (sslength ss))
(while (not (minusp (setq i (1- i))))
(setq en (ssname ss i)
ed (entget en))
(if (wcmatch (cdr (assoc 1 ed)) "* *")
(alert "\nDay ky tu chua khoang trong, khong thuc hien duoc")
(progn
(entmake (list (cons 0 "ATTDEF")
(assoc 8 ed)
(assoc 10 ed)
(assoc 11 ed)
(assoc 7 ed)
(assoc 40 ed)
(assoc 41 ed)
(assoc 50 ed)
(assoc 51 ed)
(cons 70 0)
(assoc 71 ed)
(assoc 72 ed)
(cons 74 (cdr (assoc 73 ed)))
(assoc 210 ed)
(cons 1 "")
(cons 2 (cdr (assoc 1 ed)))
(cons 3 (cdr (assoc 1 ed)))
(if (assoc 6 ed) (assoc 6 ed)'(6 . "BYLAYER"))
(if (assoc 39 ed) (assoc 39 ed)'(39 . 0))
(if (assoc 62 ed) (assoc 62 ed)'(62 . 256))))
(entdel en))))
(redraw)
(prin1))Thảo luận gốc
Lisp được chia sẻ trong chủ đề Chuyển text sẵn có thành ATT. Xem đúng bài viết #129984 để đọc hướng dẫn và trao đổi thêm.