@mhupp
Thanks!!! (Again... )
What I did not realized is that i can use this: (8 . "MAINLINE_PIPES,ZONE_PIPES,Circular sectors,SPRAYLINES") and the "," is like OR condition.
I've made a small change to the code, deleteing the OR condition of the colors since they appear in the list and the loop compare the original color and assign the lines to the new layer that have the color and the line width according to the condition in the list.
here is the relevant code segment that I've changed a little (the actual datalist contains about 35 layers so I obviously didn't copied all of them...) :
(if (setq ss (ssget "_X" '((0 . "LINE") (8 . "MAINLINE_PIPES,ZONE_PIPES,Circular sectors,SPRAYLINES"))))
(foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS)))
(setq eData (mapcar '(lambda (d) (cdr (assoc d (entget ent)))) '(62 10 11)))
(entdel ent)
(setq f (assoc (car edata) Datalist))
(entmakex (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(90 . 2) '(70 . 0)
(cons 8 (cadr f))
(cons 43 (caddr f))
(cons 10 (cadr eData))
(cons 10 (caddr eData))
)
)
)
)
I've attached the full lisp here as a file.
Thanks Again,
Ari.
test3.lsp