Python pyautocad的attrib.Update()函数不起作用
我正在尝试更新块的属性,但没有更新值。我在过去更新过这些值,并且使用了相同的方法,但是attrib.Update()不起作用,我不知道为什么Python pyautocad的attrib.Update()函数不起作用,python,autocad,Python,Autocad,我正在尝试更新块的属性,但没有更新值。我在过去更新过这些值,并且使用了相同的方法,但是attrib.Update()不起作用,我不知道为什么 for entity in acad.ActiveDocument.ModelSpace: name = entity.EntityName if name == 'AcDbBlockReference' and entity.ObjectID == head_1_ID: HasAttributes = entity.Has
for entity in acad.ActiveDocument.ModelSpace:
name = entity.EntityName
if name == 'AcDbBlockReference' and entity.ObjectID == head_1_ID:
HasAttributes = entity.HasAttributes
if HasAttributes:
i=0
for attrib in entity.GetAttributes():
if i == 0:
attrib.TextString = " 441 - PT - 1332"
attrib.Update()
if i == 1:
attrib.TextString = " COMPRESSOR DISCHARGE PRESSURE"
attrib.Update()
i = i+1
图像上的红色标记可能是问题所在,因为我以前的程序使用的是相同的attrib.Update()函数。请帮我解决这个问题