tianyi1230
发表于 2014-1-26 09:20:38
繁花落叶 发表于 2014-1-24 17:14 static/image/common/back.gif
木有限制,不要看错文字。弧长 是可以设定的,可以看提示 “设置”。
弧线宽度,没有,不是长度!
yangkerjkl
发表于 2014-1-26 12:31:46
用的时候,老是提示“分配给保护的符号 end 是否进入中断循环”,是不是你把end重新赋值了啊?
繁花落叶
发表于 2014-1-26 14:07:20
yangkerjkl 发表于 2014-1-26 12:31 static/image/common/back.gif
用的时候,老是提示“分配给保护的符号 end 是否进入中断循环”,是不是你把end重新赋值了啊?
使用了vla-EndUndoMark,没有你说的end重新赋值。
繁花落叶
发表于 2014-1-26 14:14:05
本帖最后由 繁花落叶 于 2014-1-26 15:17 编辑
对cabinsummer版主的“智能技术要求库”http://bbs.mjtd.com/forum.php?mo ... D114%26typeid%3D114进行了一些修正,并运用到了批注词库上。(defun delsame (list0)
(if list0
(cons (car list0) (delsame (vl-remove (car list0) list0)))
)
)
(defun fwrdlist (list0 n)
(reverse (cdr (member (nth n list0) (reverse list0))))
)
(defun backlist (list0 n)
(cdr (member (nth n list0) list0))
)
(defun swapfwrd (list0 n)
(if (and
(>= (1- n) 0)
(> (length crtlst) n)
)
(setq list0 (append
(fwrdlist list0 (1- n))
(list (nth n list0) (nth (1- n) list0))
(backlist list0 n)
)
)
)
list0
)
(defun swapback (list0 n)
(if (and
(>= n 0)
(> (length crtlst) (1+ n))
)
(setq list0 (append
(fwrdlist list0 n)
(list (nth (1+ n) list0) (nth n list0))
(backlist list0 (1+ n))
)
)
)
list0
)
(defun add_item (list0 n item)
(if (and
(>= n 0)
(> (length crtlst) n)
)
(append
(fwrdlist list0 n)
(list item (nth n list0))
(backlist list0 n)
)
)
)
(defun del_item (list0 n)
(if (and
(>= n 0)
(> (length crtlst) n)
)
(append
(fwrdlist list0 n)
(backlist list0 n)
)
)
)
(defun mdfylist (list0 n item)
(if (and
(>= n 0)
(> (length crtlst) n)
)
(append
(fwrdlist list0 n)
(list item)
(backlist list0 n)
)
)
)
(defun readfn (/ fn ftext crtlst)
(setq fn (open (findfile "tcf.ini") "r"))
(while (setq ftext (read-line fn))
(setq crtlst (append
crtlst
(list ftext)
)
)
)
(close fn)
(if crtlst crtlst (setq crtlst '("")))
(setq textstr (nth 0 crtlst))
crtlst
)
(defun writefn (crtlst / fn x)
(setq fn (open (findfile "tcf.ini") "w"))
(foreach x crtlst
(write-line x fn)
)
(close fn)
)
(defun updlst (key lst)
(start_list key 3)
(mapcar
'add_list
lst
)
(end_list)
)
(defun do_list (key / n)
(setq n (atoi (get_tile key)))
(setq textstr (nth n crtlst))
(cond
((= key "itemlist")
(if (= (length crtlst) (1+ n))
(mode_tile "down" 1)
(mode_tile "down" 0)
)
(if (= n 0)
(mode_tile "up" 1)
(mode_tile "up" 0)
)
(set_tile "item" textstr)
(mode_tile "item" 2)
)
)
)
(defun mdfitem (/ n textstr)
(setq n (atoi (get_tile "itemlist"))
textstr (get_tile "item")
)
(if (member textstr crtlst)
(alert "抱歉,您还未修改!")
(progn
(setq crtlst (mdfylist crtlst n textstr))
(writefn crtlst)
(updlst "itemlist" crtlst)
(set_tile "itemlist" (itoa n))
(do_list "itemlist")
)
)
)
(defun additem ()
(if (member (get_tile "item") crtlst)
(alert "请修改后,重新添加!")
(progn
(setq crtlst (add_item crtlst (atoi (get_tile "itemlist"))
(get_tile "item")
)
)
(writefn (delsame crtlst))
(updlst "itemlist" crtlst)
(set_tile "itemlist" "0")
(do_list "itemlist")
)
)
)
(defun delitem ()
(setq crtlst (del_item crtlst (atoi (get_tile "itemlist"))))
(writefn crtlst)
(updlst "itemlist" crtlst)
(set_tile "itemlist" "0")
(do_list "itemlist")
)
(defun upitem (/ n textstr0 val)
(if (> (setq n (atoi (get_tile "itemlist")))
0
)
(progn
(setq crtlst (swapfwrd crtlst n))
(writefn crtlst)
(updlst "itemlist" crtlst)
(set_tile "itemlist" (itoa (1- n)))
(do_list "itemlist")
)
)
)
(defun downitem (/ n)
(if (< (setq n (atoi (get_tile "itemlist")))
(1- (length crtlst))
)
(progn
(setq crtlst (swapback crtlst n))
(writefn crtlst)
(updlst "itemlist" crtlst)
(set_tile "itemlist" (itoa (1+ n)))
(do_list "itemlist")
)
)
)
(defun tolib (/ ss fn n txt)
(setq ss (ssget '((0 . "text")))
do_what nil
)
(if ss
(progn
(setq n 0)
(repeat (sslength ss)
(setq crtlst (append
crtlst
(list (cdr (assoc 1 (entget (ssname ss n)))))
)
n (1+ n)
)
)
(setq crtlst (delsame crtlst))
(writefn crtlst)
(updlst "itemlist" crtlst)
)
)
(setq crtlst0 nil)
(princ)
)
(defun YunXian_ciku (/ crtlst dcl_file dlg_id do_what result scl syserr textstr)
(setvar "cmdecho" 0)
(setq syserr *error*
*error* '(nil (princ))
)
(setq scl (getvar "dimscale"))
(setq crtlst (readfn))
(if (and
(> (setq DLG_ID (load_dialog (setq Dcl_File (make-ciku-dcl))))
0
)
(vl-file-delete Dcl_File)
)
(while (and
(/= result 1)
(/= result 0)
)
(if (= do_what 3)
(tolib)
)
(if (new_dialog "teclib" DLG_ID)
(progn
(updlst "itemlist" crtlst)
(set_tile "itemlist" "0")
(set_tile "item" textstr)
(mode_tile "item" 2)
(mode_tile "up" 1)
(action_tile "itemlist" "(do_list \"itemlist\")")
(action_tile "item" "(setq textstr $$$$$$$$value)")
(action_tile "mdf" "(mdfitem)")
(action_tile "add" "(additem)")
(action_tile "del" "(delitem)")
(action_tile "up" "(upitem)")
(action_tile "down" "(downitem)")
(action_tile "pick" "(setq do_what 3)(done_dialog 2)")
(action_tile "accept" "(setq result 1)(setq ciyu (get_tile \"item\"))(done_dialog)")
(action_tile "cancel" "(setq result 0)(done_dialog 0)")
(start_dialog)
)
)
)
)
(unload_dialog DLG_ID)
(if (= result 1) (setq ciyu ciyu))
(setq *error* syserr)
(princ)
)
(defun make-ciku-dcl (/ lst_str str file f)
(setq lst_str '("teclib :dialog" "{"
"label=\"批注词库\";" ":boxed_row"
"{" " label=\"词库内容\";"
" :column" " {"
" :list_box" " {"
" key=\"itemlist\";" " value=\"0\";"
" width=43;" " height=10;"
" fixed_width=true;" " allow_accept=true;"
" value=\"0\";" " }"
" :edit_box" " {"
" key=\"item\";" " width=24;"
" allow_accept=true;" " }"
" spacer;" " }"
" :column" " {"
" fixed_width = true;" " alignment = centered;"
" :button" " {"
" label=\"添加\";" " key=\"add\";"
" fixed_width=true;" " }"
" :button" " {"
" label=\"删除\";" " key=\"del\";"
" fixed_width=true;" " }"
" :button" " {"
" label=\"上移\";" " key=\"up\";"
" fixed_width=true;" " }"
" :button" " {"
" label=\"下移\";" " key=\"down\";"
" fixed_width=true;" " }"
" :button" " {"
" label=\"修改\";" " key=\"mdf\";"
" fixed_width=true;" " }"
" }" "}"
":row" "{"
" :button" " {"
" label=\"采集入库\";" " key=\"pick\";"
" fixed_width=true;" " }"
" ok_cancel;" "}"
"}"
)
)
(setq file (vl-filename-mktemp ".dcl"))
(setq f (open file "w"))
(foreach str lst_str
(princ "\n" f)
(princ str f)
)
(close f)
file
)
Balance
发表于 2014-1-26 15:30:00
好像出不来云线。请问是运行在CAD哪个版本下面的?
Balance
发表于 2014-1-26 15:39:13
3.0版本输入命令后没有反应了,还是有bug呀。
繁花落叶
发表于 2014-1-26 16:31:19
Balance 发表于 2014-1-26 15:39 http://bbs.mjtd.com/static/image/common/back.gif
3.0版本输入命令后没有反应了,还是有bug呀。
如果有用过3.0之前的版本,请删除“D:\Gavin配置文件”目录下的全部文件再试试。
l18c19
发表于 2014-1-26 22:20:35
下载“YunXian图纸批注version 3.0.rar”完全能用,大力顶下!
Balance
发表于 2014-1-28 15:41:40
繁花落叶 发表于 2014-1-26 16:31 static/image/common/back.gif
如果有用过3.0之前的版本,请删除“D:\Gavin配置文件”目录下的全部文件再试试。
嗯。按照您的意见修改后可以使用了。非常不错!谢谢!希望能有更好的创意。
youjie2003
发表于 2014-2-10 16:12:43
很好很强大,非常有用,谢谢分享