试试这个。。它过滤掉当前粗体的文本,因此您不必在循环中签入
- (defun c:hcb (/ _ps->ss o ss)
- ;; Use a function like this to convert a selection set to a list of items
- (defun _ps->ss (ps)
- (if (= 'pickset (type ps))
- (vl-remove-if 'listp (mapcar 'cadr (ssnamex ps)))
- )
- )
- (if (setq ss (_ps->ss (ssget ":L" '((0 . "mtext") (1 . "~{\\fArial|b1|i0|c0|p34;*")))))
- (foreach mtext ss
- (setq o (vlax-ename->vla-object mtext))
- (vla-put-textstring o (strcat "{\\fArial|b1|i0|c0|p34;" (vla-get-textstring o)))
- )
- )
- (princ)
- )
|