Show / Hide Table of Contents

Class Leader

Represents a leader EntityObject.

Inheritance
System.Object
DxfObject
EntityObject
Leader
Implements
IHasXData
System.ICloneable
Inherited Members
EntityObject.LayerChanged
EntityObject.OnLayerChangedEvent(Layer, Layer)
EntityObject.LinetypeChanged
EntityObject.OnLinetypeChangedEvent(Linetype, Linetype)
EntityObject.XDataAddAppReg
EntityObject.OnXDataAddAppRegEvent(ApplicationRegistry)
EntityObject.XDataRemoveAppReg
EntityObject.OnXDataRemoveAppRegEvent(ApplicationRegistry)
EntityObject.Reactors
EntityObject.Type
EntityObject.Color
EntityObject.Layer
EntityObject.Linetype
EntityObject.Lineweight
EntityObject.Transparency
EntityObject.LinetypeScale
EntityObject.IsVisible
EntityObject.Owner
EntityObject.XData
EntityObject.TransformBy(Matrix4)
EntityObject.ToString()
DxfObject.CodeName
DxfObject.Handle
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public class Leader : EntityObject, IHasXData, ICloneable

Constructors

| Improve this Doc View Source

Leader(Block, IEnumerable<Vector2>)

Initializes a new instance of the Leader class.

Declaration
public Leader(Block block, IEnumerable<Vector2> vertexes)
Parameters
Type Name Description
Block block
System.Collections.Generic.IEnumerable<Vector2> vertexes
| Improve this Doc View Source

Leader(Block, IEnumerable<Vector2>, DimensionStyle)

Initializes a new instance of the Leader class.

Declaration
public Leader(Block block, IEnumerable<Vector2> vertexes, DimensionStyle style)
Parameters
Type Name Description
Block block
System.Collections.Generic.IEnumerable<Vector2> vertexes
DimensionStyle style
| Improve this Doc View Source

Leader(ToleranceEntry, IEnumerable<Vector2>)

Initializes a new instance of the Leader class.

Declaration
public Leader(ToleranceEntry tolerance, IEnumerable<Vector2> vertexes)
Parameters
Type Name Description
ToleranceEntry tolerance
System.Collections.Generic.IEnumerable<Vector2> vertexes
| Improve this Doc View Source

Leader(ToleranceEntry, IEnumerable<Vector2>, DimensionStyle)

Initializes a new instance of the Leader class.

Declaration
public Leader(ToleranceEntry tolerance, IEnumerable<Vector2> vertexes, DimensionStyle style)
Parameters
Type Name Description
ToleranceEntry tolerance
System.Collections.Generic.IEnumerable<Vector2> vertexes
DimensionStyle style
| Improve this Doc View Source

Leader(IEnumerable<Vector2>)

Initializes a new instance of the Leader class.

Declaration
public Leader(IEnumerable<Vector2> vertexes)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Vector2> vertexes
| Improve this Doc View Source

Leader(IEnumerable<Vector2>, DimensionStyle)

Initializes a new instance of the Leader class.

Declaration
public Leader(IEnumerable<Vector2> vertexes, DimensionStyle style)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Vector2> vertexes
DimensionStyle style
| Improve this Doc View Source

Leader(String, IEnumerable<Vector2>)

Initializes a new instance of the Leader class.

Declaration
public Leader(string text, IEnumerable<Vector2> vertexes)
Parameters
Type Name Description
System.String text
System.Collections.Generic.IEnumerable<Vector2> vertexes
| Improve this Doc View Source

Leader(String, IEnumerable<Vector2>, DimensionStyle)

Initializes a new instance of the Leader class.

Declaration
public Leader(string text, IEnumerable<Vector2> vertexes, DimensionStyle style)
Parameters
Type Name Description
System.String text
System.Collections.Generic.IEnumerable<Vector2> vertexes
DimensionStyle style

Properties

| Improve this Doc View Source

Annotation

Gets or sets the leader annotation entity.

Declaration
public EntityObject Annotation { get; set; }
Property Value
Type Description
EntityObject
Remarks

Only MText, Text, Tolerance, and Insert entities are supported as a leader annotation. Even if AutoCad allows a Text entity to be part of a Leader it is not recommended, always use a MText entity instead.
Set the annotation property to null to create a Leader without annotation.

| Improve this Doc View Source

Elevation

Gets or sets the leader elevation.

Declaration
public double Elevation { get; set; }
Property Value
Type Description
System.Double
Remarks

This is the distance from the origin to the plane of the leader.

| Improve this Doc View Source

HasHookline

Gets if the leader has a hook line.

Declaration
public bool HasHookline { get; set; }
Property Value
Type Description
System.Boolean
Remarks

If set to true an additional vertex point (StartHookLine) will be created before the leader end point (hook). By default, only leaders with text annotation have hook lines.

| Improve this Doc View Source

Hook

Gets or sets the leader hook position (last leader vertex).

Declaration
public Vector2 Hook { get; set; }
Property Value
Type Description
Vector2
Remarks

This property allows easy access to the last leader vertex, aka leader hook position. Remember the leader vertexes list must have at least two points.

| Improve this Doc View Source

LineColor

Gets or sets the leader line color if the style parameter DIMCLRD is set as BYBLOCK.

