明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: 繁花落叶

图纸批注-审图专业版--2014.3.8更新 version 3.1

    [复制链接]
发表于 2014-1-26 09:20 | 显示全部楼层
繁花落叶 发表于 2014-1-24 17:14
木有限制,不要看错文字。弧长 是可以设定的,可以看提示 “设置”。

弧线宽度,没有,不是长度!
发表于 2014-1-26 12:31 | 显示全部楼层
用的时候,老是提示“分配给保护的符号 end 是否进入中断循环”,是不是你把end重新赋值了啊?
 楼主| 发表于 2014-1-26 14:07 | 显示全部楼层
yangkerjkl 发表于 2014-1-26 12:31
用的时候,老是提示“分配给保护的符号 end 是否进入中断循环”,是不是你把end重新赋值了啊?

使用了vla-EndUndoMark,没有你说的end重新赋值。
 楼主| 发表于 2014-1-26 14:14 | 显示全部楼层
本帖最后由 繁花落叶 于 2014-1-26 15:17 编辑

对cabinsummer版主的“智能技术要求库”http://bbs.mjtd.com/forum.php?mo ... D114%26typeid%3D114进行了一些修正,并运用到了批注词库上。
  1. (defun delsame (list0)
  2.   (if list0
  3.     (cons (car list0) (delsame (vl-remove (car list0) list0)))
  4.   )
  5. )
  6. (defun fwrdlist (list0 n)
  7.   (reverse (cdr (member (nth n list0) (reverse list0))))
  8. )
  9. (defun backlist (list0 n)
  10.   (cdr (member (nth n list0) list0))
  11. )
  12. (defun swapfwrd (list0 n)
  13.   (if (and
  14.         (>= (1- n) 0)
  15.         (> (length crtlst) n)
  16.       )
  17.     (setq list0 (append
  18.                   (fwrdlist list0 (1- n))
  19.                   (list (nth n list0) (nth (1- n) list0))
  20.                   (backlist list0 n)
  21.                 )
  22.     )
  23.   )
  24.   list0
  25. )
  26. (defun swapback (list0 n)
  27.   (if (and
  28.         (>= n 0)
  29.         (> (length crtlst) (1+ n))
  30.       )
  31.     (setq list0 (append
  32.                   (fwrdlist list0 n)
  33.                   (list (nth (1+ n) list0) (nth n list0))
  34.                   (backlist list0 (1+ n))
  35.                 )
  36.     )
  37.   )
  38.   list0
  39. )
  40. (defun add_item (list0 n item)
  41.   (if (and
  42.         (>= n 0)
  43.         (> (length crtlst) n)
  44.       )
  45.     (append
  46.       (fwrdlist list0 n)
  47.       (list item (nth n list0))
  48.       (backlist list0 n)
  49.     )
  50.   )
  51. )
  52. (defun del_item (list0 n)
  53.   (if (and
  54.         (>= n 0)
  55.         (> (length crtlst) n)
  56.       )
  57.     (append
  58.       (fwrdlist list0 n)
  59.       (backlist list0 n)
  60.     )
  61.   )
  62. )
  63. (defun mdfylist (list0 n item)
  64.   (if (and
  65.         (>= n 0)
  66.         (> (length crtlst) n)
  67.       )
  68.     (append
  69.       (fwrdlist list0 n)
  70.       (list item)
  71.       (backlist list0 n)
  72.     )
  73.   )
  74. )
  75. (defun readfn (/ fn ftext crtlst)
  76.   (setq fn (open (findfile "tcf.ini") "r"))
  77.   (while (setq ftext (read-line fn))
  78.     (setq crtlst (append
  79.                    crtlst
  80.                    (list ftext)
  81.                  )
  82.     )
  83.   )
  84.   (close fn)
  85.   (if crtlst crtlst (setq crtlst '("")))
  86.   (setq textstr (nth 0 crtlst))
  87.    crtlst
  88. )
  89. (defun writefn (crtlst / fn x)
  90.   (setq fn (open (findfile "tcf.ini") "w"))
  91.   (foreach x crtlst
  92.     (write-line x fn)
  93.   )
  94.   (close fn)
  95. )
  96. (defun updlst (key lst)
  97.   (start_list key 3)
  98.   (mapcar
  99.     'add_list
  100.     lst
  101.   )
  102.   (end_list)
  103. )
  104. (defun do_list (key / n)
  105.   (setq n (atoi (get_tile key)))
  106.   (setq textstr (nth n crtlst))
  107.   (cond
  108.     ((= key "itemlist")
  109.       (if (= (length crtlst) (1+ n))
  110.         (mode_tile "down" 1)
  111.         (mode_tile "down" 0)
  112.       )
  113.       (if (= n 0)
  114.         (mode_tile "up" 1)
  115.         (mode_tile "up" 0)
  116.       )
  117.       (set_tile "item" textstr)
  118.       (mode_tile "item" 2)
  119.     )
  120.   )
  121. )
  122. (defun mdfitem (/ n textstr)
  123.   (setq n (atoi (get_tile "itemlist"))
  124.         textstr (get_tile "item")
  125.   )
  126.   (if (member textstr crtlst)
  127.     (alert "抱歉,您还未修改!")
  128.     (progn
  129.       (setq crtlst (mdfylist crtlst n textstr))
  130.       (writefn crtlst)
  131.       (updlst "itemlist" crtlst)
  132.       (set_tile "itemlist" (itoa n))
  133.       (do_list "itemlist")
  134.     )
  135.   )
  136. )
  137. (defun additem ()
  138.   (if (member (get_tile "item") crtlst)
  139.     (alert "请修改后,重新添加!")
  140.     (progn
  141.       (setq crtlst (add_item crtlst (atoi (get_tile "itemlist"))
  142.                              (get_tile "item")
  143.                    )
  144.       )
  145.       (writefn (delsame crtlst))
  146.       (updlst "itemlist" crtlst)
  147.       (set_tile "itemlist" "0")
  148.       (do_list "itemlist")
  149.     )
  150.   )
  151. )
  152. (defun delitem ()
  153.   (setq crtlst (del_item crtlst (atoi (get_tile "itemlist"))))
  154.   (writefn crtlst)
  155.   (updlst "itemlist" crtlst)
  156.   (set_tile "itemlist" "0")
  157.   (do_list "itemlist")
  158. )
  159. (defun upitem (/ n textstr0 val)
  160.   (if (> (setq n (atoi (get_tile "itemlist")))
  161.          0
  162.       )
  163.     (progn
  164.       (setq crtlst (swapfwrd crtlst n))
  165.       (writefn crtlst)
  166.       (updlst "itemlist" crtlst)
  167.       (set_tile "itemlist" (itoa (1- n)))
  168.       (do_list "itemlist")
  169.     )
  170.   )
  171. )
  172. (defun downitem (/ n)
  173.   (if (< (setq n (atoi (get_tile "itemlist")))
  174.          (1- (length crtlst))
  175.       )
  176.     (progn
  177.       (setq crtlst (swapback crtlst n))
  178.       (writefn crtlst)
  179.       (updlst "itemlist" crtlst)
  180.       (set_tile "itemlist" (itoa (1+ n)))
  181.       (do_list "itemlist")
  182.     )
  183.   )
  184. )
  185. (defun tolib (/ ss fn n txt)
  186.   (setq ss (ssget '((0 . "text")))
  187.         do_what nil
  188.   )
  189.   (if ss
  190.     (progn
  191.       (setq n 0)
  192.       (repeat (sslength ss)
  193.         (setq crtlst (append
  194.                        crtlst
  195.                        (list (cdr (assoc 1 (entget (ssname ss n)))))
  196.                      )
  197.               n (1+ n)
  198.         )
  199.       )
  200.       (setq crtlst (delsame crtlst))
  201.       (writefn crtlst)
  202.       (updlst "itemlist" crtlst)
  203.     )
  204.   )
  205.   (setq crtlst0 nil)
  206.   (princ)
  207. )
  208. (defun YunXian_ciku (/ crtlst dcl_file dlg_id do_what result scl syserr textstr)
  209.   (setvar "cmdecho" 0)
  210.   (setq syserr *error*
  211.         *error* '(nil (princ))
  212.   )
  213.   (setq scl (getvar "dimscale"))
  214.   (setq crtlst (readfn))
  215.   (if (and
  216.         (> (setq DLG_ID (load_dialog (setq Dcl_File (make-ciku-dcl))))
  217.            0
  218.         )
  219.         (vl-file-delete Dcl_File)
  220.       )
  221.     (while (and
  222.              (/= result 1)
  223.              (/= result 0)
  224.            )
  225.       (if (= do_what 3)
  226.         (tolib)
  227.       )
  228.       (if (new_dialog "teclib" DLG_ID)
  229.         (progn
  230.           (updlst "itemlist" crtlst)
  231.           (set_tile "itemlist" "0")
  232.           (set_tile "item" textstr)
  233.           (mode_tile "item" 2)
  234.           (mode_tile "up" 1)
  235.           (action_tile "itemlist" "(do_list "itemlist")")
  236.           (action_tile "item" "(setq textstr $$$$$$$$value)")
  237.           (action_tile "mdf" "(mdfitem)")
  238.           (action_tile "add" "(additem)")
  239.           (action_tile "del" "(delitem)")
  240.           (action_tile "up" "(upitem)")
  241.           (action_tile "down" "(downitem)")
  242.           (action_tile "pick" "(setq do_what 3)(done_dialog 2)")
  243.           (action_tile "accept" "(setq result 1)(setq ciyu (get_tile "item"))(done_dialog)")
  244.           (action_tile "cancel" "(setq result 0)(done_dialog 0)")
  245.           (start_dialog)
  246.         )
  247.       )
  248.     )
  249.   )
  250.   (unload_dialog DLG_ID)
  251.   (if (= result 1) (setq ciyu ciyu))
  252.   (setq *error* syserr)
  253.   (princ)
  254. )

  255. (defun make-ciku-dcl (/ lst_str str file f)
  256.   (setq lst_str '("teclib :dialog" "{"
  257.          "  label="批注词库";" "  :boxed_row"
  258.          "  {" "    label="词库内容";"
  259.          "    :column" "    {"
  260.          "      :list_box" "      {"
  261.          "        key="itemlist";" "        value="0";"
  262.          "        width=43;" "        height=10;"
  263.          "        fixed_width=true;" "        allow_accept=true;"
  264.          "        value="0";" "      }"
  265.          "      :edit_box" "      {"
  266.          "        key="item";" "        width=24;"
  267.          "        allow_accept=true;" "      }"
  268.          "      spacer;" "    }"
  269.          "    :column" "    {"
  270.          "      fixed_width = true;" "      alignment = centered;"
  271.          "      :button" "      {"
  272.          "        label="添加";" "        key="add";"
  273.          "        fixed_width=true;" "      }"
  274.          "      :button" "      {"
  275.          "        label="删除";" "        key="del";"
  276.          "        fixed_width=true;" "      }"
  277.          "      :button" "      {"
  278.          "        label="上移";" "        key="up";"
  279.          "        fixed_width=true;" "      }"
  280.          "      :button" "      {"
  281.          "        label="下移";" "        key="down";"
  282.          "        fixed_width=true;" "      }"
  283.          "      :button" "      {"
  284.          "        label="修改";" "        key="mdf";"
  285.          "        fixed_width=true;" "      }"
  286.          "    }" "  }"
  287.          "  :row" "  {"
  288.          "    :button" "    {"
  289.          "      label="采集入库";" "      key="pick";"
  290.          "      fixed_width=true;" "    }"
  291.          "    ok_cancel;" "  }"
  292.          "}"
  293.         )
  294.   )
  295.   (setq file (vl-filename-mktemp ".dcl"))
  296.   (setq f (open file "w"))
  297.   (foreach str lst_str
  298.     (princ "\n" f)
  299.     (princ str f)
  300.   )
  301.   (close f)
  302.   file
  303. )

本帖子中包含更多资源

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

x
发表于 2014-1-26 15:30 | 显示全部楼层
好像出不来云线。请问是运行在CAD哪个版本下面的?
发表于 2014-1-26 15:39 | 显示全部楼层
3.0版本输入命令后没有反应了,还是有bug呀。
 楼主| 发表于 2014-1-26 16:31 | 显示全部楼层
Balance 发表于 2014-1-26 15:39
3.0版本输入命令后没有反应了,还是有bug呀。


如果有用过3.0之前的版本,请删除“D:\Gavin配置文件”目录下的全部文件再试试。
发表于 2014-1-26 22:20 | 显示全部楼层
下载“YunXian图纸批注version 3.0.rar”完全能用,大力顶下!
发表于 2014-1-28 15:41 | 显示全部楼层
繁花落叶 发表于 2014-1-26 16:31
如果有用过3.0之前的版本,请删除“D:\Gavin配置文件”目录下的全部文件再试试。

嗯。按照您的意见修改后可以使用了。非常不错!谢谢!希望能有更好的创意。
发表于 2014-2-10 16:12 | 显示全部楼层
很好很强大,非常有用,谢谢分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-8 10:20 , Processed in 0.242110 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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