NoelStalker Posted October 20, 2008 Share Posted October 20, 2008 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 20, 2008 Share Posted October 20, 2008 (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! Quote Link to comment Share on other sites More sharing options...
CAB Posted October 20, 2008 Share Posted October 20, 2008 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") ) Quote Link to comment Share on other sites More sharing options...
NoelStalker Posted October 20, 2008 Author Share Posted October 20, 2008 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. Quote Link to comment Share on other sites More sharing options...
NoelStalker Posted October 20, 2008 Author Share Posted October 20, 2008 CAB - woohoo! That works. This is great. I see how I could define a function for any number of combinations. Thank you very much. Quote Link to comment Share on other sites More sharing options...
CAB Posted October 20, 2008 Share Posted October 20, 2008 You're welcome. Lee's function could be changed to this: (defun c:era () (command "_dist" "_nea" pause "_per" pause) (print (getvar "distance")) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 20, 2008 Share Posted October 20, 2008 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. Quote Link to comment Share on other sites More sharing options...
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.