Code Red > AutoLISP (Vanilla / Visual)

Entity layer by colour

(1/2) > >>

Shade:
Does anyone have a lisp that will sort the entities to layers by the colour of the entity.

I have a drawing that was made in chief architect and translated to cad, but all the entities are on 1 layer and the colours is changed.
I wish to send each object of colour to the co-orsponding layer.

ie. line with colour 5 change to layer 5, with colour by layer?

I may have to writen something, but time is of essence.

Any help would be greatly appreciated..

Damn architects, oh wait that me....  :lmao:

M-dub:
Have you tried the QSelect command?  I think it should work for you...

ElpanovEvgeniy:

--- Code: ---(defun test (/ ss)
  (if (setq ss (ssget "_X"))
    (foreach x (mapcar (function entget)
                       (vl-remove-if (function listp) (mapcar (function cadr) (ssnamex ss)))
                    )
      (if (assoc 62 x)
(progn
  (entmod (subst (cons 8 (itoa (cdr (assoc 62 x)))) (assoc 8 x) x))
  (entupd (cdr (assoc -1 x)))
) ;_  progn
      ) ;_  if
    ) ;_  foreach
  ) ;_  if
) ;_  defun
--- End code ---

M-dub:
oops, after re-reading your first post, I see what you're trying to do.  Guess Qselect isn't what you're after... Sorry ;)

Mark:

--- Quote from: ElpanovEvgeniy on July 05, 2006, 10:58:02 AM ---
--- Code: ---(defun test (/ ss)
  (if (setq ss (ssget "_X"))
    (foreach x (mapcar (function entget)
                       (vl-remove-if (function listp) (mapcar (function cadr) (ssnamex ss)))
                    )
      (if (assoc 62 x)
(progn
  (entmod (subst (cons 8 (itoa (cdr (assoc 62 x)))) (assoc 8 x) x))
  (entupd (cdr (assoc -1 x)))
) ;_  progn
      ) ;_  if
    ) ;_  foreach
  ) ;_  if
) ;_  defun
--- End code ---

--- End quote ---

Nice stuff !!

Navigation

[0] Message Index

[#] Next page

Go to full version