0 Members and 1 Guest are viewing this topic.
My entmod doesn't seem to be working here. Layer gets created with the -N suffix and color red but the selected object doesn't get moved to that new layer.Code - Auto/Visual Lisp: [Select](defun c:ByToRed ( / e i l n s x ) (defun *error* (msg) (if osm (setvar 'osmode osm) ) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\nError: " msg)) ) (princ) ) (if (setq s (ssget ":L")) (repeat (setq i (sslength s)) (setq x (entget (ssname s (setq i (1- i)))) l (assoc 8 x) n (strcat (cdr l) "-N") ) (if (not (tblsearch "layer" n)) (progn (setq e (entget (tblobjname "layer" (cdr l)))) (entmake (subst (cons 2 n) (assoc 2 e) (subst '(62 . 1) (assoc 62 e) e))) ) ) (entmod (subst (cons 8 n) 1 x)) ) ) (prompt "\nAll objects have been moved to new construction layer") (princ))Something simple I'm sure. Well, not to me anyway.J. Logan
(entmod (subst (cons 8 n) 1 x))
(entmod (setq x (subst (cons 8 n) 1 x)))
Thanks Ron, ;; Or this Code - Auto/Visual Lisp: [Select](entmod (subst (cons 8 n) (assoc 8 x) x))What does the last ... x)) do here???