Lisp for Dimension Style + Align Text

Lisp for Dimension Style + Align Text

Anonymous
Not applicable
1,277 Views
1 Reply
Message 1 of 2

Lisp for Dimension Style + Align Text

Anonymous
Not applicable

Hello,

Could somebody help me with a lisp for:

1. Change all dimensions' styles in current drawing to DIMSTYLE_2
2. Change DIMSTYLE_2 text placement to ABOVE 
3. Change DIMSTYLE_2 Fill Color to BACKGROUND 
4. Apply DRAWORDER _FRONT for all dimensions
5. Apply DIMEDIT _HOME for all dimensions

Or, if it is easier:
1. Change all dimensions' styles text placement to ABOVE
2. Change all dimensions' styles Fill Color to BACKGROUND 
3. Apply DRAWORDER _FRONT for all dimensions
4. Apply DIMEDIT _HOME (Align dimension text - home) for all dimensions

0 Likes
Accepted solutions (1)
1,278 Views
1 Reply
Reply (1)
Message 2 of 2

ВeekeeCZ
Consultant
Consultant
Accepted solution

Not sure if I would dare to call this a 'lisp'... 

 

(defun c:DimS2 ( / ss)
  (if (and (tblsearch "dimstyle" "DIMSTYLE_2")
	   (setq ss (ssget "_A" '((0 . "DIMENSION")))))
    (command "_.-DIMSTYLE" "_Restore" "DIMSTYLE_2"
	     "_.-DIMSTYLE" "_Apply" ss ""
	     "DIMTAD" 1
	     "DIMTFILL" 1
	     "_.-DIMSTYLE" "_Save" "DIMSTYLE_2" "_Y"
	     "_.DRAWORDER" ss "" "_Front"
	     "_.DIMEDIT" "_Home" ss "")
    (princ "\nDimstyle 'DIMSTYLE_2' is not loaded in the drawing. "))
  (princ)
)