大家好。请帮我找出在这种情况下发生了什么:
1-我有一个简单的defun setvar
=>在命令中测试,或从其他defun调用中测试都正常
2-当按下按钮时,我将其付诸行动:
- (defun c:Test (/ fl ret dcl_id)
- (vl-load-com)
- (setq fl (vl-filename-mktemp "mip" nil ".dcl"))
- (setq ret (open fl "w"))
- (mapcar
- '(lambda (x) (write-line x ret))
- (list
- "test_DCL : dialog {label="Test"; width = 40;fixed_width = true;"
- ":button {label = "Exit"; is_cancel = true;fixed_width = true;width = 1;}"
- ":button {label = "Setvar Test";fixed_width = true;width = 1;key = "kTest";}"
- "}"
- )
- )
- (setq ret (close ret))
- (if (and (not (minusp (setq dcl_id (load_dialog fl))))
- (new_dialog "test_DCL" dcl_id)
- )
- (progn
- [color=blue](action_tile "kTest" "(setvars)") ;This is[/color]
-
- (setq dlg_Exit (start_dialog))
- ) ;_ end of progn
- ) ;_ end of if
- (unload_dialog dcl_id)
- (vl-file-delete fl)
- ret
- )
=>运行:;错误:AutoCAD变量设置被拒绝:“Pickfirst”1
3-在Defun setvar中稍作更改:
=>从命令中再次测试defun,其他defun,测试defun现在正常吗????
4-连续将setvar直接放入测试定义代码:
更改:(action_tile“kTest”“(setvars)”)
作者:(action\u tile“kTest”“(setvar“Pickfirst”1))
=>运行:失败,原因相同
5-使用其他系统变量更改Pickfirst:
更改:(action\u tile“kTest”“(setvar“Pickfirst”1)”
作者:(action\u tile“kTest”“(setvar“Snapang”1)”)
=>运行:OK
==>???? 那么发生了什么?还是我在类型选择上错了? |