Jump to content

Recommended Posts

Posted

hello:

I use this routine

Quote
(defun c:SIMI ( / sset)
   (if (/= (setq sset (ssget "_I")) nil)
     (setq hnd (ssname sset 0))
     (setq hnd (car (entsel "\nDS> Select Object Type: ")))
   )
   (if (/= hnd nil)
     (progn
       (setq obj (cdr (assoc 0 (entget hnd))))
       (setq sset (ssget "_X" (list (cons 0 obj))))
       (if (> (sslength sset) 0)
         (sssetfirst sset sset)
       )
     )
   )
   (princ)
 )

 

 

In this routine you select an entity and subsequently all entities of the same type in the entire drawing are selected.

I would like that instead of selecting the entities of the entire drawing, it would only select those in a previously selected area

 

any comments are welcome

Posted

@leonucadomi Simple. Change:

(setq sset (ssget "_X" (list (cons 0 obj))))

to:

(setq sset (ssget "_P" (list (cons 0 obj))))

 

  • Thanks 1
Posted
5 minutes ago, pkenewell said:

@leonucadomi Simple. Change:

(setq sset (ssget "_X" (list (cons 0 obj))))

to:

(setq sset (ssget "_P" (list (cons 0 obj))))

 

I'm sorry but it doesn't work

Posted
3 minutes ago, leonucadomi said:

I'm sorry but it doesn't work

It works for me.

If you have a selection made previously, then run this command, it will only select the similar items within the previous selection set.

If that is not what you wanted, then you need to explain yourself better.

Posted

If you mean that you want to interactively select the similar items, then just change:

(setq sset (ssget "_P" (list (cons 0 obj))))

to

(setq sset (ssget (list (cons 0 obj))))

 

  • Thanks 1
Posted
33 minutes ago, pkenewell said:

If you mean that you want to interactively select the similar items, then just change:

(setq sset (ssget "_P" (list (cons 0 obj))))

to

(setq sset (ssget (list (cons 0 obj))))

 

sorry for my translation,  I have modified it as you told me and it is precisely what I needed, this is a great help, thank you very much

  • Like 1

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...