Jump to content

M2P and FROM Command Modifiers Using LSP


ryankevin15

Recommended Posts

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 by ryankevin15
Link to comment
Share on other sites

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 by BIGAL
Link to comment
Share on other sites

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