lubracali Posted February 7, 2011 Share Posted February 7, 2011 I'm trying to figure out how to find the nearest point of a line to another line, but I can not find the right approach. The lines do not intersect, but at a point are very close. I should write something to tell me the coordinates of this point. The two lines are drawn in 3D and are skew. I need some ideas on how to tackle the problem. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 7, 2011 Share Posted February 7, 2011 Hope this help you out with what you looking forward . (vl-load-com) (setq ss (vlax-ename->vla-object (setq e (car (entsel "\n Select First Line :"))))) (setq ss1 (vlax-ename->vla-object (setq e1 (car (entsel "\n Select Second Line :"))))) (setq pt (vlax-curve-getClosestPointTo ss (cdr (assoc 10 (entget e1))))) Tharwat Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 7, 2011 Share Posted February 7, 2011 http://www.theswamp.org/index.php?topic=23170.60 Quote Link to comment Share on other sites More sharing options...
designerstuart Posted February 7, 2011 Share Posted February 7, 2011 was this post an accident? see here.... http://www.cadtutor.net/forum/showthread.php?56687-VBA-Autocad-The-shortest-distance-between-two-lines Quote Link to comment Share on other sites More sharing options...
lubracali Posted February 7, 2011 Author Share Posted February 7, 2011 I think I had two windows open on the forum I posted by mistake on both, this is the right place, my request is for vba and not for lisp. I apologize now in the other post. We can continue here. Quote Link to comment Share on other sites More sharing options...
lubracali Posted February 7, 2011 Author Share Posted February 7, 2011 I apologize for posting in wrong section. My question is about VBA and do not lisp. I thank those who answered me, I will try also to learn lisp. Maybe a moderator can close? I apologize again. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted February 7, 2011 Share Posted February 7, 2011 I merged the threads. The responses involving LISP my help others so I will leave that. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 8, 2011 Share Posted February 8, 2011 Maybe a help drew an arc that crosses a pline and work out its intersection point ThisDrawing.Utility.GetEntity oPoly, snapPt, vbCr & "Select polyline :" Set arcobj = ThisDrawing.ModelSpace.AddArc(vertPt, cRad, endang, startang) retval2 = arcobj.IntersectWith(oPoly, acExtendOtherEntity) there is 4 different intersectwith options check help Quote Link to comment Share on other sites More sharing options...
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.