在alin程序的基础上简化代码- (defun c:bw (/ atts InsPt AlignPt)
- (setq dolst '(0 2 0 6 8 6 9 11 9 12 14 12)
- atts (vlax-safearray->list
- (vlax-variant-value
- (vla-getattributes
- (vlax-ename->vla-object
- (car (entsel "\nSelect an attribute block: "))
- )))))
- (foreach att atts
- (print (vla-get-backward att))
- (if (= (vla-get-backward att) :vlax-false)
- (vla-put-backward att :vlax-true)
- (vla-put-backward att :vlax-false)
- )
- (setq InsPt (vla-get-InsertionPoint att)
- AlignPt (vla-get-TextAlignmentPoint att)
- altype (vla-get-alignment att)
- k (member altype dolst))
- (cond
- ((= 0 (car k))
- (setq do 'vla-put-TextAlignmentPoint dopt inspt))
- ((= 2 (car k))
- (setq do 'vla-put-InsertionPoint dopt AlignPt))
- (T (setq do 'vla-put-TextAlignmentPoint dopt AlignPt))
- )
- (vla-put-alignment att (cadr k))
- ((eval do) att dopt)
- );foreach
- (princ)
- )
|