明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2255|回复: 11

按钮-文件的连接

  [复制链接]
发表于 2004-9-19 22:27:00 | 显示全部楼层 |阅读模式
怎么让点击按钮,从而打开某个文件
发表于 2004-9-20 08:23:00 | 显示全部楼层
Which button? on existing toolbars?
发表于 2004-9-20 09:03:00 | 显示全部楼层
楼主是这个意思. 请楼主使用搜索工能. 可以在这个版块找到你要找的内容.
 楼主| 发表于 2004-9-20 19:25:00 | 显示全部楼层
没有找到啊。


比如我想在dcl对话框中添加一个"查看文件资料"按钮,应该在lsp程序中用什么语句,才能使我连上d:/lsp/ziliao.htm文件。
发表于 2004-9-20 19:38:00 | 显示全部楼层
本帖最后由 作者 于 2004-9-20 20:05:46 编辑

(command "browser" "d:/lsp/ziliao.htm"), 不过你要先关闭对话框 或试试(startapp "EXPLORER.EXE" "d:/lsp/ziliao.htm")James Maeding 给了我们这个程序,一般的文件都能打开,很方便
  1. (DEFUN CT-WINRUN (NAME / FILENAME)
  2.    (IF (NOT (SETQ FILENAME (FINDFILE NAME)))
  3.        (PROGN
  4.            (ALERT (STRCAT "File " NAME " cannot be found."))
  5.            (VL-EXIT-WITH-VALUE 1)
  6.            )
  7.        )
  8.    (IF (NOT (FINDFILE (STRCAT (GETENV "SYSTEMROOT") "\\EXPLORER.EXE")))
  9.        (PROGN
  10.            (ALERT (STRCAT "Explorer cannot be found so file cannot be run."))
  11.            (VL-EXIT-WITH-VALUE 1)
  12.            )
  13.        )
  14.    (vl-arx-import 'Startapp)
  15.    (STARTAPP (STRCAT (GETENV "SYSTEMROOT") "\\EXPLORER.EXE") FILENAME)
  16.    )
复制代码
 楼主| 发表于 2004-9-20 20:12:00 | 显示全部楼层
不行,运行时死机 ;;;;;;;;;;驱动对话框---------------------------------------------------
(defun rcxtxlzq(/ id nldraw)
(setq olderr *error* *error* clerr)
(setq id (load_dialog "nl.dcl"))
(if (new_dialog "rcxtxlzq" id)
(progn
(start_list "nl")
(add_list "NL1")
(add_list "NL2")
(add_list "NL3")
(add_list "NL4")
(add_list "NL5")
(add_list "NL6")
(add_list "NL7")
(add_list "NL8")
(add_list "NL9")
(add_list "NL10")
(end_list)
(start_image "nlpic")
(slide_image 20 0 (dimx_tile "nlpic") (dimy_tile "nlpic") "nl")
(end_image)
(action_tile "ziliao" "(nl_ziliao)")
(action_tile "accept" "(setq nldraw 1)(getnl_dcl)(done_dialog)")
(action_tile "cancel" "(done_dialog)")
(start_dialog)
)
(princ "error,can't open the dialog")
) (defun nl_ziliao()
(command "browser" "f:\\ziliao.htm")
)
 楼主| 发表于 2004-9-20 20:17:00 | 显示全部楼层
picture
发表于 2004-9-20 20:54:00 | 显示全部楼层
发表于 2004-9-20 22:54:00 | 显示全部楼层
(defun nl_ziliao()
(command "shell" "f:\\ziliao.htm")
)
发表于 2004-9-21 15:09:00 | 显示全部楼层
heart1982发表于2004-9-20 20:12:00不行,运行时死机 ;;;;;;;;;;驱动对话框---------------------------------------------------(defun rcxtxlzq(/ id nldraw) (setq olderr *error* ...

You cannot use run (command ...) while your dialog box is still open! Try (startapp...) or (CT-WINRUN ...)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-30 14:16 , Processed in 0.184978 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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