Declaration
public AciColor LineColor { get; set; }
Property Value
Type Description
AciColor
| Improve this Doc View Source

Normal

Gets or sets the entity Vector3.

Declaration
public Vector3 Normal { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

Offset

Gets or sets the offset from the last leader vertex (hook) to the annotation position.

Declaration
public Vector2 Offset { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

PathType

Gets or sets the way the leader is drawn.

Declaration
public LeaderPathType PathType { get; set; }
Property Value
Type Description
LeaderPathType
| Improve this Doc View Source

ShowArrowhead

Gets or sets if the arrowhead is drawn.

Declaration
public bool ShowArrowhead { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Style

Gets or sets the leader style.

Declaration
public DimensionStyle Style { get; set; }
Property Value
Type Description
DimensionStyle
| Improve this Doc View Source

StyleOverrides

Gets the dimension style overrides list.

Declaration
public DimensionStyleOverrideDictionary StyleOverrides { get; }
Property Value
Type Description
DimensionStyleOverrideDictionary
Remarks

Any dimension style value stored in this list will override its corresponding value in the assigned style to the dimension.

| Improve this Doc View Source

Vertexes

Gets the leader vertexes list in local coordinates.

Declaration
public List<Vector2> Vertexes { get; }
Property Value
Type Description
System.Collections.Generic.List<Vector2>

Methods

| Improve this Doc View Source

Clone()

Creates a new Leader that is a copy of the current instance.

Declaration
public override object Clone()
Returns
Type Description
System.Object

A new Leader that is a copy of this instance.

Overrides
EntityObject.Clone()
| Improve this Doc View Source

OnAnnotationAddedEvent(EntityObject)

Declaration
protected virtual void OnAnnotationAddedEvent(EntityObject item)
Parameters
Type Name Description
EntityObject item
| Improve this Doc View Source

OnAnnotationRemovedEvent(EntityObject)

Declaration
protected virtual void OnAnnotationRemovedEvent(EntityObject item)
Parameters
Type Name Description
EntityObject item
| Improve this Doc View Source

OnDimensionStyleChangedEvent(DimensionStyle, DimensionStyle)

Declaration
protected virtual DimensionStyle OnDimensionStyleChangedEvent(DimensionStyle oldStyle, DimensionStyle newStyle)
Parameters
Type Name Description
DimensionStyle oldStyle
DimensionStyle newStyle
Returns
Type Description
DimensionStyle
| Improve this Doc View Source

OnDimensionStyleOverrideAddedEvent(DimensionStyleOverride)

Declaration
protected virtual void OnDimensionStyleOverrideAddedEvent(DimensionStyleOverride item)
Parameters
Type Name Description
DimensionStyleOverride item
| Improve this Doc View Source

OnDimensionStyleOverrideRemovedEvent(DimensionStyleOverride)

Declaration
protected virtual void OnDimensionStyleOverrideRemovedEvent(DimensionStyleOverride item)
Parameters
Type Name Description
DimensionStyleOverride item
| Improve this Doc View Source

TransformBy(Matrix3, Vector3)

Moves, scales, and/or rotates the current entity given a 3x3 transformation matrix and a translation vector.

Declaration
public override void TransformBy(Matrix3 transformation, Vector3 translation)
Parameters
Type Name Description
Matrix3 transformation

Transformation matrix.

Vector3 translation

Translation vector.

Overrides
EntityObject.TransformBy(Matrix3, Vector3)
Remarks

Matrix3 adopts the convention of using column vectors to represent a transformation matrix.

| Improve this Doc View Source

Update(Boolean)

Updates the leader entity to reflect the latest changes made to its properties.

Declaration
public void Update(bool resetAnnotationPosition)
Parameters
Type Name Description
System.Boolean resetAnnotationPosition

If true the annotation position will be modified according to the position of the leader hook (last leader vertex), otherwise the leader hook will be moved according to the actual annotation position.

Remarks

This method should be manually called if the annotation position is modified, or the leader properties like Style, Annotation, TextVerticalPosition, and/or Offset.

Events

| Improve this Doc View Source

AnnotationAdded

Declaration
public event Leader.AnnotationAddedEventHandler AnnotationAdded
Event Type
Type Description
Leader.AnnotationAddedEventHandler
| Improve this Doc View Source

AnnotationRemoved

Declaration
public event Leader.AnnotationRemovedEventHandler AnnotationRemoved
Event Type
Type Description
Leader.AnnotationRemovedEventHandler
| Improve this Doc View Source

DimensionStyleOverrideAdded

Declaration
public event Leader.DimensionStyleOverrideAddedEventHandler DimensionStyleOverrideAdded
Event Type
Type Description
Leader.DimensionStyleOverrideAddedEventHandler
| Improve this Doc View Source

DimensionStyleOverrideRemoved

Declaration
public event Leader.DimensionStyleOverrideRemovedEventHandler DimensionStyleOverrideRemoved
Event Type
Type Description
Leader.DimensionStyleOverrideRemovedEventHandler
| Improve this Doc View Source

LeaderStyleChanged

Declaration
public event Leader.LeaderStyleChangedEventHandler LeaderStyleChanged
Event Type
Type Description
Leader.LeaderStyleChangedEventHandler

Implements

IHasXData
System.ICloneable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX