Object Base Class

class DXFObject

Common base class for all non-graphical DXF objects.


(read only) The DXF attributes namespace, access DXF attributes by this attribute, like entity.dxf.layer = 'MyLayer'. Just the dxf attribute is read only, the DXF attributes are read- and writeable.


(read only) Get the associated drawing.


(read only) Get the associated DXF factory. (feature for experts)


Get the DXF type string, like GEODATA for the geo data entity.


Deep copy of DXFObject with new handle. This is not a deep copy in the meaning of Python, because handle, link and owner is changed.

DXFObject.get_dxf_attrib(key, default=DXFValueError)

Get DXF attribute key, returns default if key doesn’t exist, or raise DXFValueError if default is DXFValueError and no DXF default value is defined.

DXFObject.set_dxf_attrib(key, value)

Delete/remove DXF attribute key. Raises AttributeError if key isn’t supported.


Returns True if DXF attrib key really exists else False. Raises AttributeError if key isn’t supported


Returns True if DXF attrib key is supported by this entity else False. Does not grant that attrib key really exists.


Returns a list of supported DXF attribute names.


Create a dict() with all accessible DXF attributes and their value, not all data is accessible by dxf attributes like definition points of LWPolyline or Spline


Set DXF attributes by a dict() like {'layer': 'test', 'color': 4}.

DXFObject.set_flag_state(flag, state=True, name='flags')

Set binary coded flag of DXF attribute name to 1 (on) if state is True, set flag to 0 (off) if state is False.

DXFObject.get_flag_state(flag, name='flags')

Returns True if any flag of DXF attribute is 1 (on), else False. Always check just one flag state at the time.

Common DXF Object Attributes


DXF handle (feature for experts)


handle to owner, it’s a BLOCK_RECORD entry (feature for experts)