这应该满足您的期望:
- (defun c:Test (/ dcl_id lst1 lst2 val1 val2 size1 size2)
- (setq dcl_id (load_dialog "txt.dcl"))
- (if (not (new_dialog "txt" dcl_id))
- (exit)
- )
- (start_list "h1")
- (mapcar 'add_list (setq lst1 '("50" "75" "100" "125" "150" "200" "250" "300" "350" "400" "450" "500" )))
- (end_list)
- (start_list "h2")
- (mapcar 'add_list (setq lst2 '("550" "600" "650" "700" "750" "800" "850" "900" "950" "1000" )))
- (end_list)
- (set_tile "rad1" "1")
- (action_tile "rad1" "(setq val1 $value)(mode_tile "h1" (boole 1 1 0))(mode_tile "h2" (boole 1 1 (atoi val1)))" )
- (action_tile "rad2" "(setq val2 $value)(mode_tile "h2" (boole 1 1 0))(mode_tile "h1" (boole 1 1 (atoi val2)))" )
- (defun OnOK ()
- (cond ((= (get_tile "rad1") 1) (setq size1 (nth (atoi (get_tile "h1")) lst1)))
- ((= (get_tile "rad2") 1) (setq size1 (nth (atoi (get_tile "h2")) lst2)))
- )
- (setq done t)
- (done_dialog)
- )
- (action_tile "accept" "(OnOK)")
- (action_tile "cancel" "(setq done nil)(done_dialog)")
- (start_dialog)
- (unload_dialog dcl_id)
- [color=red][b] (print size1)[/b][/color]
- (princ)
- )
|