PDA

View Full Version : Routine leaves dimtol turned on


Robert.Hall
2007-06-21, 04:49 PM
I have a routine that adds a tolerance to a selected dimension.
The routine sometimes leaves the dimtol turned on
for newly place dimensions. How do I prevent this from
happening? I am running 2008.


(defun c:T3 (/ Save_DimTol Save_DimTm Save_DimTp DimObject)
(setq Save_DimTol (getvar "DimTol"))
(setq Save_DimTm (getvar "DimTm"))
(setq Save_DimTp (getvar "DimTp"))
(setvar "DimTol" 1)
(setvar "DimTm" 3)
(setvar "DimTp" 3)
(princ "\nSelect Dimension to add Tolerance to: ")
(setq DimObject (ssget '((0 . "DIMENSION"))))
(if DimObject
(command "._-DimStyle" "_A" DimObject "")
)
(setvar "DimTol" Save_DimTol)
(setvar "DimTm" Save_DimTm)
(setvar "DimTp" Save_DimTp)
(princ)
)

Lions60
2007-06-21, 09:38 PM
you could always just do this (setvar "DimTol" 0) to turn it back off. I am not sure why its not turning it off unless the original value it saves has it turned on.

Robert.Hall
2007-06-22, 07:37 PM
you could always just do this (setvar "DimTol" 0) to turn it back off. I am not sure why its not turning it off unless the original value it saves has it turned on.

Stumped me on this one. I should not have to add a "0" switch just to be sure.

I never turn on dimtol because I can use the change properties tool for adding
tolerances. It may be an instance where another user has opened one of my
cad files.