Found several examples but when I do it,
the Tag and the TextString stay the same during the loop.
The block has 5 attributes, all stirng values with different Tag names.
Count : 5
AR: PART# 2037248
AR: PART# 2037248
AR: PART# 2037248
AR: PART# 2037248
AR: PART# 2037248
Here's what the block attribute collection looks like (see attached image).
BlockReference TagBlkRef = (BlockReference)trans.GetObject(BlkRefIds[0], OpenMode.ForRead);
ObjectId TagId = TagBlkRef.AttributeCollection[0];
DBObject obj = trans.GetObject(TagId, OpenMode.ForRead);
AttributeReference ar = (AttributeReference)obj;
AttributeCollection abtr = TagBlkRef.AttributeCollection;
if (FileName == ar.TextString)
{
foreach (ObjectId arId in abtr)
{
DBObject Aobj = trans.GetObject(arId, OpenMode.ForRead);
ar = obj as AttributeReference;
if (ar != null)
{
editor.WriteMessage("\nAR: " + ar.Tag + " " + ar.TextString);
editor.WriteMessage("\n Hey, not changing.");