It looks like you're new here. If you want to get involved, click one of these buttons!
I'm importing a drawing from hydraulic software,
and all the lines that represent pipes are in one layer and differentiate by color.
I'm trying to write a lisp that loops through al those line and change them to a different layer based on their color,
if the line color is 140,then change it to layer P_DN125 and assign color by layer,
if the line color is 112,then change it to layer P_DN110 and assign color by layer,
and so on.
i fount a simple lisp that change the color from a fixed one to color by layer,
but i struggle with converting it in to a loop and to change the layer.
(defun c:byl (/ ss)
(if (setq ss (ssget "x" '((8 . "Main and secondary pipes"))))
(command ".chprop" "_si" ss "_color" "_bylayer" "")