- 积分
- 1669
- 明经币
- 个
- 注册时间
- 2007-12-1
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2023-12-4 14:19:58
|
显示全部楼层
可以试试下面的代码………………(defun c:ggcha (/ ss n cnt# enlst)
(vl-load-com)
(setq jidulst (list 'acDimPrecisionZero
'acDimPrecisionOne
'acDimPrecisionTwo
'acDimPrecisionThree
'acDimPrecisionFour
'acDimPrecisionFive
'acDimPrecisionSix
'acDimPrecisionSeven
'acDimPrecisionEight
))
(initget 5 "0 1 2 3 4 5 6 7 8")
(setq int# (getint "\n请输入精度<保留小数点的位数>[0位,1位,2位,3位,4位,5位,6位,7位,8位]"))
(while (setq ss (ssget '((0 . "DIMENSION"))))
(setq n (sslength ss )
cnt# n
)
(repeat n
(setq ename^ (ssname ss (setq cnt# (1- cnt#))))
(setq enameobj (vlax-ename->vla-object ename^ ))
(vlax-put-property enameobj 'TolerancePrecision (eval (nth int# jidulst))))
)
) |
|