Redefine Mirror Command

Discussion in 'AutoCAD' started by Tim, Oct 25, 2004.

  1. Tim

    Tim Guest

    Has anybody redefined the mirror command so that the default answer for
    "Delete source objects [Yes/No] is <Y> instead of <N>.
    I have tried a couple of different things to no avail.

    Thanks

    Tim W.
     
    Tim, Oct 25, 2004
    #1
  2. Tim

    moshe Guest

    Hi Tim

    pice of cake

    (command "undefine" "mirror")

    (defun C:MIRROR ()
    (command ".mirror" pause pause pause "y")
    )

    good luck

    Moshe
     
    moshe, Oct 25, 2004
    #2
  3. Tim

    Jim Claypool Guest

    (defun c:mymirror ( / ss pt1 ans)
    (if (setq ss (ssget))
    (progn
    (setq pt1 (getpoint "\nSpecify first point pf mirror line: "))
    (princ "\nSpecify second point of mirror line: ")
    (command ".mirror" ss "" pt1 pause)
    (initget "Y N")
    (setq ans (getkword "\nDelete source objects [Yes/No] <Y>: "))
    (command (if (= ans "N") "N" "Y"))
    ))
    (princ)
    )
     
    Jim Claypool, Oct 25, 2004
    #3
  4. Tim

    Tim Guest

    Thank Jim.
    Looking at yours I see where I messed up in mine and why it didn't work

    Tim


     
    Tim, Oct 25, 2004
    #4
  5. [Except that wouldn't retain the option to say No....]
    --
    Kent Cooper, AIA


     
    Kent Cooper, AIA, Oct 25, 2004
    #5
  6. Tim

    Tom Smith Guest

    [Except that wouldn't retain the option to say No....]

    I disagree with the approach of "reprogramming Acad" so that basic commands
    function in nonstandard ways. Like you, I think that if you're going to have
    only one mirror command, then it needs to offer both choices. I tend to
    leave the standard command alone, and offer additional non-standard commands
    in addition to, not instead of, the native version. For instance we use
    several extra "flavors" of the mirror command...

    ;mirror yes -- skip the deletion prompt
    (defun c:my (/ sset pt1 pt2)
    (setq
    sset (ssget)
    pt1 (getpoint "\nFirst point of mirror line: ")
    pt2 (getpoint pt1 "\nSecond point: "))
    (command "mirror" sset "" pt1 pt2 "y")
    (princ))

    ;mirror vertical -- mirror about a vertical line, without deletion prompt
    (defun c:mv (/ sset pt1 pt2)
    (setq
    sset (ssget)
    pt1 (getpoint "\nPoint on vertical mirror line: "))
    (command "mirror" sset "" pt1 "@1<90" "y")
    (princ))

    The first version addresses the OP, the second is even more streamlined for
    one of our common drafting tasks. And we still have the unaltered mirror
    command.
     
    Tom Smith, Oct 26, 2004
    #6
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.