预览dcl窗体
zml84
zml84 Lv.2
2010年11月29日 08:44:16
只看楼主

[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)")

[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]
免费打赏
kurt1000
2014年04月23日 15:01:02
2楼
本帖最后由 kurt1000 于 2014-4-23 16:33 编辑

命令: 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)
回复

相关推荐

APP内打开