DXF Types¶
Required DXF tag interface:
property
code
: group code as intproperty
value
: tag value of unspecific type
dxfstr()
: returns the DXF string
clone()
: returns a deep copy of tag
DXFTag Factory Functions¶
-
ezdxf.lldxf.types.
dxftag
(code: int, value: TagValue) → ezdxf.lldxf.types.DXFTag¶ DXF tag factory function.
- Parameters
code – group code
value – tag value
Returns:
DXFTag
or inherited
Returns an iterable if :class: DXFTag or inherited, accepts an iterable of (code, value) tuples as input.
DXFTag¶
-
class
ezdxf.lldxf.types.
DXFTag
(code: int, value: TagValue)¶ Immutable DXFTag class - immutable by design, not by implementation.
- Parameters
code – group code as int
value – tag value, type depends on group code
- Variables
-
__eq__
(other) → bool¶ True
if other and self has same content forcode
andvalue
.
-
__getitem__
(index: int)¶ Returns
code
for index 0 andvalue
for index 1, emulates a tuple.
-
__iter__
() → Iterable¶ Returns (code, value) tuples.
-
__repr__
() → str¶ Returns representation string
'DXFTag(code, value)'
.
-
__str__
() → str¶ Returns content string
'(code, value)'
.
-
clone
() → ezdxf.lldxf.types.DXFTag¶ Returns a clone of itself, this method is necessary for the more complex (and not immutable) DXF tag types.
-
dxfstr
() → str¶ Returns the DXF string e.g.
' 0\nLINE\n'
DXFBinaryTag¶
DXFVertex¶
-
class
ezdxf.lldxf.types.
DXFVertex
(DXFTag)¶ Represents a 2D or 3D vertex, stores only the group code of the x-component of the vertex, because the y-group-code is x-group-code + 10 and z-group-code id x-group-code+20, this is a rule that ALWAYS applies. This tag is immutable by design, not by implementation.
- Parameters
code – group code of x-component
value – sequence of x, y and optional z values
-
dxfstr
() → str¶ Returns the DXF string for all vertex components.
Returns all vertex components as single
DXFTag
objects.