jovo14 Posted October 5, 2012 Share Posted October 5, 2012 I am looking for help with a special erase command. I would like to select objects one by one and have then delete as I select them. Can someone advise how to write this command? Thx Quote Link to comment Share on other sites More sharing options...
BlackBox Posted October 5, 2012 Share Posted October 5, 2012 Welcome to CADTutor, and the world of LISP! (defun c:Erase+ (/ eName layerName) (while (and (setq eName (car (entsel "\nSelect an entity to erase: "))) (setq layerName (cdr (assoc 8 (entget eName)))) (/= 4 (cdr (assoc 70 (tblsearch "layer" layerName)))) ) (command "._erase" eName "") ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 5, 2012 Share Posted October 5, 2012 Another, (defun c:e1 ( / e ) (while (setq e (car (entsel))) (entdel e)) (princ) ) Or, to allow for missed picks: (defun c:e1 ( / e ) (while (progn (setvar 'errno 0) (setq e (car (entsel))) (cond ( (= 7 (getvar 'errno)) (princ "\nMissed, try again.") ) ( (= 'ename (type e)) (entdel e) t ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 5, 2012 Share Posted October 5, 2012 You do not need a lisp routine to accomplish the task. I've had this ability for many years simply by using this: *^C^CErase;\; Quote Link to comment Share on other sites More sharing options...
BlackBox Posted October 5, 2012 Share Posted October 5, 2012 Good catch, Lee... I always forget about the ENTDEL function; much more efficient than the command. LoL *kicks dirt* Quote Link to comment Share on other sites More sharing options...
jovo14 Posted October 5, 2012 Author Share Posted October 5, 2012 You do not need a lisp routine to accomplish the task. I've had this ability for many years simply by using this: *^C^CErase;\; Nice and simple...Thanks Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 5, 2012 Share Posted October 5, 2012 You do realize you have to edit the CUIx to use the macro right? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.