Attrib

class Attrib

The Attrib entity represents a text value associated with a tag. In most cases an Attrib is appended to an Insert entity, but it can also appear as standalone entity.

DXF Attributes for Attrib

Common DXF Attributes for DXF R12

Common DXF Attributes for DXF R13 or later

Attrib.dxf.text

Attribute content as text (str)

Attrib.dxf.insert

First alignment point of text (2D/3D Point in OCS), relevant for the adjustments LEFT, ALIGN and FIT.

Attrib.dxf.tag

Tag to identify the attribute (str)

Attrib.dxf.align_point

Second alignment point of text (2D/3D Point in OCS), if the justification is anything other than LEFT, the second alignment point specify also the first alignment point: (or just the second alignment point for ALIGN and FIT)

Attrib.dxf.height

Text height in drawing units (float), default is 1

Attrib.dxf.rotation

Text rotation in degrees (float), default is 0

Attrib.dxf.oblique

Text oblique angle (float), default is 0

Attrib.dxf.style

Text style name (str), default is STANDARD

Attrib.dxf.width

Width scale factor (float), default is 1

Attrib.dxf.halign

Horizontal alignment flag (int), use Attrib.set_pos() and Attrib.set_align()

Attrib.dxf.valign

Vertical alignment flag (int), use Attrib.set_pos() and Attrib.set_align()

Attrib.dxf.text_generation_flag

Text generation flags (int)

  • 2 = text is backward (mirrored in X)
  • 4 = text is upside down (mirrored in Y)

Attrib Attributes

Attrib.is_invisibe

(read/write) Attribute is invisible (does not appear).

Attrib.is_const

(read/write) This is a constant attribute.

Attrib.is_verify

(read/write) Verification is required on input of this attribute. (CAD application feature)

Attrib.is_preset

(read/write) No prompt during insertion. (CAD application feature)

Attrib Methods

Attrib.get_pos()

see method Text.get_pos().

Attrib.set_pos(p1, p2=None, align=None)

see method Text.set_pos().

Attrib.get_align()

see method Text.get_align().

Attrib.set_align(align='LEFT')

see method Text.set_align().