Author Topic: Dimension background mask color  (Read 2847 times)

0 Members and 1 Guest are viewing this topic.

spykat1965

  • Guest
Dimension background mask color
« on: August 18, 2011, 01:52:13 PM »
I have a routine that will toggle the background mask of a dimension On and Off but what I need is to change the fill color to "background". Does anybody know how to do this?

Tharwat

  • Swamp Rat
  • Posts: 710
  • Hypersensitive
Re: Dimension background mask color
« Reply #1 on: August 18, 2011, 03:18:28 PM »
You can change the text fill color with this function .

Code: [Select]
vla-put-textfillcolor <vla-obj> <Number of Color>

spykat1965

  • Guest
Re: Dimension background mask color
« Reply #2 on: August 18, 2011, 03:25:42 PM »
I don't know much about VisualLisp. How do I get the <vla-obj>?

Tharwat

  • Swamp Rat
  • Posts: 710
  • Hypersensitive
Re: Dimension background mask color
« Reply #3 on: August 18, 2011, 03:33:55 PM »
Example ..

Code: [Select]
(setq ss (car (entsel "\n Select Dimension :")))
(vla-put-textfillcolor (vlax-ename->vla-object ss) 1); Number 1 indicates to Red color

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Dimension background mask color
« Reply #4 on: August 18, 2011, 03:59:25 PM »
Here's something to mull over:

Code: [Select]
(defun c:younameit (/ clr ss ss->list)
  (defun ss->list (ss / e n out)
    (setq n -1)
    (if (= (type ss) 'pickset)
      (while (setq e (ssname ss (setq n (1+ n)))) (setq out (cons (vlax-ename->vla-object e) out)))
    )
  )
  (if (and (setq clr (acad_colordlg 1)) (setq ss (ssget ":L" '((0 . "dimension")))))
    (foreach dim (ss->list ss) (vlax-put dim 'textfillcolor clr) (vlax-put dim 'textfill -1))
  )
  (princ)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

trogg

  • Bull Frog
  • Posts: 255
Re: Dimension background mask color
« Reply #5 on: August 18, 2011, 11:40:22 PM »
Found this one
2 functions with this.
TMASKON - Turn Text Mask On
TMASKOFF -Turn Text Mask OFF