Erase Single

Is there a way to erase "single" in Bricscad?  IE:  select an item to erase and it immediately erases (no return needed)?  Thanks.

Comments

  • If you select something and then hit the Delete key, that deletes it with no other keystrokes.

  • By default the command launched by the ERASE tool is: ^c^c_erase. If you add ;\; the ERASE tool only allows to select a single entity which is then erased immediately.

    Choose CUSTOMIZE in the TOOLS menu, expand the EDIT tools under BRICSCAD and select the ERASE tool. Edit the COMMAND filed: ^c^c_erase;\;
     and click the  OK button.

    If you want to keep the standard ERASE tool, you creat a new one. See the Bricscad Help under User Guide / Customizing Bricscad / Creating Custom Tools.

  • You can gave fun with this one. I have not tested in Bricscad.

    ;;  modified by CAB 05.08.07
    (defun C:ERASER (/ *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)
    )
  • Hi ...

    I have MANY commands (f. e. _change, _copy, _trim ... ) in my LISP-apps with "_si" - and this is a really BIG problem ... maybe somebody have here a good idea?!

    Alias for "_si" to "\" - no way ... :(

     

    regards: Walter - B.

  • You could try this:

    (defun single ( / )
    (car (entsel "\nPick one entity: "))
    )

    ; Macro usage: ^c^c_erase;(single);\;

    ; Lisp usage:
    ; old code: (command "_.move" "_si" pt1 pt2)
    ; new code:
    (command "_.move" (single) "" pt1 pt2)
  • BTW: Charles Alan Butler's code (post #4) works in BC10 (tested with 10.2.10). To erase an element you only need to hover over it!

  • WOW ...

    Very good Idea - I'll try this NOW!

     

    THX!!

  • :(

    now I changed all (my app has over 3700 lines) - now it functions well, but… my different apps have also "_si" !

    old: (command "_copy" "_si" ceob ceob cetg) (command "_change" "_si" "_l" "_p" "_la" "ARM-HL" "")

    now: (command "_copy" ceob "" ceob cetg) (command "_change" "_l" "" "_p" "_la" "ARM-HL" "")

    perhaps the support team insert my loved "_si" sometime?

    ;)

  • @Walter: I see that you didn't use my suggestion. But how can your "now" code work? There seems to be no selection.

  • HI ...

    ... mein Englisch ist leider dermaßen miserabel, dass ich mich nicht traue, mein Problem hier detailliert darzulegen ...

    Also - ich brauchte "_si" ausschließlich dazu, ein bereits gewähltes Objekt - oder halt das "letzte Objekt" - mit diversen Befehlen in LISP zu "behandeln".

    entget, entlast etc. bringt mich nicht wirkllich weiter - und es sollte ja etwas sein, was ich per "suchen & ersetzen" anstelle von "_si" einsetzen kann - hier hilft (single) nicht weiter, da ein OBJEKT ABGRFRAGT wird ... in abgewandelter Form (entlast) etc. funktioniert's nicht - also habe ich alle Befehle umgeschrieben, in Ermangelung besseren Wissens... meine "LISP-Zeit" - ist lange her und ich wollte meine CA3D®ISO-Routine nicht sinnlos "verfaulen" lassen ...

    Wie gesagt - jetzt funktionierts zu 98%!

    Nur ein Problem besteht immer noch: der Gummiband-Cursor - dieser folgt beim Zeichnen einer einfachen Linie im ORTHO-Modus NICHT bei Wechsel der ISO-Ebene (F5) während eines (getpoint pt1 ...), sondern zieht weiterhin in die "alte" Richtung ... Erst nach einem kurzen 'PAN oder 'ZOOM wird die richtige Ebene dargestellt!

    Evtl. generell ein Problem mit transparenten Befehlen in LISP?!

    :(

    vg - Walter - B.

  • @Roy: I dont want to PICK an object - "ceob" IS an entity! Many thx for your patience !!

  • Walter: ich denke ich habe dich verstanden/I now understand your problem:

    ; Typical changes because "_si" is not available:

    ; old code: (command "_.move" "_si" "_last" pt1 pt2)
    ; new code: (command "_.move" "_last" "" pt1 pt2)

    ; old code: (command "_.move" "_si" "_previous" pt1 pt2)
    ; new code: (command "_.move" "_previous" "" pt1 pt2)

    ; old code: (command "_.move" "_si" entName pt1 pt2)
    ; new code: (command "_.move" entName "" pt1 pt2)
  • YES, SIR - exactly this ist the way I've changed may app!

    In case of <"_si" "_l"> no problem (search and replace ...) <"_l" ""> - but in all other cases ... :(

     

    I LOVE BC!!

    :)

  • I made a support request (May 2010) and now I got the news, that the "_single" Option will be integratet soon. Look for the release notes.

    Stefan

This discussion has been closed.