Eraser routine

Reid M. Addis

Usenet Archive
Joined
Jul 30, 2003
Messages
54
Reaction score
0
Okay, I thought I had, or could find this one on my own, but I'm stumped! I recall an "eraser" routine that would delete entities as your cursor crossed over them. I have a LOT of things to delete and this would be useful.

Does anyone have this routine or know where to download it from?

TIA!

Regards,
Reid M. Addis
Registered Architect
Architectural Applications Specialist
Granary Associates
411 North 20th Street
Philadelphia, PA 19130
Ph. 215-665-7056
email:

p.s. sorry about the double post in the adt customization group. You can delete that one
 
Here is a quickie. HTH

(defun C:eraser (/ ent)
(while
(if
(setq ent
(car (nentselp
(cadr
(grread T 13 2)))))
(progn
(command "erase" ent "")
T)

T
)
)
(princ)
)
 
Is it just me, or does that sound like a dangerous rotine? I can just see someone dropping a book or something on my desk and erasing half my drawing.
 
undo?

OLD-CADaver said:
Is it just me, or does that sound like a dangerous rotine? I can
just see someone dropping a book or something on my desk and erasing half my drawing.
 
Then throw the book back. <g>

OLD-CADaver said:
Is it just me, or does that sound like a dangerous rotine? I can
just see someone dropping a book or something on my desk and erasing half my drawing.
 
Better to use (entdel ent) rather than (command "erase" ...). With (command ...) the routine will hang on complex objects.

Even with (entdel ent), complex objects (blocks, polylines ...) will be ignored, but at least the routine won't hang.

(defun C:ERASER (/ ent)
(while T
(if (setq ent (car (nentselp (cadr (grread T 4 2)))))
(entdel ent)
);; if
);; while
(princ)
)
___
 
Thanks everyone!
Ken's and Paul's were great, but they had no "safety net". The one from André Cumuli in the Catalyst code allows you to hit the enter key to toggle erase on and off, plus some other features, making it a bit easier and safer to use!

Thanks again. You guys are "de man!"
 
Paul said:
Better to use (entdel ent) rather than (command "erase" ...). With (command ...) the routine will hang on complex objects.

Even with (entdel ent), complex objects (blocks, polylines ...) will be ignored, but at least the routine won't hang.

(defun C:ERASER (/ ent)
(while T
(if (setq ent (car (nentselp (cadr (grread T 4 2)))))
(entdel ent)
);; if
);; while
(princ)
)
___

Thanks for the "goodie".
 
OLD-CADaver said:
Is it just me, or does that sound like a dangerous rotine? I can just see someone dropping a book or something on my desk and erasing half my drawing.

no "OOPS" available? or UNDO? But I know what you mean.
 
Works here and it's great!
Of course, I did a little editing of the file, so there may be an errant symbol or two in it.

Anyone who wants a copy just email me and I'll send it to you.
 
may be an alternative way, it's not to delete entities, but simply change on a new off layer : delete_tmp.

Bruno Toniutti
(sorry for my english level)
 

Latest threads

Back
Top