Hudson Posted August 25, 2009 Share Posted August 25, 2009 Is the most efficient to do this to test every point on the arc in a loop? Or is there a better way? Thanks for any and all input Andrew Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 25, 2009 Share Posted August 25, 2009 Look into vlax-curve-getClosestPointto Quote Link to comment Share on other sites More sharing options...
Hudson Posted August 25, 2009 Author Share Posted August 25, 2009 Look into vlax-curve-getClosestPointto Thanks! I figured making a brute force loop wouldn't be the best way Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 25, 2009 Share Posted August 25, 2009 As an example: (defun c:test (/ pt ent cLs) (vl-load-com) (if (and (setq ent (car (entsel "\nSelect an Object: "))) (setq pt (getpoint "\nSelect a Point to Test: "))) (progn (setq cLs (vlax-curve-getClosestPointto ent pt)) ;; -- Display Point -- (setvar "PDMODE" 34) (vla-addPoint (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-3D-point cLs)))) (princ)) Quote Link to comment Share on other sites More sharing options...
khoshravan Posted December 19, 2011 Share Posted December 19, 2011 Look into vlax-curve-getClosestPointto What is VLAX? Is this a Cad command name? Quote Link to comment Share on other sites More sharing options...
BlackBox Posted December 19, 2011 Share Posted December 19, 2011 If memory serves VLAX specifies a Visual LISP ActiveX function prefix. ... It (my memory) didn't. See next post. ** Edit - Just wanted to get my guess in before Lee's (correct) answer. LoL Quote Link to comment Share on other sites More sharing options...
BlackBox Posted December 19, 2011 Share Posted December 19, 2011 Aha... Found it! Lee's post here clarifies the different function prefixes that Visual LISP uses. Quote Link to comment Share on other sites More sharing options...
khoshravan Posted December 20, 2011 Share Posted December 20, 2011 Aha... Found it! Lee's post here clarifies the different function prefixes that Visual LISP uses. Thanks. They are far beyond my knowledge and I don't think I can use them. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted December 20, 2011 Share Posted December 20, 2011 Thanks. They are far beyond my knowledge and I don't think I can use them. Not at all... It may just take some time to understand how they work, and how to properly use them. Have you tried Lee's code in post #4? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 20, 2011 Share Posted December 20, 2011 Have you tried Lee's code in post #4? at my old coding style... 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.