New Lisp

Discussion in 'AutoCAD' started by Heath, Feb 12, 2004.

  1. Heath

    Heath Guest

    I am looking for a LISP routine that will allow me to bisect the distance
    between 2 points then set that point as my mid point to mirror around.
    Basically I want to mirror object around a mid point without having a line
    present. I have started writing it but I am stumped so far and would liek
    to see if anyone can help

    Thx.
     
    Heath, Feb 12, 2004
    #1
  2. Heath

    Jeff Mishler Guest

    Even though you asked for a lisp solution in the VBA newsgroup, I guess
    I can still help.....

    (setq mid_pt (polar pt1 (angle pt1 pt2) (/ (distance pt1 pt2) 2)))

    Jeff
     
    Jeff Mishler, Feb 12, 2004
    #2
  3. Heath

    Kerry B Guest

    This may suit you.

    (defun f:midpoint (p0 p1 /)
    (mapcar '(lambda (ord1 ord2) (* (+ ord1 ord2) 0.5)) p0 p1)
    )


    --
    Kerry B - Mr. Incognito

    opinions are never 100% correct. if they were, they'd be facts.
    warning : -i lash out and strike people at random.-

    - do the simplest thing possible, but no simpler. : einstein -
     
    Kerry B, Feb 12, 2004
    #3
  4. You don't need any customization - you use the built in calculator
    program. Use these steps:

    1.Start Mirror and work til the pick point is asked for
    2.type in 'CAL and hi enter
    3.type in (cur+cur)/2
    4.got your point

    You can automate this by adding a button with this string EXACTLY:

    'cal;(cur+cur)/2;
    ___________________________
    Mike Tuersley
    CADalyst's AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Feb 13, 2004
    #4
  5. Heath

    Se7en Guest

    Isnt lisp a built in calculator too? (Sorry man, i had to say it. I'm
    just messing with ya though. :)~ )

    Kerry i played arround with your procedure a little. Heres the mutant
    in all its uglyness:
    ***
    (defun MidPoint (/ pts p0 p1)
    (defun getpoin7 (strPrompt)
    (while (not (setq x (getpoint strPrompt)))
    (princ "\nYou did not select a point, please try again. "))
    x)
    (setq pts (list (getpoin7 "\nEnter first point: ")
    (getpoin7 "\nEnter Second point: ")))
    (setq p0 (nth 0 pts) p1 (nth 1 pts))
    (mapcar '(lambda (ord1 ord2) (* (+ ord1 ord2) 0.5)) p0 p1)
    )
    ***


    --
    Se7en - May contain traces of peanut

    Twist of fate; wont give me a break, & myself I'm slow and tired. Ive
    got to rise with these blood-shot eyes but I'll keep falling when I'm
    higher. Albatross, fly on. ...Fly on'!' (http://theswamp.org/se7en/)
     
    Se7en, Feb 13, 2004
    #5
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.