Sau 1 thời kì nghiên cứu, thì đây là 1 lisp xóa nhanh trong autocad, giúp bạn khắc phục được những vấn đề xóa của lênh Erase, đây là một lisp quan yếu trong việc giúp bạn vẽ nhanh những bản vẽ to, cần phải xóa nhiều và nhanh
Xem thêm : Lisp join những đường tiếp nối trong autocad
Xem demo lisp xóa nhanh trong autocad
Code:
(defun C:ER (/ *error* pt ent usrpb)
(defun *error* (msg)
(if (not
(member msg '("console break" "Function cancelled" "quit / exit abort" "" nil)))
(princ (strcat "nError: " msg))
) ; if
(and usrpb (setvar "pickbox" usrpb))
(princ)
) ; end error function
(setq usrpb (getvar "pickbox"))
(setvar "pickbox" 3)
(command "_.undo" "_begin")
(while (listp (setq pt (cadr (grread T 4 2))))
(if (setq ent (car (nentselp pt)))
(progn
(if (= (cdr(assoc 0 (entget ent))) "VERTEX")
(setq ent (cdr(assoc 330 (entget ent)))
))
(print)
(princ (entdel ent))
)
)
) ; while
(command "_.undo" "_end")
(*error* nil)
(princ)
)
Trả lời