A lot of the drawings that I get I end up erasing a lot of stuff. And after using SkethUP’s erase command, I wish that AutoCAD’s erase command worked in the same way. I asked Lee-Mac for help with this and he delivered a great little routine that I am sure you guys will enjoy.
What it does is let you select objects with either a window or crossing window. And after making the selection set it automatically erases the selection and continues the erase command.
Here’s How:
- EC <enter> to start Erase Continuous
- Make selection sets with a Window or Crossing Window
- The command will stay in a loop, so to end the routine, hit the escape <ESC> button
; Erase Continuous by Lee-Mac (defun c:ec ( / p1 p2 ss ) (while (and (setq p1 (getpoint "\nSpecify First Corner: ")) (setq p2 (getcorner "\nSpecify Opposite Corner: " p1)) ) (if (setq ss (ssget (if (< (car p1) (car p2)) "_W" "_C") p1 p2)) (command "_.erase" ss "") ) ) (princ) )
Here is a version that uses the grread function
;Erase Continuous by Lee-Mac. Uses grread (defun c:ec ( / p1 p3 ls hi ss ) (while (and (setq p1 (getpoint "\nSpecify First Corner: ")) (progn (princ "\nSpecify Opposite Corner: ") (while (= 5 (car (setq p3 (grread t 13 0)))) (redraw) (setq p3 (cadr p3)) (setq ls (list p1 (list (car p3) (cadr p1) (caddr p1)) p3 (list (car p1) (cadr p3) (caddr p1)) ) ) (setq hi (if (< (car p1) (car p3)) 0 1)) (mapcar '(lambda ( a b ) (grdraw a b -1 hi)) ls (append (cdr ls) (list p1))) ) (listp (setq p3 (cadr p3))) ) ) (redraw) (if (setq ss (ssget (if (< (car p1) (car p3)) "_W" "_C") p1 p3)) (command "_.erase" ss "") ) ) (redraw) (princ) )
hi!! I was looking for something for the midbutton menu, something like this!!:
erase;si;auto;
something simple but i can’t remember how it’s wrote!!!
In pop menu use this macro *^C^C_erase si auto