Dayananda Posted July 27, 2022 Posted July 27, 2022 (command "line""non"p1"non"p2""); 1: 1.5 filling line (setq ent1 (entlast)) (setq ent2 (car(entsel "\nSelect existing ground line"))) (command "trim"ent2""ent1"") Quote
mhupp Posted July 27, 2022 Posted July 27, 2022 (edited) Compare the new endpoints of ent1 to p1 and p2 one will match the one that doesn't is the new trim point. -edit You could also use visual lisp. might need to use (vl-load-com) (setq pt (vla-intersectwith (vlax-ename->vla-Object ent1) (vlax-ename->vla-Object ent2) acextendnone)) (setq pt (vlax-safearray->List (vlax-variant-vaLue pt))) Edited July 27, 2022 by mhupp 1 Quote
Dayananda Posted July 27, 2022 Author Posted July 27, 2022 3 hours ago, mhupp said: (setq pt (vla-intersectwith (vlax-ename->vla-Object ent1) (vlax-ename->vla-Object ent2) acextendnone)) (setq pt (vlax-safearray->List (vlax-variant-vaLue pt))) Your code is working perfect. but in some case the decimals are round off. how can I solve this. I mean when I select a small line using entsel the final result is coordinates of both end are same. Picture attached. (units meters) Quote
mhupp Posted July 27, 2022 Posted July 27, 2022 (edited) I Think that has something to do with how you setup the drawing or created the line. entsel doesn't round numbers. in this example my linear precision is set to 4 but still shows 13 digits for 10 & 11 points Edited July 27, 2022 by mhupp 2 Quote
BIGAL Posted July 28, 2022 Posted July 28, 2022 Like mhupp if you look at a point X Y Z etc (rtos (car pt) 2 6) will display X with 6 decimal's. 1 Quote
Dayananda Posted July 28, 2022 Author Posted July 28, 2022 Anyway the display is rounded off no effect to the calculation. So it was not harm. Quote
Dayananda Posted July 28, 2022 Author Posted July 28, 2022 18 hours ago, mhupp said: Compare the new endpoints of ent1 to p1 and p2 one will match the one that doesn't is the new trim point. -edit You could also use visual lisp. might need to use (vl-load-com) (setq pt (vla-intersectwith (vlax-ename->vla-Object ent1) (vlax-ename->vla-Object ent2) acextendnone)) (setq pt (vlax-safearray->List (vlax-variant-vaLue pt))) I am in a trouble again. When two lines are not intersect each other I cant proceed to next level. Pl. help Quote
mhupp Posted July 28, 2022 Posted July 28, 2022 Change how you see fit (setq pt (vla-intersectwith (vlax-ename->vla-Object ent1) (vlax-ename->vla-Object ent2) acextendnone)) ;change option here (setq pt (vlax-safearray->List (vlax-variant-vaLue pt))) current acextendnone - Do not extend entity's other options acextendthisentity - Extend ent1 to meet ent2 acextendotherentity - Extend ent2 to meet ent1 acextendboth - Extend both entity's 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.