Hi all!
Is there any way to change the colors of the dimensions styles, including dimension lines, extension lines and text to "by layer"
I found a code to change the colors, but only affects the current dimensions in the drawing and the styles do not change.
suggestions?
Check this out , this peice of code would change all dimension style to be by layer as you wanted .
(defun c:Test (/ d dim) (vl-load-com) ;;; Tharwat 13. Aug. 2012 ;;; (cond ((not acdoc) (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))) ) ) (while (setq d (tblnext "DIMSTYLE" (null d))) (setq dim (vla-item (vla-get-Dimstyles acdoc) (cdr (assoc 2 d)))) (vla-put-activeDimstyle acdoc dim) (setvar "DIMCLRE" 256) (setvar "DIMCLRD" 256) (setvar "DIMCLRT" 256) (vla-copyfrom dim acdoc) ) (if (ssget "_X" '((0 . "*DIMENSION"))) (vlax-for x (vla-get-activeselectionset acdoc) (vla-update x) ) ) (princ) )
Tharwat
Excellent!
It's just what I need.
Thanks for sharing Tharwat.
There is one curious thing.
The current leaders in the drawing are not updated with new color styles.
You may soon find out (if not already) that some of the existing dimension objects
have overrides applied to them. Once you make final adjustments as to how your
dimensions will look, and you wish to update all existing dimensions that did not
appear to follow your desires, do the following:
(defun c:UD () (command "-Dimstyle" "a" pause)(princ))
Update Dimensions by selection.
"pause" can be replaced with "All" and "". [verify this]
Research the fillowing:
(command ".DIM" "save" (getvar 'DIMSTYLE) "Yes" "exit")
???
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.