Engineer_Yasser Posted November 2, 2023 Posted November 2, 2023 (edited) (setq Pr_PolySelection (ssget)) (repeat (sslength Pr_PolySelection) (setq poly_Ent (ssname Pr_PolySelection 0)) (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object))) (vla-clear (vla-get-activeselectionset *AcadDoc*)) (vl-cmdf "_.pselect" poly_Ent "") ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< (setq Add nil Add (ssadd)) (vlax-for x (vla-get-activeselectionset *AcadDoc*) (vla-getboundingbox x 'P1 'P2) (setq P1 (vlax-safearray->list P1)) (setq P2 (vlax-safearray->list P2)) (and (setq Temp (ssget "_C" (trans (list (car P1) (cadr P2) 0.) 0 1) (trans (list (car P2) (cadr P1) 0.) 0 1) '((0 . "LWPOLYLINE")))) (ssdel poly_Ent Add) ) ) ) Any idea how to select poly_Ent before (vlax-for x (vla-get-activeselectionset without using (vl-cmdf "_.pselect" poly_Ent "") because it slow the code too much Edited November 2, 2023 by Engineer_Yasser Quote
Lee Mac Posted November 2, 2023 Posted November 2, 2023 Why not just use (setq x (vlax-ename->vla-object poly_Ent)) ? Quote
Engineer_Yasser Posted November 2, 2023 Author Posted November 2, 2023 (edited) 21 hours ago, Lee Mac said: Why not just use (setq x (vlax-ename->vla-object poly_Ent)) ? Thanks very much, it worked like a charm Edited November 3, 2023 by Engineer_Yasser Issue solved Quote
BIGAL Posted November 3, 2023 Posted November 3, 2023 (edited) "This is part of a Lisp to select touched polylines." Show say a dwg or image what is previous selection set. You can also do the repeat for items in a selection set much easier. (repeat (setq K (sslength Pr_PolySelection)) (setq polyent (ssname ss (setq k (1- k)))) .... ) If I understand you want a single bounding box of selected objects ? You seem to be doubling up on what your asking for. Edited November 3, 2023 by BIGAL 1 Quote
Engineer_Yasser Posted November 3, 2023 Author Posted November 3, 2023 4 hours ago, BIGAL said: "This is part of a Lisp to select touched polylines." Show say a dwg or image what is previous selection set. You can also do the repeat for items in a selection set much easier. (repeat (setq K (sslength Pr_PolySelection)) (setq polyent (ssname ss (setq k (1- k)))) .... ) If I understand you want a single bounding box of selected objects ? You seem to be doubling up on what your asking for. Good idea, I used it in the code, it's faster, Thanks 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.