Jump to content
ryankevin15

M2P and FROM Command Modifiers Using LSP

Recommended Posts

ryankevin15

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

Share this post


Link to post
Share on other sites
BIGAL

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

Share this post


Link to post
Share on other sites
SLW210

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

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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