Hi David,
I don't do much with xrefs (or lisp), but it appears that the "|" (pipe
symbol) appears in the name of all xrefed dimstyles.
Below is a modified version that tests for the pipe symbol and skips any
style that contains it. Probably not the best way, but it seems to work.
I was hoping one of the lisp experts would chime in and show us a better way
to do this. Possibly without using "command" or having to set each style
current.
Gary
[code]
;Globally change text color for all existing dimstyles.
(defun C:DCOL (/ cursty intnum tblmem stynme oldech)
(setq oldech (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq cursty (getvar "dimstyle"))
(setq intnum (getint "\nEnter new dimension text color: "))
(setvar "dimclrt" intnum)
(setq tblmem (tblnext "dimstyle" 1))
(while (/= nil tblmem)
(setq stynme (cdr (assoc 2 tblmem)))
(if (= nil (wcmatch stynme "*|*"))
(progn
(command "-dimstyle" "restore" stynme)
(setvar "dimclrt" intnum)
(command "-dimstyle" "save" stynme "yes")
);progn
);if
(setq tblmem (tblnext "dimstyle"))
);end while
(command "dimstyle" "restore" cursty)
(setvar "cmdecho" oldech)
(princ "Dimension text color set to ") (princ intnum) (princ " for all
styles.")
(princ)
);end function DCOL
[/code]