Eraser routine

Discussion in 'AutoCAD' started by Reid M. Addis, Jul 30, 2003.

  1. 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
     
    Reid M. Addis, Jul 30, 2003
    #1
  2. 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)
    )

    --
    Ken Alexander
    Acad2000
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein
     
    Ken Alexander, Jul 30, 2003
    #2
  3. Reid M. Addis

    OLD-CADaver Guest

    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.
     
    OLD-CADaver, Jul 30, 2003
    #3
  4. undo?

    --
    Ken Alexander
    Acad2000
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein

    just see someone dropping a book or something on my desk and erasing
    half my drawing.
     
    Ken Alexander, Jul 30, 2003
    #4
  5. Then throw the book back. <g>

    --
    Ken Alexander
    Acad2000
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein

    just see someone dropping a book or something on my desk and erasing
    half my drawing.
     
    Ken Alexander, Jul 30, 2003
    #5
  6. Reid M. Addis

    Paul Turvill Guest

    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)
    )
    ___
     
    Paul Turvill, Jul 30, 2003
    #6
  7. Gottcha....Thanks.

    --
    Ken Alexander
    Acad2000
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein
     
    Ken Alexander, Jul 30, 2003
    #7
  8. 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!"
    --
    Regards,
    ---------------
    Reid M. Addis
    Registered Architect
    Architectural Applications Specialist
    Granary Associates
    411 North 20th Street
    Philadelphia, PA 19130
    Ph. 215-665-7056
    email:
     
    Reid M. Addis, Jul 30, 2003
    #8
  9. Reid M. Addis

    Walt Engle Guest

    Thanks for the "goodie".
     
    Walt Engle, Jul 31, 2003
    #9
  10. Reid M. Addis

    Walt Engle Guest

    no "OOPS" available? or UNDO? But I know what you mean.
     
    Walt Engle, Jul 31, 2003
    #10
  11. Reid M. Addis

    Walt Engle Guest

    Walt Engle, Jul 31, 2003
    #11
  12. 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.

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

    BTO Guest

    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)
     
    BTO, Aug 22, 2003
    #13
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.