Mirror an object using the CAL command to find midpoint

Discussion in 'AutoCAD' started by Michael Viscetto, Dec 6, 2004.

  1. Happy Holidays Y'all.
    I am using the button macro 'cal (int+int)/2;
    To find the midpoint between two intersections.
    This works great if I want to draw a line or something.
    What I have run into is wanting to mirror an object between two intersections but this little macro does not work.
    Are there some steroids I can give it to give it that extra little boost it needs?
    I have tried this one as well 'cal;(cur+cur)/2; to no avail.

    Thank you
    Michael
     
    Michael Viscetto, Dec 6, 2004
    #1
  2. Michael Viscetto

    T.Willey Guest

    This is how I do it. Then I set up a button to call " 'bi ", and it works.

    Tim

    (defun c:BI(/ po1 po2 os1 po3)
    (initget 1)
    (setq po1(getpoint "\nFirst point: "))
    (setq po2(getpoint po1 "\nSecond point: "))
    (setq os1(getvar "osmode"))
    (setvar "osmode" 0)
    (setq po3 (mapcar '(lambda (a b) (/ (+ a b) 2.0)) po1 po2))
    (vl-cmdf po3)
    (setvar "osmode" os1)
    (princ)
    )
     
    T.Willey, Dec 6, 2004
    #2
  3. Tim
    That seems to work great.
    Thank you
     
    Michael Viscetto, Dec 6, 2004
    #3
  4. Michael Viscetto

    T.Willey Guest

    Happy to help, glad it works for you.

    Tim
     
    T.Willey, Dec 6, 2004
    #4
  5. not to sure what you're doing, but i use 'CAL (CUR+CUR)/2; which is
    exactly what you've got, and it works fine... i run this off the
    CONTROL+RIGHTCLICK menu (aux3)

    just check to make sure you don't have ^c^c in front of the macro


    intersections but this little macro does not work.
     
    Mark Dubbelaar, Dec 8, 2004
    #5
  6. Thanks for the input.
    You are right I had the ^c^c in front and that must have been canceling out the command (like it is supposed to do) Thanks.
    Although I have been using that LISP routine for the last few days and it seems to be working very well.
    My cup runneth over.

    Thank you
     
    Michael Viscetto, Dec 10, 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.