AttDef

class Attdef

The Attdef entity is a place holder in the Block definition, which will be used to create an appended Attrib entity for an Insert entity.

DXF Attributes for AttDef

Common DXF Attributes for DXF R12

Common DXF Attributes for DXF R13 or later

AttDef.dxf.text

The default text prompted by CAD programs (str)

AttDef.dxf.insert

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

AttDef.dxf.tag

Tag to identify the attribute (str)

AttDef.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)

AttDef.dxf.height

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

AttDef.dxf.rotation

Text rotation in degrees (float), default is 0

AttDef.dxf.oblique

Text oblique angle (float), default is 0

AttDef.dxf.style

Text style name (str), default is STANDARD

AttDef.dxf.width

Width scale factor (float), default is 1

AttDef.dxf.halign

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

AttDef.dxf.valign

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

AttDef.dxf.text_generation_flag

Text generation flags (int)

  • 2 = text is backward (mirrored in X)
  • 4 = text is upside down (mirrored in Y)
AttDef.dxf.prompt

Text prompted by CAD programs at placing a block reference containing this Attdef

AttDef.dxf.field_length

Just relevant to CAD programs for validating user input

AttDef Attributes

Attdef.is_invisible

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

Attdef.is_const

(read/write) This is a constant attribute.

Attdef.is_verify

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

Attdef.is_preset

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

AttDef Methods

Attdef.get_pos()

see method Text.get_pos().

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

see method Text.set_pos().

Attdef.get_align()

see method Text.get_align().

Attdef.set_align(align='LEFT')

see method Text.set_align().