ryankevin15 Posted February 7, 2018 Posted February 7, 2018 (edited) Hello, is there a way to combine the move command with the M2P or FROM command modifiers using LISP? I would want these to be two separate commands. Ideally I would like to program F1 to do _m2p during an active line command and F2 to do from during an active line command... but I'll settle for a lisp that combines each with the move command since I'll be doing that most frequently. Thank you in advance! P.S. here is code that will draw a line starting at M2P.. sort of a start. (defun c:v (/ p1 p2 mid) (if (and (setq p1 (getpoint "\nSpecify 1st point of MID :")) (setq p2 (getpoint "\nSpecify 2nd point of MID :" p1)) (setq mid (mapcar '(lambda (q p) (/ (+ q p) 2.)) p1 p2)) ) (command "_.pline" "_none" mid) ) (princ) ) Edited February 7, 2018 by ryankevin15 Quote
BIGAL Posted February 8, 2018 Posted February 8, 2018 (edited) Maybe some thing like this need to autoload. (defun c:2 (/ p1 p2 mid) (if (and (setq p1 (getpoint "\nSpecify 1st point of MID :")) (setq p2 (getpoint "\nSpecify 2nd point of MID :" p1))) (setq mid (mapcar '(lambda (q p) (/ (+ q p) 2.)) p1 p2)) ) ) To run say LINE '2 pick 2pts next point etc '2 as required. Using a none for snaps means you dont find the ends for the half point. Looking into 1/4 etc the other thing to look at is CAL it has a number of functions very few people use it but it can do a lot of this type of thing. Edited February 8, 2018 by BIGAL Quote
SLW210 Posted February 8, 2018 Posted February 8, 2018 Please read the Code Posting Guidelines and edit your Code to be included in Code Tags not Quote Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here 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.