- (defun c:tt (/ make_dcl)
- (defun make_dcl (/ lst_str str file f) ; ; 面板的界面显示dcl
- (setq lst_str
- '(
- " dcl_test:dialog "
- " {alignment=centered;label = "试用"; "
- " :boxed_column "
- " {fixed_height = true; label = "非必选项"; "
- " :toggle {key = "xx_1"; label = "选项1";} "
- " :toggle {key = "xx_2"; label = "选项3";} "
- " :toggle {key = "xx_3"; label = "选项4";} "
- " :toggle {key = "xx_4"; label = "选项6";} "
- " :toggle {key = "xx_5"; label = "选项9";} "
- " spacer_0; "
- " } "
- " :row{ "
- " :button {key = \accept\; is_default = true; fixed_width = true; label = "确定";} "
- " :button {key = "cancel"; is_cancel = true; fixed_width = true; label = "取消";} "
- " } "
- " } "
- )
- )
- (setq file (vl-filename-mktemp "DclTemp.dcl") )
- (setq f (open file "w") )
- (foreach str lst_str
- (princ "\n" f)
- (princ str f)
- )
- (close f)
- file
- )
-
- (if (= (setq dcl_id (load_dialog (setq dcl_file (make_dcl) ) ) ) 0) (progn (exit) ) )
- (if dcl_file (vl-file-delete dcl_file) )
- (if (not (new_dialog "dcl_test" dcl_id) ) (progn (exit) ) )
-
- (action_tile "accept" "(done_dialog 1)")
- (action_tile "cancel" "(done_dialog 0) (exit)")
- (start_dialog)
- (unload_dialog dcl_id)
- )
1.选项中的必选项和非必选项是无规律穿插的;
2.解决方案的行数选项对应,但行数不固定;
3.非必选项的选择数量也随机的。
最后根据选择的非必选项和默认已经选择的必选项生成表格。这样的代码该怎么写?用最原始的办法把每条的位置都写出来,再用cond来设置显示。如果选项少的话还行,选项多了就太难表达了,请问有没有好的表达方式?谢谢~
|