Try this get the attributes and values from your insertion(s):
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Gather Attributes and values ;;;
;;; Function: gatheratts ;;;
;;; Purpose: Gathers all the attributes and their values into a list ;;;
;;; for all insertions of specified blocks. ;;;
;;; Arguments: bnames list of block names to find ;;;
;;; Returns: A list of lists Organized by block name as follows: ;;;
;;; ( ;;;
;;; (bname1 the name of the first block ;;;
;;; (bref1 atts) the bref object followed by a list of attrib objects ;;;
;;; (bref2 atts) the bref object followed by a list of attrib objects ;;;
;;; ) ;;;
;;; (bname2 the name of the second block ;;;
;;; (bref3 atts) the bref object followed by a list of attrib objects ;;;
;;; (bref4 atts) the bref object followed by a list of attrib objects ;;;
;;; ) ;;;
;;; ) ;;;
;;; Dependencies: none ;;;
;;; In the above, atts is list of dotted pairs, car being the tagstring, and cdr ;;;
;;; being the attribute object. Thus, the attribute object for any attribute can ;;;
;;; be extracted by: ;;;
;;; (cdr (assoc tag (cdr(nth indx(cdr (assoc bname rtlist)))))) ;;;
;;; where: ;;;
;;; tag = the attribute tag string ;;;
;;; indx = is the nth insertion of bname ;;;
;;; bname = the block name ;;;
;;; rtlist = the list returned by gatheratts ;;;
;;; There may be any number of block names (bname) and any number of block ;;;
;;; insertions. ;;;
;;;---------------------------------------------------------------------------------------------;;;
;;; Example: Given a block named "BRD_TTL", Calling GatherAtts thus, ;;;
;;; (GatherAtts '("BRD_TTL")) will return the following: ;;;
;;;(("BRD_TTL" ;;;
;;; (#<VLA-OBJECT IAcadBlockReference2 14d22114> ;;;
;;; ("BUILDING_NO" . #<VLA-OBJECT IAcadAttributeReference2 14d21f04> ) ;;;
;;; ("BLDG_NAME" . #<VLA-OBJECT IAcadAttributeReference2 14d21eb4> ) ;;;
;;; ("PACKAGE_NO" . #<VLA-OBJECT IAcadAttributeReference2 14d21e64> ) ;;;
;;; ("DRAWING_TITLE" . #<VLA-OBJECT IAcadAttributeReference2 14d21e14> ) ;;;
;;; ("DRAWING_NO" . #<VLA-OBJECT IAcadAttributeReference2 14d21dc4> ) ;;;
;;; ("DRAWING_TITLE_LINE_1" . #<VLA-OBJECT IAcadAttributeReference2 14d21d74> ) ;;;
;;; ("DRAWING_TITLE_LINE_2" . #<VLA-OBJECT IAcadAttributeReference2 14d21d14> ) ;;;
;;; ("DRAWING_TITLE_LINE_3" . #<VLA-OBJECT IAcadAttributeReference2 14d21cb4> ) ;;;
;;; ("DRAWING_TITLE_LINE_4" . #<VLA-OBJECT IAcadAttributeReference2 14d21c54> ) ;;;
;;; ("CADD_NAME" . #<VLA-OBJECT IAcadAttributeReference2 14d21bf4> ) ;;;
;;; ("SCALE" . #<VLA-OBJECT IAcadAttributeReference2 14d21b94> ) ;;;
;;; ("PROJECT_NO" . #<VLA-OBJECT IAcadAttributeReference2 14d21814> ) ;;;
;;; ("PROJECT_COORDINATOR" . #<VLA-OBJECT IAcadAttributeReference2 14d217b4> ) ;;;
;;; ("ENGINEERING_COORDINATOR" . #<VLA-OBJECT IAcadAttributeReference2 14d21754> ) ;;;
;;; ("L1REV" . #<VLA-OBJECT IAcadAttributeReference2 14d216f4> ) ;;;
;;; ("L1DATE" . #<VLA-OBJECT IAcadAttributeReference2 14d21694> ) ;;;
;;; ("L1DESC" . #<VLA-OBJECT IAcadAttributeReference2 14d21634> ) ;;;
;;; ("L1BY" . #<VLA-OBJECT IAcadAttributeReference2 14d215d4> ) ;;;
;;; ("L2REV" . #<VLA-OBJECT IAcadAttributeReference2 14d21574> ) ;;;
;;; ("L2DATE" . #<VLA-OBJECT IAcadAttributeReference2 14d21514> ) ;;;
;;; ("L2DESC" . #<VLA-OBJECT IAcadAttributeReference2 14d214b4> ) ;;;
;;; ("L2BY" . #<VLA-OBJECT IAcadAttributeReference2 14d21454> ) ;;;
;;; ("L3REV" . #<VLA-OBJECT IAcadAttributeReference2 14d213f4> ) ;;;
;;; ("L3DATE" . #<VLA-OBJECT IAcadAttributeReference2 14d21394> ) ;;;
;;; ("L3DESC" . #<VLA-OBJECT IAcadAttributeReference2 14d21334> ) ;;;
;;; ("L3BY" . #<VLA-OBJECT IAcadAttributeReference2 14d212d4> ) ;;;
;;; ("ISSUE_STATUS" . #<VLA-OBJECT IAcadAttributeReference2 14d26454> ) ;;;
;;; ("ISSUE_STATUS1" . #<VLA-OBJECT IAcadAttributeReference2 14d263f4> ) ;;;
;;; ("ISSUE_STATUS2" . #<VLA-OBJECT IAcadAttributeReference2 14d26394> ) ;;;
;;; ) ;;;
;;; ) ;;;
;;;) ;;;
;;; If this were asssigned to variable "ATTS" then the attribute for a specific tag, say "L1BY";;;
;;; would be retrieved with: ;;;
;;; (cdr (assoc "L1BY" (cdr(nth 0 (cdr (assoc "BRD_TTL" ATTS)))))) ;;;
;;; Assigning the result of this to ATT would let us retrieve the attribute value with: ;;;
;;; (vla-get-textstring ATT) ;;;
;;; and set the attribute value with: ;;;
;;; (vla-put-textstring ATT "New") ;;;
;;; Note that if there were multiple insertions of this same block then we would get the ;;;
;;; "L1BY" attribute from second insertion with: ;;;
;;; (cdr (assoc "L1BY" (cdr(nth 1 (cdr (assoc "BRD_TTL" ATTS)))))) ;;;
;;; Notice the 1 here ^ ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;