Class Linetype
Represents a line type. Simple and complex line types are supported.
Implements
Inherited Members
Namespace: netDxf.Tables
Assembly: CADability.dll
Syntax
public class Linetype : TableObject, IHasXData, ICloneable, IComparable, IComparable<TableObject>, IEquatable<TableObject>
Constructors
| Improve this Doc View SourceLinetype(String)
Initializes a new instance of the Linetype class.
Declaration
public Linetype(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Line type name. |
Linetype(String, IEnumerable<LinetypeSegment>)
Initializes a new instance of the Linetype class.
Declaration
public Linetype(string name, IEnumerable<LinetypeSegment> segments)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Line type name. |
| System.Collections.Generic.IEnumerable<LinetypeSegment> | segments |
Linetype(String, IEnumerable<LinetypeSegment>, String)
Initializes a new instance of the Linetype class.
Declaration
public Linetype(string name, IEnumerable<LinetypeSegment> segments, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Line type name. |
| System.Collections.Generic.IEnumerable<LinetypeSegment> | segments | |
| System.String | description | Line type description. |
Linetype(String, String)
Initializes a new instance of the Linetype class.
Declaration
public Linetype(string name, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Line type name. |
| System.String | description | Line type description. |
Fields
| Improve this Doc View SourceByBlockName
ByBlock line type name.
Declaration
public const string ByBlockName = "ByBlock"
Field Value
| Type | Description |
|---|---|
| System.String |
ByLayerName
ByLayer line type name.
Declaration
public const string ByLayerName = "ByLayer"
Field Value
| Type | Description |
|---|---|
| System.String |
DefaultName
Default line type name.
Declaration
public const string DefaultName = "Continuous"
Field Value
| Type | Description |
|---|---|
| System.String |
Properties
| Improve this Doc View SourceByBlock
Gets the ByBlock line type.
Declaration
public static Linetype ByBlock { get; }
Property Value
| Type | Description |
|---|---|
| Linetype |
ByLayer
Gets the ByLayer line type.
Declaration
public static Linetype ByLayer { get; }
Property Value
| Type | Description |
|---|---|
| Linetype |
Center
Gets a predefined center line.
Declaration
public static Linetype Center { get; }
Property Value
| Type | Description |
|---|---|
| Linetype |
Continuous
Gets the predefined continuous line.
Declaration
public static Linetype Continuous { get; }
Property Value
| Type | Description |
|---|---|
| Linetype |
DashDot
Gets a predefined dash dot line.
Declaration
public static Linetype DashDot { get; }
Property Value
| Type | Description |
|---|---|
| Linetype |
Dashed
Gets a predefined dashed line
Declaration
public static Linetype Dashed { get; }
Property Value
| Type | Description |
|---|---|
| Linetype |
Description
Gets or sets the line type description.
Declaration
public string Description { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
New line characters are not allowed.
Dot
Gets a predefined dot line
Declaration
public static Linetype Dot { get; }
Property Value
| Type | Description |
|---|---|
| Linetype |
IsByBlock
Defines if the line type is defined by block.
Declaration
public bool IsByBlock { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsByLayer
Defines if the line type is defined by layer.
Declaration
public bool IsByLayer { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Owner
Gets the owner of the actual DXF object.
Declaration
public Linetypes Owner { get; }
Property Value
| Type | Description |
|---|---|
| Linetypes |
Segments
Gets the list of line type segments.
Declaration
public ObservableCollection<LinetypeSegment> Segments { get; }
Property Value
| Type | Description |
|---|---|
| ObservableCollection<LinetypeSegment> |
Methods
| Improve this Doc View SourceClone()
Creates a new Linetype that is a copy of the current instance.
Declaration
public override object Clone()
Returns
| Type | Description |
|---|---|
| System.Object | A new Linetype that is a copy of this instance. |
Overrides
| Improve this Doc View SourceClone(String)
Creates a new Linetype that is a copy of the current instance.
Declaration
public override TableObject Clone(string newName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | newName | Linetype name of the copy. |
Returns
| Type | Description |
|---|---|
| TableObject | A new Linetype that is a copy of this instance. |
Overrides
| Improve this Doc View SourceLength()
Gets the total length of the line type.
Declaration
public double Length()
Returns
| Type | Description |
|---|---|
| System.Double |
Load(String, String)
Creates a new line type from the definition in a LIN file.
Declaration
public static Linetype Load(string file, string linetypeName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | Lin file where the definition is located. |
| System.String | linetypeName | Name of the line type definition to read (ignore case). |
Returns
| Type | Description |
|---|---|
| Linetype | The linetype defined in the LIN file with the specified name, null if the linetype has not been found in the linetype definitions file. |
NamesFromFile(String)
Gets the list of linetype names defined in a LIN file.
Declaration
public static List<string> NamesFromFile(string file)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | Linetype definitions file. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | List of linetype names contained in the specified LIN file. |
OnLinetypeSegmentAddedEvent(LinetypeSegment)
Declaration
protected virtual void OnLinetypeSegmentAddedEvent(LinetypeSegment item)
Parameters
| Type | Name | Description |
|---|---|---|
| LinetypeSegment | item |
OnLinetypeSegmentRemovedEvent(LinetypeSegment)
Declaration
protected virtual void OnLinetypeSegmentRemovedEvent(LinetypeSegment item)
Parameters
| Type | Name | Description |
|---|---|---|
| LinetypeSegment | item |
OnLinetypeTextSegmentStyleChangedEvent(TextStyle, TextStyle)
Declaration
protected virtual TextStyle OnLinetypeTextSegmentStyleChangedEvent(TextStyle oldTextStyle, TextStyle newTextStyle)
Parameters
| Type | Name | Description |
|---|---|---|
| TextStyle | oldTextStyle | |
| TextStyle | newTextStyle |
Returns
| Type | Description |
|---|---|
| TextStyle |
Save(String)
Saves the current linetype to the specified file, if the file does not exist it creates a new one.
Declaration
public void Save(string file)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | File where the current linetype will be saved. |
Events
| Improve this Doc View SourceLinetypeSegmentAdded
Declaration
public event Linetype.LinetypeSegmentAddedEventHandler LinetypeSegmentAdded
Event Type
| Type | Description |
|---|---|
| Linetype.LinetypeSegmentAddedEventHandler |
LinetypeSegmentRemoved
Declaration
public event Linetype.LinetypeSegmentRemovedEventHandler LinetypeSegmentRemoved
Event Type
| Type | Description |
|---|---|
| Linetype.LinetypeSegmentRemovedEventHandler |
LinetypeTextSegmentStyleChanged
Declaration
public event Linetype.LinetypeTextSegmentStyleChangedEventHandler LinetypeTextSegmentStyleChanged
Event Type
| Type | Description |
|---|---|
| Linetype.LinetypeTextSegmentStyleChangedEventHandler |