Jump to content

How 2 measure 2 points with one command without OSNAP


Recommended Posts

Posted

Hello everyone, I looked through the threads and didn't see anything about this. At the last place I worked I used to be able to type "ERA" and it worked like the distance command except that it turned on "nearest" OSNAP for the first point and then turned it off and turned on "perpendicular" for the second point. I Could also type "EEE" and it would do endpoint for both points or "ECC" and it would look for the center point for both points. "ECA" for center to perpendicular and etc.

 

Is there a lisp out there that I could use to do this. I dislike having to type "DIST" then "NEA" and then "PER". I dislike using OSNAP even more. I also do not like having to use my center mouse button. I really enjoyed being able to type one command and pick my points.

Posted

(defun c:era ()
   (command "_dist"
       "_nea"
       pause
       "_per"
       pause
   ) ; end dist
   (princ)
)

(defun c:eee ()
   (command "_dist"
       "_end"
       pause
       "_end"
       pause
   ) ; end dist
   (princ)
)

(defun c:ecc ()
   (command "_dist"
       "_mid"
       pause
       "_mid"
       pause
   ) ; end dist
   (princ)
)

(defun c:eca ()
   (command "_dist"
       "_mid"
       pause
       "_per"
       pause
   ) ; end dist
   (princ)
)

Hope this helps! :)

Posted

To see the distance on the commad line try this:

(defun c:ERA()
 (command "._dist" "_nea" pause "_per")
)
(defun c:EEE()
 (command "._dist" "_end" pause "_end")
)

Posted

LeeMac - thanks for the response! It works in so far as it automatically loads the osnap that I want but it does not give me the distance value after the command is over.

Posted

CAB - woohoo! That works. This is great. I see how I could define a function for any number of combinations. Thank you very much.

Posted

You're welcome.

Lee's function could be changed to this:

(defun c:era ()
  (command "_dist" "_nea" pause "_per" pause)
  (print (getvar "distance"))
  (princ)
)

Posted

Sorry about that, I typed them up pretty quickly and forgot to include the line to display the distance! It is displayed if you scroll earlier in the command line history, but just alter the code as Charles pointed out to improve it. :)

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...