onzki Posted July 9, 2010 Posted July 9, 2010 I am always caught in situation where I need to mirror using "Mid between 2 Points" that's why I am looking for a shortcut. Is there an Lisp for the following sequence: 1. MIRROR 2. Mid between 2 Points 3. (now, I select the 2 points) 4. Finally, automatically answers "N" to the question (erase source object?) That's it, I attached an image for reference. Thank you! Uploaded with ImageShack.us Quote
Lt Dan's legs Posted July 9, 2010 Posted July 9, 2010 I am always caught in situation where I need to mirror using "Mid between 2 Points" that's why I am looking for a shortcut. Is there an Lisp for the following sequence: (defun c:test (/ ss ) (setq ss (ssget)) (command "._mirror" ss "" "mtp" pause pause "@1<90" "n") ) this works but wait for a better way:lol: ____ I sorry for my "ghettoway" definition. I thought I'd have a little fun but decided against it. Quote
Lt Dan's legs Posted July 9, 2010 Posted July 9, 2010 [quote=Lt Dan's legs;340979this works but wait for a better way:lol: (defun c:test (/ ss p1 p2) (setq ss (ssget)) (setq p1 (getpoint "\nSpecify first point: ")) (setq p2 (getpoint "\nSpecify second point: ")) (setvar "CMDECHO" 0) (command "._mirror" ss "" "mtp" p1 p2 "@1<90" "n") (setvar "CMDECHO" 1) (PRINC) ) A little better but I'm sure someone will blow this one out of the water. Quote
Lt Dan's legs Posted July 9, 2010 Posted July 9, 2010 I think the m2p snap is the best option. What's the difference between m2p/mtp? Quote
Lee Mac Posted July 9, 2010 Posted July 9, 2010 What's the difference between m2p/mtp? Probably nothing Quote
Lt Dan's legs Posted July 9, 2010 Posted July 9, 2010 for some reason I thought you said m2p is better. I'm in desperate need of caffeine!! Quote
Lee Mac Posted July 9, 2010 Posted July 9, 2010 for some reason I thought you said m2p is better. I'm in desperate need of caffeine!! Nah, I just meant instead of writing a whole LISP, just use Mirror with the m2p/mtp snap. Quote
onzki Posted July 13, 2010 Author Posted July 13, 2010 @Lt. Dan's Legs: Thanks for sharing the code. However, I noticed it only mirrors horizontally (side by side), even when two points are vertical. Is it still possible to tweak this one to be more flexible in mirroring both horizontal/vertical depending on the points I select. By the way, If it would be easier- I am okay of having two LISP one for horizontal (what we have above), other one for vertical. Thanks! Quote
gile Posted July 13, 2010 Posted July 13, 2010 Hi, This one uses the bissector (perpendicular to the midlle of the segment) of the two points as axis for the mirror. (defun c:test (/ ss p1 p2 mid p3) (and (setq ss (ssget)) (setq p1 (getpoint "\nFirst point: ")) (setq p2 (getpoint p1 "\nSecond point: ")) (setq mid (mapcar '(lambda (x1 x2) (/ (+ x1 x2) 2.)) p1 p2)) (setq p3 (polar mid (+ (angle p1 p2) (/ pi 2.)) 1.)) (command "_.mirror" ss "" "_non" mid "_non" p3 "_no") ) (princ) ) Quote
onzki Posted July 13, 2010 Author Posted July 13, 2010 Hi, This one uses the bissector (perpendicular to the midlle of the segment) of the two points as axis for the mirror. Amazing, this is very helpful. Thanks for sharing! Quote
Lt Dan's legs Posted July 13, 2010 Posted July 13, 2010 Hi, This one uses the bissector (perpendicular to the midlle of the segment) of the two points as axis for the mirror. (defun c:test (/ ss p1 p2 mid p3) (and (setq ss (ssget)) (setq p1 (getpoint "\nFirst point: ")) (setq p2 (getpoint p1 "\nSecond point: ")) (setq mid (mapcar '(lambda (x1 x2) (/ (+ x1 x2) 2.)) p1 p2)) (setq p3 (polar mid (+ (angle p1 p2) (/ pi 2.)) 1.)) (command "_.mirror" ss "" "_non" mid "_non" p3 "_no") ) (princ) ) Nice gile. As you can tell I'm a beginner & wasn't sure how I was going to do the angle. Quote
mdbdesign Posted July 13, 2010 Posted July 13, 2010 http://www.nyacad.com/QuickMirror/QuickMirror.html Try this one. Now can't live without it. Quote
onzki Posted July 14, 2010 Author Posted July 14, 2010 http://www.nyacad.com/QuickMirror/QuickMirror.htmlTry this one. Now can't live without it. Thanks, lots of free stuff too. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.