Please help!
I'm trying to convert this AutoCAD lisp routine that works perfectly fine on the current layout to one that will run on each layout.
It works great on a single layout - but I cannot get it to run on multiple layouts.
Single layout:
Code:
(defun c:DMO (/ ss en)
(command "_.layer" "_thaw" "0-DIMOVER" "_make" "0-DIMOVER" "c" "30" "" "")
(prompt "To isolate dimensions with overridden measurement values,")
(setq ss (ssget "_X" '((0 . "DIMENSION") (1 . "~")))); ignores no-override ones
(repeat (sslength ss)
(setq en (ssname ss 0))
(if
(not (wcmatch (cdr (assoc 1 (entget en))) "*<>*")); override containing actual measurement
(command "_.chprop" en "" "la" "0-DIMOVER" "_color" "BYLAYER" "")
); if
(ssdel (ssname ss 0) ss)
); repeat
(princ)
):end program
Here I'm trying to covert it to run on each sheet, after creating the layer. I can't get it to run past the current sheet.
Code:
(defun C:CLEAN (/ ss en)
(command "_.layer" "_thaw" "0-DIMOVER" "_make" "0-DIMOVER" "c" "30" "" "")
(foreach layout (layoutlist)
(setvar "ctab" layout)
(prompt "To isolate dimensions with overridden measurement values,")
(setq ss (ssget "_X" '((0 . "DIMENSION") (1 . "~")))); ignores no-override ones
(repeat (sslength ss)
(setq en (ssname ss 0))
(if
(not (wcmatch (cdr (assoc 1 (entget en))) "*<>*")); override containing actual measurement
(command "_.chprop" en "" "_layer" "0-DIMOVER" "_color" "BYLAYER" "")
); if
(ssdel (ssname ss 0) ss)
); repeat
(princ)
^^C
); end foreach
); end defun