Small Fish Posted October 22, 2009 Posted October 22, 2009 I have a shape roughly the shape of a circle and there is a line drawn through it - so there are two intersection points. I want to find the 2 values of these intersection points how is it done? I have written code below however pt1 is a variant (2 values) I want 2 separate values. How is it done? Thanks (setq enaPline(car (entsel "\nSelect shape : "))) ObjName1 (vlax-ename->vla-object enaPline)) enaLine(car (entsel "\nSelect line : "))) ObjName2 (vlax-ename->vla-object enaLine)) Pt1 (vlax-safearray->list (vlax-variant-value (vla-IntersectWith ObjName1 ObjName2 acExtendNone)))) Quote
MSasu Posted October 22, 2009 Posted October 22, 2009 First, please take care that your code has a lot of unbalanced right parenthesis (one on each row)! Second, use the above to subtract required sub-lists (rename the variables as you want): (setq InsPoint1st (list (car Pt1) (cadr Pt1) (caddr Pt1)) InsPoint2nd (cdddr Pt1)) Regards, Quote
ronjonp Posted October 22, 2009 Posted October 22, 2009 Assuming there are only 2 intersect points...here is another way to do it: (setq enapline (car (entsel "\nSelect shape : ")) objname1 (vlax-ename->vla-object enapline) enaline (car (entsel "\nSelect line : ")) objname2 (vlax-ename->vla-object enaline) pts (vlax-invoke objname1 "intersectwith" objname2 acextendnone) pt1 (reverse (cdddr (reverse pts))) pt2 (cdddr pts) ) Quote
Small Fish Posted October 23, 2009 Author Posted October 23, 2009 Many Thanks - that worked well cheers SM 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.