Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dimension text fill color - LISP

5 REPLIES 5
Reply
Message 1 of 6
VFW1968
1745 Views, 5 Replies

Dimension text fill color - LISP

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")
)

 

5 REPLIES 5
Message 2 of 6
hmsilva
in reply to: VFW1968

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

EESignature

Message 3 of 6
VFW1968
in reply to: VFW1968

Awesome! Thanks! 

Message 4 of 6
hmsilva
in reply to: VFW1968


@VFW1968 wrote:

Awesome! Thanks! 


You're welcome, VFW1968

glad I could help

 

Henrique

EESignature

Message 5 of 6
pbejse
in reply to: hmsilva


@hmsilva wrote:

Maybe something like this

...
    (setq entdata '((-3 ("ACAD" (1000 . "DSTYLE") (1002 . "{") (1070 . 69) (1070 . 1) (1002 . "}")))))
    (setq newentdata (append ent entdata))
....

HTH

Henrique


Nice Henrique Smiley Happy

Message 6 of 6
hmsilva
in reply to: pbejse


@pbejse wrote:

Nice Henrique Smiley Happy


 

Thank you! pbejse

 

Cheers

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost