macros55 Posted June 21 Author Posted June 21 Mr Tusky, I appreciate you, realy it is a good job. Thanks So how do choose those who touch the blocks? Quote
Tsuky Posted June 21 Posted June 21 For blocks you are forced to use the code I edited which only processes the selected entity: the reason is that I use (nentsel) to retrieve the nested entity, which I cannot do with a (ssget) as in the code I put in the attached file. Quote
macros55 Posted June 24 Author Posted June 24 (edited) Gentlman, @BIGAL, @Tsuky, @exceed thanks a lot of. Edited June 24 by macros55 Quote
exceed Posted June 25 Posted June 25 If touch means only requires accuracy at the level of a rectangle circumscribing the selected object. It can be implemented simply like this. ; TOUCHSEL - exceed 2024.06.25 ; Selects all objects that touch the selected object's bounding boxes. (defun c:TOUCHSEL ( / ss ssl i ss_all ent obj bbox llp urp ss2 ss2l j ent2 ) (vl-load-com) (if (setq ss (ssget)) (progn (setq ssl (sslength ss)) (setq i 0) (setq ss_all (ssadd)) (repeat ssl (setq ent (ssname ss i)) (setq obj (vlax-ename->vla-object ent)) (setq bbox (vla-getboundingbox obj 'll 'ur)) (setq llp (vlax-safearray->list ll)) (setq urp (vlax-safearray->list ur)) (if (setq ss2 (ssget "C" llp urp)) (progn (setq ss2l (sslength ss2)) (setq j 0) (repeat ss2l (setq ent2 (ssname ss2 j)) (setq ss_all (ssadd ent2 ss_all)) (setq j (+ j 1)) ) ) ) (setq i (+ i 1)) ) (sssetfirst nil ss_all) ) ) (princ) ) 1 Quote
macros55 Posted June 25 Author Posted June 25 Mr@exceed, it is a great job thank you very much, 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.