ketongin Posted October 26, 2011 Posted October 26, 2011 hi guys, How do I: 1) Select a mline and explode it. 2) "setq ent" the line which was picked to explode the mline. 3) "setq pt" using vlax-curve-getclosestpointto 4) All in one click of the mouse. Sorry guys, I'm having trouble expressing myself in english (and also in lisp) so I just enumerated. Thank you. Quote
pBe Posted October 26, 2011 Posted October 26, 2011 (defun c:test (/ TheLine Ent Npt) (vl-load-com) (setq theLine (entsel "\nSelect Mline: ")) (command "_explode" theLine) (setq Npt (vlax-curve-getClosestPointTo (setq Ent (vlax-ename->vla-object (car (nentselp (cadr TheLine)))) ) (cadr TheLine) ) ) (vla-highlight Ent :vlax-true) (print Npt) (princ) ) Quote
Lee Mac Posted October 26, 2011 Posted October 26, 2011 (vlax-ename->vla-object (car (nentselp (cadr TheLine)))) Be careful if other objects surround the MLine, it would be difficult to guarantee the correct entity will be selected using nentselp Maybe this old code will offer some ideas Quote
pBe Posted October 26, 2011 Posted October 26, 2011 (mapcar '(lambda ( x ) (ssadd x ss)) [color=blue][b](_Entnext el)[/b][/color]) (defun _Entnext ( e ) (if (setq e (entnext e)) (cons e (_Entnext e))) ) Very nice, it works for blocks as well, it gave me an idea for a routine i'm working on regarding block layers Cool Beans. Thanks Lee. Quote
pBe Posted October 26, 2011 Posted October 26, 2011 Hope you dont mind if i "borrow" your _Entnext routine for a while till i write my own version Again, Thank you my friend Quote
Lee Mac Posted October 26, 2011 Posted October 26, 2011 Hope you dont mind if i "borrow" your _Entnext routine for a while till i write my own version Again, Thank you my friend Its only two lines of code... go ahead I appreciate the courtesy of asking before taking. 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.