Engineer_Yasser Posted October 19 Posted October 19 (foreach pnt (vlax-invoke (vlax-ename->vla-object (car (entsel))) 'intersectwith (vlax-ename->vla-object (car (entsel))) acextendnone) (entmake (list (cons 0 "POINT") (cons 10 pnt))) ) Please help , This Code is Not Working in The Attached Example File., I don't know why !! it works for other polyline intersections except for these in the example file Note: I can't use ( acextendboth ) I need to insert a point at a real intersection, not an extended intersection Test Intersections.dwg Quote
Tsuky Posted October 19 Posted October 19 You simply don't have an intersection! What deceives you; is that you have arc segments and with the graphics resolution it appears to you that you have an intersection. But if you zoom in very hard to the supposed intersection and do a forced REGEN, you will see that the arc deviates from your straight segment. Also your code is not reliable, here is my proposal: ((lambda ( / pnt lst_pt) (setq pnt (vlax-invoke (vlax-ename->vla-object (car (entsel))) 'intersectwith (vlax-ename->vla-object (car (entsel))) acextendnone)) (if pnt (if (> (length pnt) 3) (repeat (/ (length pnt) 3) (setq lst_pt (cons (list (car pnt) (cadr pnt) (caddr pnt)) lst_pt) pnt (cdddr pnt) ) ) (setq lst_pt (cons pnt lst_pt)) ) ) (foreach pnt lst_pt (entmake (list (cons 0 "POINT") (cons 10 pnt)))) )) Quote
Engineer_Yasser Posted October 19 Author Posted October 19 1 hour ago, Tsuky said: You simply don't have an intersection! What deceives you; is that you have arc segments and with the graphics resolution it appears to you that you have an intersection. But if you zoom in very hard to the supposed intersection and do a forced REGEN, you will see that the arc deviates from your straight segment. Also your code is not reliable, here is my proposal: ((lambda ( / pnt lst_pt) (setq pnt (vlax-invoke (vlax-ename->vla-object (car (entsel))) 'intersectwith (vlax-ename->vla-object (car (entsel))) acextendnone)) (if pnt (if (> (length pnt) 3) (repeat (/ (length pnt) 3) (setq lst_pt (cons (list (car pnt) (cadr pnt) (caddr pnt)) lst_pt) pnt (cdddr pnt) ) ) (setq lst_pt (cons pnt lst_pt)) ) ) (foreach pnt lst_pt (entmake (list (cons 0 "POINT") (cons 10 pnt)))) )) Thanks for replying ... I tried the code but it gave ( nil ), I also checked the intersection and zoomed as far as I could and I saw the intersection Quote
Tsuky Posted October 19 Posted October 19 If the function returns nil, no intersection was found! To see that your segment is not touching the arc, it may be necessary to repeat the operation several times (because the gap is very small): zoom -> regen Quote
Engineer_Yasser Posted October 19 Author Posted October 19 7 minutes ago, Tsuky said: If the function returns nil, no intersection was found! To see that your segment is not touching the arc, it may be necessary to repeat the operation several times (because the gap is very small): zoom -> regen If there is a gap .. when I try to make ( Extend ) it will accept Quote
Tsuky Posted October 19 Posted October 19 Quite! but you say: Quote Note: I can't use ( acextendboth ) I need to insert a point at a real intersection, not an extended intersection You are within detection limits... Either you agree to have expanded intersections, or you ban them, it's your choice! 1 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.