Code Red > AutoLISP (Vanilla / Visual)

Select all objects on a color

(1/4) > >>

danny:
I've seen a routine like this on the Swamp before, just can't seem to find it.  Can anyone help?  Select all objects on a color and change layer.
Thanks,

CAB:
Perhaps this one:
http://www.theswamp.org/phpBB2/viewtopic.php?p=39127#39127

danny:
CAB,
That is a great routine, and I also like quick select.  But, I need to be able to run it in a script file.  Sorry, I should have been more specific.

danny:
o.k I tried this, but got a bad ssget list.  What did I do wrong?  Just trying to get all object on color 8 and change them to layer xxfine.

--- Code: ---(defun c:c2lay ()
  (setq sset
(ssget
  "x"
  '((62.8))
)
  )
  (if sset
    (repeat (sslength sset)
      (command "_.chprop" sset "" "layer" "xxfine" "")
    )
  )
)
--- End code ---

Jürg Menzi:

--- Quote from: danny ---
--- Code: ---'((62.8))

--- End code ---

--- End quote ---
must be:
--- Code: ---'((62 . 8))
--- End code ---
note the spaces...
Cheers

Navigation

[0] Message Index

[#] Next page

Go to full version