Jump to content

Is there a way with touch a block select similar block in selected reign of drawing?


hosyn

Recommended Posts

Is there a way with touch a block select automatically similar block in selected reign of drawing via lisp code or command similar select? 8)

Link to comment
Share on other sites

hi hosyn, i'm not sure your meaning of touching,

Try this simple dxf filter function,

(issget e i); argument e=reference entity & i=dxf index to be filtered

;Single dxf index-match ssget filter 
(defun issget  (_e _id / ss i e1 e2 lst ss1 next)
 (if
 (not (setq ss (ssget)))
         (setq ss(ssget "X")))
 
 (if ss (progn
 (setq i 0)
 (repeat (sslength ss)
   (setq e1 (ssname ss i))
   (if (apply 'equal
              (foreach en  (list e1 _e )
                (setq lst (cons (mapcar '(lambda (x) (cdr (assoc x (entget en)))) (list 0 _id))
                                lst)) 		;setq
                ) 				;foreach
              ) 				;apply
   (setq ss1 (cons e1 ss1))
     ) 					;if 
   (setq i  (1+ i)
         lst nil))				;repeat
 (setq next (ssadd))
 (foreach e2 ss1 (ssadd e2 next)) 		;foreach
 )						;progn
 nil)						;if
  ) ; defun

Example: Just pick a single entity, then [ENTER] ,or manually select

_$ (sslength (issget (car(entsel)) 8 )) ;

44 ;

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...