本帖最后由 xyp1964 于 2012-4-26 23:40 编辑
- (defun c:tt ()
- (if (setq ss (ssget '((0 . "DIMENSION"))))
- (progn
- (setq nt (getint "\n输入标注新的公差精度[0~8]: ")
- n 0
- )
- (repeat (sslength ss)
- (setq s1 (ssname ss n)
- n (1+ n)
- ob (vlax-ename->vla-object s1)
- nn (COND ((= nt 0) acDimPrecisionZero)
- ((= nt 1) acDimPrecisionOne)
- ((= nt 2) acDimPrecisionTwo)
- ((= nt 3) acDimPrecisionThree)
- ((= nt 4) acDimPrecisionFour)
- ((= nt 5) acDimPrecisionFive)
- ((= nt 6) acDimPrecisionSix)
- ((= nt 7) acDimPrecisionSeven)
- ((= nt 8) acDimPrecisionEight)
- (t nil)
- )
- )
- (if nn
- (progn (vla-put-PrimaryUnitsPrecision ob nn)
- (vla-put-SuppressTrailingZeros ob :vlax-false)
- )
- )
- )
- (if (< nn 9)
- (progn (princ "标注精度已经设定为: ")
- (princ nt)
- (princ "位小数")
- )
- )
- )
- )
- (princ)
- )
|