lisp xóa text trong 1 miền kín
;; free lisp from cadviet.com
;;; this lisp was downloaded from https://www.cadviet.com/forum/index.php?showtopic=68051&pid=221519&st=0&#entry221519
(defun c:xtpl ()
(setq dt (ssget '((0 . "LWPOLYLINE"))))
(setq n (sslength dt) i 0)
(while (< i n)
(setq dt1 (ssname dt i))
(command ".zoom" "o" dt1 "")
(setq SS (ssget "wp" (acet-geom-vertex-list dt1) (list (cons 0 "text"))))
(command ".erase" ss "")
(command ".zoom" "p")
(setq i (+ i 1))
)
(setq sdt (sslength ss))
)
Tệp .lsp gốc không còn trên máy chủ. Hãy chép mã nguồn bên dưới (lấy từ bài viết gốc) vào một tệp văn bản, lưu với đuôi .lsp.
Cách dùng
- Chép mã nguồn, lưu thành tệp 221531_xtpl.lsp.
- 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 XTPL để chạy lisp.
Mã nguồn 221531_xtpl.lsp (trích từ bài viết gốc)
;; free lisp from cadviet.com
;;; this lisp was downloaded from [url="https://www.cadviet.com/forum/index.php?showtopic=68051&pid=221519&st=0entry221519"]https://www.cadviet.com/forum/index.php?showtopic=68051&pid=221519&st=0entry221519[/url]
(defun c:xtpl ()
(setq dt (ssget '((0 . "LWPOLYLINE"))))
(setq n (sslength dt) i 0)
(while (< i n)
(setq dt1 (ssname dt i))
(command ".zoom" "o" dt1 "")
(setq SS (ssget "wp" (acet-geom-vertex-list dt1) (list (cons 0 "text"))))
(command ".erase" ss "")
(command ".zoom" "p")
(setq i (+ i 1))
)
(setq sdt (sslength ss))
)Thảo luận gốc
Lisp được chia sẻ trong chủ đề [nhờ chỉnh sửa] lisp xóa text trong 1 miền kín. Xem đúng bài viết #221531 để đọc hướng dẫn và trao đổi thêm.