I have a lisp routine, shown below, that will add a prefix to all layers that are not standard.
What I need is, for all XREF layers to be ignored (not renamed). Any help would be greatly appreciated.
(while (setq l (tblnext "Layer"
(not l)))
(if (and (not (member (setq nm (cdr (assoc 2 l))) standards))
(not (tblsearch "LAYER" (setq new (strcat pre nm))))
)
(entmod
(subst (cons 2 new)
(assoc 2 (setq e (entget (tblobjname "LAYER" nm))))
e
)
)
)
)
Solved! Go to Solution.
Solved by Jason.Piercey. Go to Solution.
That could be written more efficiently but regardless of that. Try the following
(while (setq l (tblnext "Layer" (not l))) (if (and (not (member (setq nm (cdr (assoc 2 l))) standards)) (not (tblsearch "LAYER" (setq new (strcat pre nm)))) (not (wcmatch (cdr (assoc 2 l)) "*|*")) ) (entmod (subst (cons 2 new) (assoc 2 (setq e (entget (tblobjname "LAYER" nm)))) e ) ) ) )