发布于:2010-11-29 08:44:29
来自:建筑设计/CAD下载及教程
[复制转发]
[code];;;通用函数
;;;功能:预览dcl窗体
(defun zl-viewDCL (DclFileName DialogName / DD ID )
;;调入文件
(setq id (load_dialog DclFileName))
;;加载dcl
(new_dialog DialogName id)
;;激活对话框的按键定义
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
;;显示窗体
(setq dd (start_dialog))
;;判断返回
(cond ((= dd 1)
(princ "\n确定")
)
(= dd 0)
(princ "\n取消")
)
;;尚需卸载
;;(unload_dialog id)
)
;;;通用函数
;;;功能:获取对话框名称列表
(defun zl-GetDiaNameList (str_Dcl_File_Name / INT LST LST_JG)
(setq lst_jg '())
(if (setq lst (ZL-TXTFILE->TXTLIST str_Dcl_File_Name))
(foreach str lst
(if (or (wcmatch str "*:dialog*")
(wcmatch str "*: dialog*")
(wcmatch str "*: dialog*")
(wcmatch str "*: dialog*")
)
(setq int (vl-string-search ":" str)
str (substr str 1 int)
str (vl-string-trim " " str) ;_去除开始和后续空格
lst_jg (cons str lst_jg)
)
)
)
)
;;返回
(reverse lst_jg)
)
;;;功能:预览DCL文件
(defun c:tt ( / LST_DCLNAME)
(or dcl_file
(setq dcl_file "")
)
(setq dcl_file (getfiled "打开 DCL 文件" dcl_file "DCL" 2))
(princ DCL_FILE)
(setq lst_dclNAME (zl-GetDiaNameList DCL_FILE))
(princ lst_dclNAME)
(zl-viewDCL DCL_FILE (car lst_dclNAME))
(princ)
)[/code]
全部回复(1 )
只看楼主 我来说两句 抢板凳命令: tt
G:\(dcl)\d\DD.dcl; 错误: no function definition: ZL-TXTFILE->TXTLIST
;;;;下面程序是林老师的
(defun c:viewdcl()
(if (null dcl_pt)
(setq dcl_pt '(-1 -1)) ; 预设对话框出现于画面中央
)
(setq dcl_file (getfiled "开启 DCL 文件" "" "DCL" 2))
(princ "DCL 文件名:")(princ dcl_file)
(setq dia_name (getstring "\nDialog 对话框名:"))
(if (= dia_name "")(exit))
(setq dcl_id (load_dialog dcl_file))
(new_dialog dia_name dcl_id) ; 加载DCL文件
(action_tile "accept" "(setq dcl_pt (done_dialog 1))") ; 激活新的对话框定义
(action_tile "cancel" "(done_dialog 0)")
(setq dd(start_dialog)) ; dd值=done_dialog后的自变量值
(cond ((= dd 1) (princ "\n确定
((= dd 0) (princ "\n取消
)
(prin1)
)
(prompt "*****VIEWDCL 预览对话框设计*****翔虹AutoCAD技术中心*****")
(prin1)
回复 举报