本帖最后由 菜卷鱼 于 2024-10-25 16:30 编辑
是高版本的话,给你搞个反应器
- (or *precision1*
- (setq *precision1*
- (vlr-command-reactor
- nil
- '(
- (:vlr-commandWillStart . precisionget)
- (:vlr-commandEnded . precisionset)
- (:vlr-commandcancelled . precisionset)
- )
- )
- )
- )
- (defun precisionget (x1 x2 / a1 a2 )
- (setq a1 x1
- a2 x2
- )
- (if (and (wcmatch (car a2) "DIM*")
- (not (wcmatch (car a2) "DIMSTYLE*"))
- )
- (progn
- (setq *preset (getvar "dimdec")) ;;;记录正在使用的精度
- (setvar "dimdec" 3) ;;;;;这里是设置3位精度
- )
- )
- )
- (defun precisionset (x1 x2 / a1 a2)
- (setq a1 x1
- a2 x2
- )
- (if (and (wcmatch (car a2) "DIM*")
- (not (wcmatch (car a2) "DIMSTYLE*"))
- )
- (setvar "dimdec" *preset) ;;;;恢复之前使用的精度
- )
- )
|