pyautocad的attrib.Update函数不起作用

问题描述

我正在尝试更新块的属性,但值未更新。我过去已经更新了值,并且使用了相同的方法,但是attrib.Update()无法正常工作,我也不知道为什么。

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

refrence image where I need to update the value

图像上的红色标记可能是问题所在,因为我的上一个程序正在使用相同的attrib.Update()函数。请帮助我解决问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)