这与塔尔瓦特的做法相同。
前任。
-
- (setq lst_ '("mm" "inches"))
- (action_tile "LstKey"
- (vl-prin1-to-string (quote
- (progn
- (setq val2 (nth (atoi (get_tile $key)) lst_))
- (mode_tile "key" (if (member val2 '("mm" "cm" "m")) 1 0))
- )
- )
- )
我相信你会明白这段话是怎么回事。
顺便说一句:前面的代码并不是一个完美的例子,而是实现它的许多方法之一。
给,我给你测试了一下
- (defun c:test ( / sampdcl val)
- [color=blue](setq lst_ '("1:10" "1:20" "1:50" "1:60"))
- [/color](setq sampdcl (load_dialog "plotsample.dcl"))
- (if (not (new_dialog "plotsample" sampdcl))
- (exit)
- )
- (start_list "lst")(mapcar 'add_list [color=blue]lst_[/color])(end_list)
- (start_list "UNIT:")(mapcar 'add_list '("mm" "inches"))(end_list)
- (action_tile "FTP"
- "(setq val $value)(mode_tile "lst" (boole 1 (atoi val)))
- (mode_tile "UNIT:" (boole 1 (atoi val)))")
- [color=blue](action_tile "lst"
- (vl-prin1-to-string (quote
- (progn
- (setq val2 (nth (atoi (get_tile $key)) lst_))
- (mode_tile "UNIT:" (if (member val2 '("1:20" "1:60")) 1 0))
- )))
- )[/color][color=blue]
- [/color](action_tile "accept" "(done_dialog 1)")
- (action_tile "cancel" "(done_dialog 0)" )
- (start_dialog)
- (unload_dialog sampdcl)
- )
|