明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: naul

菜鸟求助

  [复制链接]
发表于 2007-4-7 10:40 | 显示全部楼层


;;;
;;; TESTDCL.LSP .... by M.P.Saju.
;;; This is a freeware. License for use of this application is granted for
;;; distribution, provided it is not mutilated. If there are problems please
;;; feel free to contact the author at mpsaju@yahoo.com
;;;
;;; Testing *.DCL files becomes a necessity when developing a good sized lisp
;;; application for easy input and understanding. This routine in lisp was
;;; written for just such a necessity.
;;;
;;; Usage is very simple... Just type "Testdcl" in Autocad text screen and press
;;; "enter". A file selection dialog box will open up to select the DCL file.
;;; On entering, the DCL under test will open. This application works under
;;; the assumption that there is an active "accept" or "cancel" button.
;;;
;;; I have tried to solve all problems that I have encountered. However if there
;;; are any further issues please feel free to contact me.


(defun c:testdcl (/ nam$ nam id loop)
  ;; lisp for checking dialogboxes at the beginning of their design
  (setq nam$ (getfiled "Select a DCL file" "" "dcl" 0))
  (setq nam (identify nam$))
)
(defun identify (nam$ / file x dd dd$)
  (setq file (open nam$ "r")
        dd$  nil
        dd   nil
        x    0
  )
  (while (setq dd (read-line file))
    (if (wcmatch dd "*: dialog {")
      (progn
        (setq dd$ (substr dd 1 (- (strlen dd) 11)))
        (if (wcmatch dd$ " *")
          (setq dd$ (substr dd$ 2 (strlen dd$)))
          ;; added for eliminating blank
        )
        (rundcl nam$ dd$)
      )
    )
  )
  (close file)
  dd$
)


(defun rundcl (nam$ nam)
  (setq id (load_dialog nam$))
  (if (not (new_dialog nam id))
    (exit)
  )
  (action_tile "cancel" "(done_dialog 0)")
  ;; cancel button dialog.. normally in all DCLs
  (action_tile "accept" "(done_dialog 0)")
  ;; accept button dialog.. normally in all DCLs
  (setq loop (start_dialog))
)

;|
ref Link:
http://www.autocadokulu.com/portal/forums.php?m=posts&q=3214
|;


您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-19 11:39 , Processed in 0.134125 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表