- (defun c:fixtext ( / ss1 index newht newstyle styledata defwidth ename txtobj)
- (setq ss1 (ssget (list (cons 0 "*text")))
- index 0
- newht (getstring "\n输入文字高度: ")
- newstyle (getstring "\输入文字型式: ")
- )
- (if (setq styledata (tblsearch "style" newstyle))
- (progn
- (setq defwidth (cdr (assoc 41 styledata)))
- (while (setq ename (ssname ss1 index))
- (setq txtobj (vlax-ename->vla-object ename))
- (vlax-put-property txtobj 'Height newht)
- (vlax-put-property txtobj 'StyleName newstyle)
- (if (vlax-property-available-p txtobj 'ScaleFactor)
- (vlax-put-property txtobj 'ScaleFactor defwidth)
- )
- (setq index (1+ index))
- )
- )
- (princ "\n输入文字型式不存在!")
- )
- (princ)
- )
如何在输入文字高度及输入文字型式这二行增加,如果输入为空白(直接按ENTER),自定输入为某值?
|