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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×