Jump to content

Recommended Posts

Posted

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?

Posted

AutoCAD 2005? Is there a M2P or MTP command?

 

M2P (a command modifier).

 

"Locates the midpoint between two points."

 

Check your AutoCAD Help files.

Posted

That Doesn't Work.... Would Be Nice

Posted

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.

Posted

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

Posted

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'~

Posted
fixo is the $#!t !!!! you will save me hours a month now thank you so much!!!!
Posted
fixo is the $#!t !!!! you will save me hours a month now thank you so much!!!!

You're welcome

Cheers :D

 

~'J'~

Posted

I thought M2P was around in '05. When did it become available?

Posted

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*

Posted

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;

Posted

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 :D

Posted
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 :D

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...