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

Dimension Styles Colors

3 REPLIES 3
Reply
Message 1 of 4
jjorovi
359 Views, 3 Replies

Dimension Styles Colors

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?

3 REPLIES 3
Message 2 of 4
_Tharwat
in reply to: jjorovi

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

Message 3 of 4
jjorovi
in reply to: _Tharwat

Excellent!

It's just what I need.

Thanks for sharing Tharwat. Smiley Happy

 

There is one curious thing.
The current leaders in the drawing are not updated with new color styles.

Message 4 of 4
scot-65
in reply to: jjorovi

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.


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

Post to forums  

Autodesk Design & Make Report

”Boost