求助大侠,两个text合并,改变颜色,高亮显示!!!
[*](defun c:hh( / enall pn_ent0 pn_ent1 xobj1 xobj2 oldtext1 oldtext2)
[*] (vl-load-com)
[*] (prompt "请选择两个text文字!")
[*] (setq enall (ssget ))
[*] (setq pn_ent0 (ssname enall 0))
[*] (setq pn_ent1 (ssname enall 1))
[*] (setq xobj1 (vlax-ename->vla-object pn_ent0))
[*] (setq xobj2 (vlax-ename->vla-object pn_ent1))
[*] (setq oldtext1 (vla-get-TextString xobj1))
[*] (setq oldtext2 (vla-get-TextString xobj2))
[*] (setq newtext (strcat oldtext1 "," oldtext2 ))
[*] (vla-put-TextString xobj1 newtext )
[*] (vla-put-Color xobj1 2)
[*] (entupd pn_ent0)
[*] (KX-redraw3pn_ent0)
[*] (entdelpn_ent1)
[*] )
[*](defun KX-redraw3(S1)
[*]
[*](IF S1 (redraw S1 3))
[*]
[*])
(sssetfirst nil (ssadd pn_ent0))
页:
[1]