Jump to content

select objects by color


motee-z

Recommended Posts

Hello Friends 

i am looking for lisp to select all objects that have same color

(defun c:sire(/ s e)
 (terpri) 
(setq s (car (entsel "\nSelect object to select similar by Color and Type :")))
         (setq e (entget s))
         (sssetfirst nil (ssget "_X" (list (assoc 0 e) (if (setq c (assoc 62 e)) c '(62 . 256)) (cons 410 (getvar 'CTAB)))))
         )

i have one but this lisp can select all object except arcs or only arcs if you pick arc

any help please

 

Link to comment
Share on other sites

"select all object except arcs or only arcs if you pick arc" this contradicts itself it would be easier to get all objects by color then ask want arcs or not, otherwise you will have to do a second selection if the 1st excludes arcs, so the second uses SSADD to add a selection of [picked arcs.

 

(assoc 0 is the entity type eg "LINE" "CIRCLE" "LWPOLYLINE" etc

Edited by BIGAL
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...