samifox Posted December 17, 2013 Posted December 17, 2013 Hi my problem is like this : in some points in my script the lisp generate a line, than i ask the user to set a point in a specific location , the point than has to project toward the line in a perpendicular angle , and than perform break on the intersected point. i have no clue how to do it or if its even possible see attchment Thanks in advance Shay Quote
MSasu Posted December 17, 2013 Posted December 17, 2013 Please check the vlax-curve-getClosestPointTo function; the shortest distance from a point to a line is its projection on said line (the perpendicular). Quote
pBe Posted December 17, 2013 Posted December 17, 2013 (defun c:demo () (command "_.line" "\\" "\\" "") (setq lin (entlast)) (command "_point" "\\") (setq p (vlax-curve-getClosestPointTo lin (getvar 'lastpoint))) (command "_break" lin "_non" (setq p (vlax-curve-getClosestPointTo lin (getvar 'lastpoint))) "_non" p ) ) EDIT: Oops. Msasu beat me to it anyhoo try the demo code Quote
samifox Posted December 17, 2013 Author Posted December 17, 2013 thank you what is "\\" ? (cant excute right now) Quote
samifox Posted December 17, 2013 Author Posted December 17, 2013 i think there is aproblem with `lastpoint Quote
samifox Posted December 17, 2013 Author Posted December 17, 2013 im using cad 2010 its "lastpoint" that works Thanks again Shay Quote
Tharwat Posted December 17, 2013 Posted December 17, 2013 thank youwhat is "\\" ? (cant excute right now) Replace it with pause and try again . Quote
samifox Posted December 17, 2013 Author Posted December 17, 2013 Replace it with pause and try again . i see thanx 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.