I have many blocks which have attributes. I'm trying to search through attributes in WEE specific value and when I find it, I would like to change the NDT to some value.
Name Att | Value Att |
---|---|
WEE | A011 |
NDT | (Null) |
for Atributi in acad.ActiveDocument.ModelSpace:
name = Atributi.EntityName
if name == 'AcDbBlockReference':
isciAtribute = Atributi.HasAttributes
if isciAtribute and Atributi.Name == blokZvar:
# print(Atributi.Name)
for att in Atributi.GetAttributes():
if att.TagString == 'WEE' and att.TextString == 'A011':
storedID = att.ObjectID
for atb in Atributi.GetAttributes():
if atb.ObjectID == storedID:
atb.TagString == 'NDT'
atb.TextString = '*'
atb.Update()
# print(" {}: {}".format(atb.TagString, atb.TextString))
I'm trying a new way to get to the result via ObjectID of the finded block, but now I got error name 'storedID' is not defined
Please advise how to solve this issue.
I have tried to change value in WEE and have succeed there but I just can't change another attribute value inside the same block, based on the previous value.