 - ;; Get Attribute Value - Lee Mac
- ;; Returns the value held by the specified tag within the supplied block, if present.
- ;; blk - [vla] VLA Block Reference Object
- ;; tag - [str] Attribute TagString
- ;; Returns: [str] Attribute value, else nil if tag is not found.
- (defun LM:vl-getattributevalue ( blk tag )
- (setq tag (strcase tag))
- (vl-some '(lambda ( att ) (if (= tag (strcase (vla-get-tagstring att))) (vla-get-textstring att)))
- (vlax-invoke blk 'getattributes)
- )
- )
- (defun c:tt( / ss i str ent entdb)
- (vl-load-com)
- (princ "\n请选择要连接的轴号")
- (setq ss (ssget '((0 . "INSERT") (66 . 1))))
- (setq i 0)
- (setq str "")
- (repeat (sslength ss)
- (setq ent (ssname ss i))
- (setq entdb (LM:vl-getattributevalue (vlax-ename->vla-object ent) "A"))
- (if (= str "")
- (setq str entdb)
- (setq str (strcat str "/" entdb))
- )
- (setq i (1+ i))
- )
- (princ str)
- (princ)
- )
|