 - ;;环境变量保存默认值示例
- (defun c:tt1 ()
- (setq #height (GetEnv "MyApp\\Height")) ;_ 读取默认值
- (if #height
- (setq Height (getreal (strcat "\n输入字高<" #height ">")))
- (setq #height "2.0"
- Height (getreal (strcat "\n输入字高<" #height ">"))
- )
- )
- (if (null Height)
- (setq Height (atof #height))
- (SetEnv "MyApp\\Height" (rtos Height 2 2)) ;_ 保存默认值
- )
- )
- ;;系统变量保存默认值示例
- (defun c:tt2 ()
- (setq #height (getvar 'userr1)) ;_ 读取默认值
- (if #height
- (setq Height (getreal (strcat "\n输入字高<" (rtos #height 2 2)">")))
- (setq #height 2.0
- Height (getreal (strcat "\n输入字高<" (rtos #height 2 2) ">"))
- )
- )
- (if (null Height)
- (setq Height #height)
- (setvar 'userr1 Height) ;_ 保存默认值
- )
- )
|