Hi,
LISP is fine. You can do it in VBA too. Here is anippet to change an attribute:
;------------------------------------------------------------------------------
; ATT_UPD: Update the attributes of a block given by the eref according to the
; information in the <att_list>.
;
; - syntax: (att_upd <eref> <att_list>) -> T/nil
- returns nil if an error is detected, T otherwise
; - <att_list> is a list with format: ( (<att tag>.<att data>) (etc.)...)
;
; Note: no error occurs if the block's attributes don't match those in the
; <att_list>. Data is transferred between all matching attribute
; tag names - if there's a mismatch the program doesn't mind at all,
; but no data transfer will occur for that particular item.
;
; - no library dependencies
;
(defun att_upd (block_ref att_lst / ent_data)
; if the block_ref parameter is not an eref to a block insertion, the
; program will crash
(cond
( (= nil (entnext block_ref)) nil) ;no entities following
( (/= 1 (cdr (assoc 66 (setq ent_data (entget block_ref))))) nil) ; no attributes
( T
(while ; cycle through all attributes...
(= "ATTRIB" (cdr (assoc 0 (setq ent_data (entget (entnext (cdr (assoc -1 ent_data))))))))
(setq att_tag (cdr (assoc 2 ent_data)))
(cond
( (setq new_att (assoc att_tag att_lst)) ;mismatch filtering...
(entmod
(subst (cons 1 (cdr new_att) (assoc 1 ent_data) ent_data)
)
)
)
)
(entupd block_ref) ; regen the block
T
)
)
)