嗨,论坛,
要首先达到第二个目标,请使用以下命令:
- ;;----------------=={ Set Attribute Value }==-----------------;;
- ;; ;;
- ;; Populates the first attribute matching the tag specified ;;
- ;; found within the block supplied with the value specified, ;;
- ;; if present. ;;
- ;;------------------------------------------------------------;;
- ;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;;
- ;;------------------------------------------------------------;;
- ;; Arguments: ;;
- ;; block - VLA Block Reference Object ;;
- ;; tag - Attribute TagString ;;
- ;; value - Value to which the Attribute will be set ;;
- ;;------------------------------------------------------------;;
- ;; Returns: Value the attribute was set to, else nil ;;
- ;;------------------------------------------------------------;;
- ;; Modified to process the attributes in reverse order.
- (defun LM:SetAttributeValue ( block tag value )
- ;; © Lee Mac 2010
- (vl-some
- (function
- (lambda ( attrib )
- (if (eq tag (vla-get-TagString attrib))
- (progn (vla-put-TextString attrib value) value)
- )
- )
- )
- [color=red](reverse[/color] (vlax-invoke block 'GetAttributes)[color=red])[/color]
- )
- )
|