Leader

class Leader(GraphicEntity)

Introduced in AutoCAD R13 (DXF version AC1012), dxftype is LEADER.

The Leader entity represents an arrow, made up of one or more vertices (or spline fit points) and an arrowhead. The label or other content to which the Leader is attached is stored as a separate entity, and is not part of the Leader itself.

Leader shares its styling infrastructure with Dimension.

By default a Leader without any annotation is created. For creating more fancy leaders and annotations see documentation provided by Autodesk or Demystifying DXF: LEADER and MULTILEADER implementation notes .

Create leader in layouts and blocks by factory function add_leader().

Ellipse.dxf.extrusion is supported, but does not establish an OCS, it is used to create an 3D entity by extruding the base ellipse.

DXF Attributes for Ellipse

Common DXF Attributes for DXF R13 or later

Leader.dxf.dimstyle

Name of Dimstyle as string.

Leader.dxf.has_arrowhead
0 Disabled
1 Enabled
Leader.dxf.path_type

Leader path type:

0 Straight line segments
1 Spline
Leader.dxf.annotation_type
0 Created with text annotation
1 Created with tolerance annotation
2 Created with block reference annotation
3 Created without any annotation (default)
Leader.dxf.hookline_direction

Hook line direction flag:

0 Hookline (or end of tangent for a splined leader) is the opposite direction from the horizontal vector
1 Hookline (or end of tangent for a splined leader) is the same direction as horizontal vector (see has_hook_line)
Leader.dxf.has_hookline
0 No hookline
1 Has a hookline
Leader.dxf.text_height

Text annotation height.

Leader.dxf.text_width

Text annotation width.

Leader.dxf.block_color

Color to use if leader’s DIMCLRD = BYBLOCK

Leader.dxf.annotation_handle

Hard reference (handle) to associated annotation (MText, Tolerance, or Insert entity)

Leader.dxf.normal_vector

Default: (0, 0, 1)

Leader.dxf.horizontal_direction

“Horizontal” direction for leader, Default: (1, 0, 0)

Leader.dxf.leader_offset_block_ref

Offset of last leader vertex from block reference insertion point, Default: (0, 0, 0)

Leader.dxf.leader_offset_annotation_placement

Offset of last leader vertex from annotation placement point, Default: (0, 0, 0)

Leader Attributes

Leader.vertices

List of Vector objects, representing the vertices of the leader (3D Point in WCS).

Leader Methods

Leader.set_vertices(vertices)

Set vertices of the leader, vertices is an iterable of (x, y [,z]) tuples or Vector.