Hi All
I have the following routine to toggle the dim mask on and off. Unfortunately, the routine is written in such a way that it doesn't check to see if the dimension string is already masked and do the opposite. If the dimension already has a mask I have to select it twice to turn off the mask. Any help in modifying this routine is greatly appreciated. Thanks.
Manuel
Code:
(vl-load-com)
(defun c:dm (/ ent entdata hnd i newentdata ss xdata)
(if (setq ss (ssget "_:S+." '((0 . "Dimension"))))
(repeat (setq i (sslength ss))
(setq hnd (ssname ss (setq i (1- i)))
ent (entget hnd '("ACAD"))
)
(if (or (not (setq xdata (assoc -3 ent)))
(and (setq xdata (assoc -3 ent))
(member '(1000 . "DSTYLE") (last xdata))
(/= (cdr (assoc 1070 (reverse (last xdata)))) 1)
(setq ent (vl-remove-if '(lambda (x) (= -3 (car x))) ent))
)
)
(setq entdata '((-3 ("ACAD" (1000 . "DSTYLE")(1002 . "{")(1070 . 69)(1070 . 1)(1002 . "}"))))
newentdata (append ent entdata))
(setq ent (vl-remove-if '(lambda (x) (= -3 (car x))) ent)
entdata '((-3 ("ACAD"(1000 . "DSTYLE")(1002 . "{")(1070 . 69)(1070 . 0)(1002 . "}"))))
newentdata (append ent entdata))
)
(entmod newentdata)
(command ".draworder" ss "" "front")
)
)
(princ)
)