Jump to content

selection set based on layer and color of a given object


tsotzo

Recommended Posts

Hi,

 

I am trying something like this:

 

(setq ed (entget (car (entsel))))

(setq lyr (cdr (assoc 8 ed)))

(setq clr (cdr (assoc 62 ed)))

 

How can I get a selection set based on layer and color of a given object?

Something like:

(setq objs (ssget "X" '((cons 8 lyr) (cons 62 clr)) ) )

[i know this is not working I write it just to give the idea.]

 

and then change the objects' layer to "0" and color to 2.

 

Thank you in advance

tso

Link to comment
Share on other sites

Thank you Grrr!

It was just what I needed!

(defun C:A2 ( / ed ss1 )
(setq ed (entget (car (entsel))))
(setq ss1 (ssget "X" (list (cons 8 (cdr (assoc 8 ed))) (cons 62 (cdr (assoc 62 ed))) ) ) )
(Command "chprop" ss1 "" "LA" "0" "C" 2 "")
)
 

... and great lesson from Lee Mac (as always :) )

 

Cheers!

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