本帖最后由 lincctw_ccl 于 2013-8-29 21:55 编辑
请教下列程序是否为最后二段有问题? 文字写不出来 请各位帮看看 谢谢!
;;文字结合
(defun C:tt (/)
(setvar "CMDECHO" 0)
(if (not (tblsearch "style" "001"))
(command "style" "001" "romans,ae" "" "0.8" "10" "" "" "")
)
;;end if
(if (not (tblsearch "style" "002"))
(command "style" "002" "romans,ae" "" "0.8" "10" "" "" "")
)
;;end if
(if (not (tblsearch "style" "003"))
(command "style" "003" "romans,ae" "" "0.8" "10" "" "" "")
)
;;end if
(setq p001 (getpoint "\n txt point:"))
(setq p1 (getpoint "\n p1:"))
(setq p2 (getcorner p1 "\n p2:"))
;;;;;
(setq ss1 (ssget "c" p1 p2 '((0 . "TEXT") (7 . "001"))))
(setq len1 (sslength ss1))
(setq n1 0)
(setq ent1 (ssname ss1 n1))
(setq ent1txt (cdr (assoc 1 (entget ent1))))
;;;;;
(setq ss2 (ssget "c" p1 p2 '((0 . "TEXT") (7 . "002"))))
(setq len2 (sslength ss2))
(setq n2 0)
(setq ent2 (ssname ss2 n2))
(setq ent2txt (cdr (assoc 1 (entget ent2))))
;;;;;
(setq ss3 (ssget "c" p1 p2 '((0 . "TEXT") (7 . "003"))))
(setq len3 (sslength ss3))
(setq n3 0)
(setq ent3 (ssname ss3 n3))
(setq ent3txt (cdr (assoc 1 (entget ent3))))
;
(setq txtps (strcat ent1txt ent2txt ent3txt))
(command "text" p001 "" "" txtps "")
(princ)
)
再次向各位请教如上述程序中 (setq txtps (strcatent1txt ent2txt ent3txt)) Txtps 由上述3种字抓出而结合写成 ssget 在选不到字型会出现程序出错 例 选择范围中 仅有 001 003 字型 有什么方式能在选不到002 字型的状况下而程序又不会中断? 如可行,程序该如何修正? 谢谢!!
|