I would like to set dimension text fill color to "background" instead of, you know, dimensioning my drawings properly.
I have this code I got on these forums and it works well except for the 'TextFillColor' variable. I can't find the correct color number or syntax for "Background'. It's currently set to 0 which produces ByBlock, and any number I put in there corresponds to the AutoCAD color number (1 = Red, 2 = Yellow, etc.)
If you have a better routine that you could post that works for me too. Or maybe you could just do my work for me? Even better.
Thanks in advance for you help.
----------------------------------
(defun c:test (/ obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "Dimension")))
num (sslength ss1)
cnt 0)
(repeat num
(setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
(vlax-put-property obj 'TextFill :vlax-true)
(vlax-put-property obj 'TextFillColor 0)
(setq cnt (1+ cnt))
)
(vl-cmdf "_draworder" ss1 "" "f")
)
Maybe something like this
(defun c:test (/ CNT ENT ENTDATA NEWENTDATA NUM SS1) (vl-load-com) (setq ss1 (ssget '((0 . "Dimension"))) num (sslength ss1) cnt 0 ) (repeat num (setq ent (entget (ssname ss1 cnt))) (setq entdata '((-3 ("ACAD" (1000 . "DSTYLE") (1002 . "{") (1070 . 69) (1070 . 1) (1002 . "}"))))) (setq newentdata (append ent entdata)) (entmod newentdata) (setq cnt (1+ cnt)) ) (vl-cmdf "_draworder" ss1 "" "f") )
HTH
Henrique