Class Leader
Represents a leader EntityObject.
Inherited Members
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public class Leader : EntityObject, IHasXData, ICloneable
Constructors
| Improve this Doc View SourceLeader(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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 SourceAnnotation
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.
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.
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.
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.
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 |
Normal
Gets or sets the entity Vector3.
Declaration
public Vector3 Normal { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
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 |
PathType
Gets or sets the way the leader is drawn.
Declaration
public LeaderPathType PathType { get; set; }
Property Value
| Type | Description |
|---|---|
| LeaderPathType |
ShowArrowhead
Gets or sets if the arrowhead is drawn.
Declaration
public bool ShowArrowhead { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Style
Gets or sets the leader style.
Declaration
public DimensionStyle Style { get; set; }
Property Value
| Type | Description |
|---|---|
| DimensionStyle |
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.
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 SourceClone()
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
| Improve this Doc View SourceOnAnnotationAddedEvent(EntityObject)
Declaration
protected virtual void OnAnnotationAddedEvent(EntityObject item)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityObject | item |
OnAnnotationRemovedEvent(EntityObject)
Declaration
protected virtual void OnAnnotationRemovedEvent(EntityObject item)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityObject | item |
OnDimensionStyleChangedEvent(DimensionStyle, DimensionStyle)
Declaration
protected virtual DimensionStyle OnDimensionStyleChangedEvent(DimensionStyle oldStyle, DimensionStyle newStyle)
Parameters
| Type | Name | Description |
|---|---|---|
| DimensionStyle | oldStyle | |
| DimensionStyle | newStyle |
Returns
| Type | Description |
|---|---|
| DimensionStyle |
OnDimensionStyleOverrideAddedEvent(DimensionStyleOverride)
Declaration
protected virtual void OnDimensionStyleOverrideAddedEvent(DimensionStyleOverride item)
Parameters
| Type | Name | Description |
|---|---|---|
| DimensionStyleOverride | item |
OnDimensionStyleOverrideRemovedEvent(DimensionStyleOverride)
Declaration
protected virtual void OnDimensionStyleOverrideRemovedEvent(DimensionStyleOverride item)
Parameters
| Type | Name | Description |
|---|---|---|
| DimensionStyleOverride | item |
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
Remarks
Matrix3 adopts the convention of using column vectors to represent a transformation matrix.
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 SourceAnnotationAdded
Declaration
public event Leader.AnnotationAddedEventHandler AnnotationAdded
Event Type
| Type | Description |
|---|---|
| Leader.AnnotationAddedEventHandler |
AnnotationRemoved
Declaration
public event Leader.AnnotationRemovedEventHandler AnnotationRemoved
Event Type
| Type | Description |
|---|---|
| Leader.AnnotationRemovedEventHandler |
DimensionStyleOverrideAdded
Declaration
public event Leader.DimensionStyleOverrideAddedEventHandler DimensionStyleOverrideAdded
Event Type
| Type | Description |
|---|---|
| Leader.DimensionStyleOverrideAddedEventHandler |
DimensionStyleOverrideRemoved
Declaration
public event Leader.DimensionStyleOverrideRemovedEventHandler DimensionStyleOverrideRemoved
Event Type
| Type | Description |
|---|---|
| Leader.DimensionStyleOverrideRemovedEventHandler |
LeaderStyleChanged
Declaration
public event Leader.LeaderStyleChangedEventHandler LeaderStyleChanged
Event Type
| Type | Description |
|---|---|
| Leader.LeaderStyleChangedEventHandler |