参考- (defun c:bv (/ bili2)
- (setvar "cmdecho" 0)
- (command "mview" "l" "off" "all" "")
- (if (not bili) (setq bili (getstring "\n请输入比例:")) (setq bili (if (/= "" (setq bili2 (getstring (strcat "\n请输入比例<" bili ">:")))) bili2 bili)))
- (command "zoom" (strcat "1/" bili "xp"))
- (command "mview" "l" "on" "all" "")
- (princ)
- )
- ;;我一般带记忆功能这样实现的,代码比较容易懂,其中 scalebak 为全局变量
- (if (null scalebak) (setq scalebak 100.0))
- (if (setq s (getreal (strcat "\n比例值<" (rtos scalebak 2 2) ">:")))
- (setq scalebak s)
- )
|