明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: battman

关于弹出窗口调用txt文字(问题已经解决一半了,还有一半)

    [复制链接]
 楼主| 发表于 2006-8-26 09:32:00 | 显示全部楼层

1,不支持ctrl+c <v>,况且一行文字中我只需要选种一个字符以便复制,就不行了,这个程序只能选种一行文字,

2.在弹出的对话框中的Unicode字符都显示为“?”号了,

 楼主| 发表于 2006-8-28 08:09:00 | 显示全部楼层

晕了,这两个问题,不能解决吗?

发表于 2011-1-4 19:41:19 | 显示全部楼层
这个问题太有难度了,我也不会
发表于 2011-1-4 19:58:32 | 显示全部楼层
本帖最后由 Gu_xl 于 2011-1-4 19:59 编辑

调用windows的notepad,

  1. (defun c:op()
  2.   (startapp "notepad.exe" "c:\\program files\\autocad2005\\temp.txt")
  3.   )

发表于 2011-1-7 16:14:47 | 显示全部楼层
持续关注中 呵呵 我也需要这个
发表于 2011-1-11 09:02:38 | 显示全部楼层
咋没高手继续了呢 呵呵?
发表于 2011-1-11 12:17:50 | 显示全部楼层
回复 edsion24 的帖子

14楼不是已经给答案了吗?命令行输入:op 弹出记事本对话框!还没达到你的要求?
发表于 2011-1-11 20:11:04 | 显示全部楼层
...........
发表于 2011-1-12 09:49:35 | 显示全部楼层
本帖最后由 xshrimp 于 2011-1-12 09:50 编辑

双击复制到剪贴板

  1. (defun c:txt()
  2.   (defun list_ok()
  3.     (if (/= "" (setq get (get_tile "list")))
  4.     (progn
  5.     (setq n (nth (atoi get) strlst))
  6.     (gps->clip-settxt n)
  7.     (print n)
  8.     (princ)
  9.     )
  10.     )
  11.   (done_dialog 1)
  12.   )
  13.   (setq dclname
  14.     (cond  
  15.       ((setq tempname (vl-filename-mktemp "gps-dcl-tmp.dcl") filen (open tempname "w"))

  16. (foreach stream  

  17. '(  

  18. "txt:dialog { \n"

  19. "    label = "常用文字选择" ;\n"

  20. "    :list_box {key = "list" ;label = "文本内容,双击复制到剪贴板" ;}\n"

  21. "    cancel_button;\n"

  22. "}\n"

  23. )

  24. (princ stream filen)

  25. )
  26.        (close filen)
  27.        tempname
  28.       ))
  29.     )

  30. (setq strlst (gps->file-2strlst "c:\\boot.ini"))
  31. (setq dclid (load_dialog dclname))  
  32. (if (not (new_dialog "txt" dclid)) (progn (alert "dcl对话框加载失败.")(exit)))

  33. (start_list "list")
  34. (mapcar '(lambda(x)(add_list x)) strlst)
  35. (end_list)
  36. (action_tile "list" "(if (= $reason 4)(list_ok))")
  37. (start_dialog)
  38. (unload_dialog dclid)
  39. (vl-file-delete dclname)
  40. )

  41. (defun gps->file-2strlst (fn / f line re)   
  42.   (if  (and  (= (type fn) 'STR) (findfile fn))
  43.     (progn
  44.       (setq f (open (findfile fn) "r"))
  45.       (while (setq line (read-line f))

  46. (setq re (cons line re ))
  47.       )
  48.       (close f)
  49.       (reverse re)     
  50.     )  
  51.   )   
  52. )
  53. (defun gps->clip-settxt(str / html result)
  54. (if (and (= 'str (type str))
  55.          (setq html   (vlax-create-object "htmlfile"))
  56.     )
  57.     (progn
  58.       (setq result
  59.              (vlax-invoke-method
  60.                    (vlax-get
  61.                       (vlax-get html 'parentwindow)
  62.                       'clipboarddata
  63.                     )
  64.                    'setdata
  65.                    "text"
  66.                    str
  67.               )
  68.        )
  69.       (vlax-release-object html)
  70.       result
  71.      )
  72. );end if
  73. )


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2011-1-16 21:01:39 | 显示全部楼层
edit_box不支持多行文字啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-11 11:52 , Processed in 0.166578 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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