发布于:2010-07-08 17:28:08
来自:建筑设计/CAD下载及教程
[复制转发]
;;三行变四行
(defun c:a3 (/ ss i ed edlit tmptxt pt orint wheight pt2 poi ntxt ntxt2)
(princ "\n-------------标注三行变四行-------\n")
(setq ss (ssget '((0 . "text") (1 . "*L*"))))
(setq i 0)
(command "_.undo" "_begin")
(repeat (sslength ss)
(setq ed (ssname ss i))
(setq edlit (entget ed))
(setq tmptxt (cdr (assoc 1 edlit))
pt (cdr (assoc 10 edlit))
orint (cdr (assoc 50 edlit))
wheight (cdr (assoc 40 edlit))
)
(setq pt2 (polar pt (+ orint (/ pi 2)) (* wheight 1.1)))
(if (setq poi (vl-string-search ")" tmptxt))
(progn
(if (> (strlen tmptxt) (+ poi 1))
(progn
(setq ntxt (substr tmptxt 1 (+ poi 1)))
(setq ntxt2
(vl-string-left-trim " " (substr tmptxt (+ poi 2)))
)
(setq edlit (subst (cons 1 ntxt2) (assoc 1 edlit) edlit))
(entmod edlit)
(command "copy" ed "" "non" pt "non" pt2 "")
(setq ed2 (entlast))
(setq edlit (entget ed2))
(setq edlit (subst (cons 1 ntxt) (assoc 1 edlit) edlit))
(entmod edlit)
)
)
)
)
(setq i (1+ i))
)
(command "_.undo" "_end")
)
全部回复(8 )
只看楼主 我来说两句为什么我加载后,变行后,梁编号不见了
回复 举报
回复 举报