Efeezy Posted April 28, 2010 Posted April 28, 2010 I Use The Rectangle Command For Corner To Corner In A Room. Then I Have To Add 2 Lines Corner To Corner To Make An X To Find The Center Of The Rectangle. Is The A Lisp Or A Fast Way To Do This? Quote
ReMark Posted April 28, 2010 Posted April 28, 2010 AutoCAD 2005? Is there a M2P or MTP command? M2P (a command modifier). "Locates the midpoint between two points." Check your AutoCAD Help files. Quote
CJJ Posted April 28, 2010 Posted April 28, 2010 Really the X is unnecessary, you could just draw a diagonal line and snap to its midpoint. Probably not much help, but it will save you a few seconds every time because now you'll only have to draw/delete one line instead of two. Quote
ReMark Posted April 28, 2010 Posted April 28, 2010 Pick from one of the routines included in this discussion. http://discussion.autodesk.com/forums/thread.jspa?threadID=416112 Quote
Efeezy Posted April 28, 2010 Author Posted April 28, 2010 I Know That I Just Need Something That Makes A Mid Point In The Center Of A Rectangle To Snap To. I Would Save Me Alot Of Time Quote
fixo Posted April 28, 2010 Posted April 28, 2010 Try this one too (defun C:RECX (/ pts) (command "._rectangle") (while (/= 0 (logand 1 (getvar 'cmdactive))) (command pause)) (setq pts (vl-remove-if 'not (mapcar (function (lambda(x) (if (= 10 (car x))(trans (cdr x) 0 1)))) (entget(entlast))))) (command "._line" "_non" (car pts)"_non" (caddr pts) "") (command "._line" "_non" (cadr pts)"_non" (last pts) "") (princ) ) ~'J'~ Quote
Efeezy Posted April 28, 2010 Author Posted April 28, 2010 fixo is the $#!t !!!! you will save me hours a month now thank you so much!!!! Quote
fixo Posted April 28, 2010 Posted April 28, 2010 fixo is the $#!t !!!! you will save me hours a month now thank you so much!!!! You're welcome Cheers ~'J'~ Quote
alanjt Posted April 28, 2010 Posted April 28, 2010 I thought M2P was around in '05. When did it become available? Quote
alanjt Posted April 28, 2010 Posted April 28, 2010 Here, try this as a replacement for M2P since it's not available for you. (defun c:M2P (/ p1 p2) ;; Midpoint Between Two Points (for older CAD versions) ;; Alan J. Thompson, 04.28.10 (vl-load-com) (if (zerop (getvar 'cmdactive)) (princ "\nMust be called from within another command.") (and (setq p1 (getpoint "\nFirst point of mid: ")) (setq p2 (getpoint p1 "\nSecond point of mid: ")) ((lambda (p) (vla-sendcommand (cond (*AcadDoc*) ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) ) (strcat "_non " (car p) "," (cadr p) "," (caddr p) " ") ) ) (mapcar (function (lambda (x) (rtos x 2 16))) (mapcar (function (lambda (a b) (/ (+ a b) 2.))) p1 p2) ) ) ) ) (princ) ) Call it transparently within a command. eg. Command: l LINE Specify first point: 'm2p First point of mid: Second point of mid: Specify first point: Specify first point: _non 10343.53278729567,10349.24066037932,0 Specify next point or [undo]: *Cancel* Quote
alanjt Posted April 28, 2010 Posted April 28, 2010 Ah hah! I just found where I had it written down. Before the days of M2P, you could put this in your toolbar: _non;'cal (cur + cur)/2; Quote
MichaelJ07 Posted April 29, 2010 Posted April 29, 2010 alanjt, I've been looking for something like that little button routine for longer than I care to state here. Thanks for posting it. You folks are good to us old ones Quote
alanjt Posted April 29, 2010 Posted April 29, 2010 alanjt, I've been looking for something like that little button routine for longer than I care to state here. Thanks for posting it. You folks are good to us old ones You're very welcome. I was hoping someone would find it useful and now you have two options. I'm especially happy now that I dug around for the text file I had that written down in. Happy CAD'ing. 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.