I am using the ezdxf library to generate DXF files with polylines and different attributes which are given within a polyline as text. Using ezdxf, how can I create an AREA attribute which would be connected to a polyline? This means, if I open a created DXF file in AutoCAD and change the polyline geometry, then the AREA text would update its value automatically.
Here is how I do it in AutoCAD:
Here is an example of what kind of behavior I want to achieve in AutoCAD:
AREA attribute state when I open the DXF file:
Changing the geometry of the POLYLINE:
After I apply the REGEN command, the AREA attribute value gets updated:
It is theoretically possible, but you would need to write the definition of the Extension Dictionary attached to the attribute definition, the ACAD_FIELD
dictionary contained within the Extension Dictionary, the TEXT
dictionary contained within that, the FIELD
entity container, and finally, the FIELD
entity which references the object property itself.
You can inspect the DXF data for each of these dictionaries & entities using a utility such as my Entity List program, and drill-down through the entries starting with the Extension Dictionary.