KRBeckman Posted February 17, 2010 Posted February 17, 2010 Is there a way to have a line connect the last point selected with the current location of the mouse when you're picking points while in a lisp routine? Kinda like when you're drawing a line there's a line (I think I've seen this called a "Rubberband") between the last selected point and where the mouse is currently located. Quote
Lee Mac Posted February 17, 2010 Posted February 17, 2010 Something like? (setq p1 (getpoint "\nPt: ") p2 (getpoint "\nPt: " p1)) Quote
KRBeckman Posted February 17, 2010 Author Posted February 17, 2010 Can this be taken further? If there are 4 points being selected, and have a line connecting point 1 to 2, 2 to 3, and 3 to 4? Quote
Lee Mac Posted February 17, 2010 Posted February 17, 2010 You might have to look into grvecs/grdraw for that Quote
The Buzzard Posted February 17, 2010 Posted February 17, 2010 Can this be taken further? If there are 4 points being selected, and have a line connecting point 1 to 2, 2 to 3, and 3 to 4? Try this: (defun C:DL (/ PT01 PT02) (setq PT01 (getpoint "\nSpecify line starting point: ")) (while (/= nil (setq PT02 (getpoint PT01 "\nSpecify line ending point: "))) (command "._line" PT01 PT02 "") (setq PT01 PT02)) (princ)) Quote
Lee Mac Posted February 17, 2010 Posted February 17, 2010 Another Example: (defun c:test (/ GetPoints LWPoly lst) (defun GetPoints (str1 str2 / pts pt) ;; Lee Mac ~ 17.02.10 (if (car (setq pts (list (getpoint str1)))) (while (setq pt (getpoint str2 (car pts))) (mapcar (function (lambda (from to) (grdraw from to 3 0))) (reverse (cdr (setq pts (cons pt pts)))) (cdr (reverse pts))))) (redraw) (reverse pts)) (defun LWPoly (lst cls) (entmakex (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 (length lst)) (cons 70 cls)) (mapcar (function (lambda (p) (cons 10 p))) lst)))) (and (setq lst (GetPoints "\nSelect First Point: " "\nNext Point: ")) (LWPoly lst 0)) (princ)) 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.