使用ezdxf描述图层属性描述时出错。有会导致错误的图层名称和不会导致错误的图层名称。我不知道原因。
我尝试使用下面的代码。
lay = dwg.layers.get('MyLayerHere')
app = 'AcAecLayerStandard'
dsc = 'MyDescriptionHere'
if lay.tags.has_xdata(app):
lay.tags.set_xdata(app, [(1000, ''), (1000, dsc)])
else:
dwg.appids.new(app)
lay.tags.new_xdata(app, [(1000, ''), (1000, dsc)])
错误内容
Traceback (most recent call last): File "file.py", line 777, in dwg.appids.new(app) File "C:\・・・\table.py", line 63, in new raise DXFTableEntryError('%s %s already exists!' % (self._dxfname, name)) ezdxf.lldxf.const.DXFTableEntryError: APPID AcAecLayerStandard already exists!