各位大侠们,帮看看到底要怎么整才有效果啊!是书上错的还是我操作的问题?我按照书上一步一步的操作还是得不到效果啊!后面的这个也得不到效果!
 - dia5d:dialog{
- label="对话框<text>文字实例测试";
- :concatenation{
- :text_part {label="共选择了[";}
- :text{width=6;key="t_cir";}
- :text_part{label="]个 CIRCLE";}
- }
- :concatenation{
- :text_part {label="共选择了[";}
- :text{width=6;key="t_line";}
- :text_part{label="]个 LINE";}
- }
- :concatenation{
- :text_part {label="共选择了[";}
- :text{width=6;key="t_text";}
- :text_part{label="]个 TEXT";}
- }
- ok_cancel;
- }
 - (defun c:dia5d()
- (setvar "cmdecho" 0)
- (sub_dia5d) ;调用子程序
- (if ss (dcl_dia5d)) ;调用对话框子程序
- (prin1)
- )
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (defun sub_dia5d()
- (setq ss (ssget)) ;选择对象
- (if(null ss)(setq ss (ssadd))) ;如果ss不存在,设置ss为空选集
- (setq cir_num 0 line_num 0 text_num 0) ;设置默认起始值
- (setq n 0)
- (repeat (sslength ss)
- (setq en (ssname ss n))
- (setq entype (cdr (assoc 0 (entget en)))) ;获取对象类别
- (cond ((= entype "CIRCLE") (setq cir_num (+ 1 cir_num)))
- ((= entype "LINE") (setq line_num (+ 1 line_num)))
- ((= entype "TEXT") (setq text_num (+ 1 text_num)))
- )
- (setq n(+ 1 n))
- )
- )
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (defun dcl_dia5d()
- (setq dcl_id (load_dialog "dia5d")) ;加载DCL文件
- (if (not (new_dialog "dia5d" dcl_id))(exit)) ;启动对话框
- (set_tile "t_cir" (itoa cir_num)) ;显示圆的统计数量于对话框
- (set_tile "t_line" (itoa line_num)) ;显示直线的统计数量于对话框
- (set_tile "t_text" (itoa text_num)) ;显示文字的统计数量与对话框
- (setq dd (start_dialog))
- )
|