)
) ; if
)
; 主程序开始
(setq olderr *error*
*error* txterr
oldcmd (getvar "cmdecho")
)
(setvar "cmdecho" 0) ; 命令不回显
(setq nn 9) ; 词组分类数
(init) ; 初始化
(diag) ; 驱动对话框
(if (and ok txt)
(progn
(if (or (= (setq sty (tblsearch "STYLE" "HZ")) nil); "HZ"字型是否存在
(/= (cdr (assoc 40 sty)) 0) ; 字高是否为定值
(/=(getvar "TEXTSTYLE") "HZ"); 当前字型是否为"HZ"
)
(command "STYLE" "HZ" "txt,hztxt" 0 0.7 0 "n" "n") ; 设置"HZ"字型
)
(initget (+ 2 4));下面的输入值要求大于0
(setq ht (getreal "\n请输入字高<500>:"))
(if (not ht) (setq ht 500))
(setq pt (getpoint "\n请点取文字起点:"))
(command "text" pt ht 0 txt)
)
)
(setq *error* olderr);恢复原设置
(setvar "cmdecho" oldcmd)
(princ)
)
// #txt.dcl
// 供#txt.lsp调用
filetext : dialog { // 对话框名称
label = "常用词组"; // 对话框标识
: row {
: boxed_column {
label = " 索 引 ";
: radio_button {
label = "常用术语"; // 多选一按钮
key = "c1";
value = "1"; // 初始值为"1", 表示选中
}
: radio_button {
label = "图纸名称";
key = "c2";
}
: radio_button {
label = "房间名称";
key = "c3";
}
: radio_button {
label = "卫生器具";
key = "c4";
}
: radio_button {
label = "管材配件";
key = "c5";
}
: radio_button {
label = "器材仪表";
key = "c6";
}
: radio_button {
label = "常用设备";
key = "c7";
}
: radio_button {
label = "构筑物";
key = "c8";
}
: radio_button {
label = "其它";
key = "c9";
}
}
: list_box {
label = "词组内容";
key = "what";
height = 15;
width = 26;
allow_accept = true; // 可双击鼠标选取
}
}

