So you are trying to rename a layer if the layer is found, based on two lists?
(foreach i (mapcar (function cons) list1 list2)
(if .... search of '(car i)'
... rename '(car i)' to '(cdr i)'..
)
)
Typed in message, so be careful, but the idea is there.[/code]
i dont want rename layer because if layer 1new have in drawing. i mean creat lst layer new then merge layer_old with new. I have not found the answer loop.
(defun c:123 (/ lst1 lst2 n layer1 layer2)
(setq lst1 (list "1" "2" "3" "4" "5" "6"))
(setq lst2 (list "1new" "2new" "3new" "4new" "5new" "6new"))
(setq n 0)
(repeat
(SsLength lst1)
(setq layer1 (nth n lst1))
(setq layer2 (nth n lst2))
(if (tblsearch "LAYER" layer1)
(if (tblsearch "LAYER" layer2)
(command "_.LAYMRG" "_Name" layer1 "" "_N" layer2 "_Y")
);if layer2
);if layer1
(setq n (+ n 1))
)
(princ)
)
Pls check it.