Thanks guys,
You didn't finish command _.dimlinear. Try to change
to
(command "_.dimlinear" pause pause pause
)
And you didn't check are dimstyles DimenRed and DIMEN really exist in current drawing.
I realized very early this morning that I should probably check if they exist. Pause Pause Pause. Crap!!!
And
(command "-dimstyle" "R" "DIMEN")
to
(command "-dimstyle" "R" "DimenRed")
Mathias
I am indeed trying to reset the dimstyle back to "DIMEN" which is the default. The save action sets the saved dimstyle current as desired. However, I think it best just two make to buttons, one that checks for each dimstyle and then sets it current. Rather than my approach.
(defun c:STA_DIMEN ( / fd om dt de dd clay )
(setq fd (getvar "filedia")) (setvar "filedia" 0)
(setq om (getvar "osmode")) (setvar "osmode" 129)
(setq dt (getvar "dimclrt")) (setvar "dimclrt" 1)
(setq de (getvar "dimclre")) (setvar "dimclre" 1)
(setq dd (getvar "dimclrd")) (setvar "dimclrd" 1)
(setq Clay (getvar "CLAYER")) (command "-layer" "M" "DIMEN" "")
(command "-Dimstyle" "Save" "DimenRed")
; (command "dimlinear")
(command "_.dimlinear" pause pause pause)
;(command "-dimstyle" "R" "DIMEN")
(setvar "CLAYER" Clay)
(setvar "filedia" fd)
(setvar "osmode" om)
(setvar "dimclrt" dt)
(setvar "dimclre" de)
(setvar "dimclrd" dd)
(princ)
)
Thanks Hasan,
Yes, resetting saving and resetting would be a better approach. This way there is no error factor possible.
Thanks again guys.