另一个,不使用DXF 7代码-只是Vlisp的stylename属性。。。
- (defun c:picktxtstyle ( / adoc ent st stcoll stobj )
- (vl-load-com)
- (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
-
- (while (not ent)
- (setq ent (car (entsel "\nPick text object that has TEXT STYLE property - DXF 7 code to make its style current")))
- (if (not (vlax-property-available-p (vlax-ename->vla-object ent) 'stylename))
- (progn
- (setq ent nil)
- (prompt "\nPicked entity doesn't have TEXT STYLE property, or missed selection; Try again...")
- )
- )
- )
- (setq st (vla-get-stylename (vlax-ename->vla-object ent)))
- (setq stcoll (vla-get-textstyles adoc))
- (setq stobj (vla-item stcoll st))
- (vla-put-activetextstyle adoc stobj)
- (princ)
- )
- (defun c:pckst nil (c:picktxtstyle))
M、 R。 |