cad合并文字lisp
(defun c:test ()
(setq c "")
(while t
(setq sel (entsel "选择单行文字对象:"))
(if (null sel)
(progn
(princ "\n选择结束,生成文本")
(setq ss1 c)
(setq pt (getpoint "\n指定新文本位置: "))
(setq mkt (list
(cons 0 "TEXT")
(cons 100 "AcDbEntity")
(cons 67 0)
(cons 410 "Model")
(cons 100 "AcDbText")
(cons 10 pt)
(cons 40 2.5)
(cons 1 ss1)
(cons 50 0.0)
(cons 41 1.0)
(cons 51 0.0)
(cons 7 "Standard")
(cons 71 0)
(cons 11 '(0.0 0.0 0.0))
(cons 210 '(0.0 0.0 1.0))
))
(entmake mkt)
(exit)
)
(progn
(setq tname (car sel))
(setq tent (entget tname))
(setq b (cdr (assoc 1 tent))) ; 获取文本内容
(setq c (strcat c ";" b)) ; 将选中的文本内容添加到累积字符串c
(princ c)
)
)
)
(princ)
)
(c:test)