如何实现:多行文字转单行文字(样图如附件)
如何实现:多行文字转单行文字(样图如附件)X,爆破就行了,简单高效 xtjd 发表于 2024-5-27 23:56
感谢大佬出手相助,
还有个比较麻烦点的,大佬可否帮看一眼:http://bbs.mjtd.com/thread-190275-1-1.html fengyu6913 发表于 2024-5-28 16:20
感谢大佬出手相助,
还有个比较麻烦点的,大佬可否帮看一眼:http://bbs.mjtd.com/thread- ...
;先给一个简易版本用着
(defun c:ty(/ cmd dxf ed en en2 lp1 lp2 p1 p2 p3 pa pb pinc ss xl1)
(defun pinc(p)(and(<(min(car p1)(car p2))(car p)(max(car p1)(car p2)))(<(min(cadr p1)(cadr p2))(cadr p)(max(cadr p1)(cadr p2)))))
(defun dxf(n)(cdr(assoc n ed)))
(defun xl1(pt)(entmakex (list '(0 . "XLINE") '(100 . "AcDbEntity") '(100 . "AcDbXline") (cons 10 pt) '(11 1 0 0))))
(setvar "cmdecho" 0)
(if(and
(setq p1(getpoint "\n请选择需要延伸或裁剪的线:"))
(setq p2(getcorner p1))
(setq p3(getpoint "请指定线段到达点:"))
)
(if(setq ss(ssget "c" p1 p2 '((0 . "line"))))
(progn
(setq en(ssname ss 0) ed(entget en))
(setq pa(dxf 10) pb(dxf 11))
(if(pinc pa)(setq lp1 pb lp2 pa)(setq lp1 pa lp2 pb))
(if(<(abs(-(cadr lp1)(cadr lp2)))(abs(-(cadr lp1)(cadr p3))))(setq cmd ".extend")(setq cmd ".trim"))
(command ".undo" "be")
(setq en2(xl1 p3))
(command cmd "o" "s" en2 "" p1 p2 "")
(entdel en2)
(command ".undo" "end")
)
)
)
(prin1)
)
(defun c:tx(/ cmd dxf ed en en2 lp1 lp2 p1 p2 p3 pa pb pinc ss xl2)
(defun pinc(p)(and(<(min(car p1)(car p2))(car p)(max(car p1)(car p2)))(<(min(cadr p1)(cadr p2))(cadr p)(max(cadr p1)(cadr p2)))))
(defun dxf(n)(cdr(assoc n ed)))
(defun xl2(pt)(entmakex (list '(0 . "XLINE") '(100 . "AcDbEntity") '(100 . "AcDbXline") (cons 10 pt) '(11 0 -1 0))))
(setvar "cmdecho" 0)
(if(and
(setq p1(getpoint "\n请选择需要延伸或裁剪的线:"))
(setq p2(getcorner p1))
(setq p3(getpoint "请指定线段到达点:"))
)
(if(setq ss(ssget "c" p1 p2 '((0 . "line"))))
(progn
(setq en(ssname ss 0) ed(entget en))
(setq pa(dxf 10) pb(dxf 11))
(if(pinc pa)(setq lp1 pb lp2 pa)(setq lp1 pa lp2 pb))
(if(<(abs(-(car lp1)(car lp2)))(abs(-(car lp1)(car p3))))(setq cmd ".extend")(setq cmd ".trim"))
(command ".undo" "be")
(setq en2(xl2 p3))
(command cmd "o" "s" en2 "" p1 p2 "")
(entdel en2)
(command ".undo" "end")
)
)
)
(prin1)
) 我也想要这个插件,可惜币不够啊 xtjd 发表于 2024-5-27 23:56
90度的多行文字 运行代码后文字会断开 自贡黄明儒 发表于 2024-5-28 09:51
X,爆破就行了,简单高效
但是有些文字跟数字连起来的,也会断开 是因为文字样式的问题嘛大佬 感谢大佬分享 xtjd 发表于 2024-5-27 23:56
这个跟炸开没什么区别啊,多行文字有几行的用这个也是单独断开了
页:
[1]
2