The LEADER entity (DXF Reference) represents a pointer line, 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.

The LEADER entity uses parts of the styling infrastructure of the DIMENSION entity.

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

Subclass of ezdxf.entities.DXFGraphic
Factory function ezdxf.layouts.BaseLayout.add_leader()
Inherited DXF attributes Common graphical DXF attributes
Required DXF version DXF R2000 ('AC1015')
class ezdxf.entities.Leader

Name of Dimstyle as string.

0 Disabled
1 Enabled

Leader path type:

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

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)
0 No hookline
1 Has a hookline

Text annotation height in drawing units.


Text annotation width.


Color to use if leader’s DIMCLRD = BYBLOCK


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


Extrusion vector? default is (0, 0, 1).


Horizontal direction for leader, default is (1, 0, 0).


Offset of last leader vertex from block reference insertion point, default is (0, 0, 0).


Offset of last leader vertex from annotation placement point, default (0, 0, 0).


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

set_vertices(vertices: Iterable[Union[Sequence[float], ezdxf.math._vector.Vec2, ezdxf.math._vector.Vec3]])

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

transform(m: Matrix44) → Leader

Transform LEADER entity by transformation matrix m inplace.

virtual_entities() → Iterator[ezdxf.entities.dxfgfx.DXFGraphic]

Yields the DXF primitives the LEADER entity is build up as virtual entities.

These entities are located at the original location, but are not stored in the entity database, have no handle and are not assigned to any layout.

explode(target_layout: Optional[BaseLayout] = None) → EntityQuery

Explode parts of the LEADER entity as DXF primitives into target layout, if target layout is None, the target layout is the layout of the LEADER entity. This method destroys the source entity.

Returns an EntityQuery container referencing all DXF primitives.

Parameters:target_layout – target layout for the created DXF primitives, None for the same layout as the source entity.