Class HatchPattern
Represents a Hatch pattern style.
Implements
Inherited Members
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public class HatchPattern : ICloneable
Constructors
| Improve this Doc View SourceHatchPattern(String)
Initializes a new instance of the HatchPattern class.
Declaration
public HatchPattern(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Pattern name, always stored as uppercase. |
HatchPattern(String, IEnumerable<HatchPatternLineDefinition>)
Initializes a new instance of the HatchPattern class.
Declaration
public HatchPattern(string name, IEnumerable<HatchPatternLineDefinition> lineDefinitions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Pattern name, always stored as uppercase. |
| System.Collections.Generic.IEnumerable<HatchPatternLineDefinition> | lineDefinitions | The definition of the lines that make up the pattern (not applicable in Solid fills). |
HatchPattern(String, IEnumerable<HatchPatternLineDefinition>, String)
Initializes a new instance of the HatchPattern class.
Declaration
public HatchPattern(string name, IEnumerable<HatchPatternLineDefinition> lineDefinitions, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Pattern name, always stored as uppercase. |
| System.Collections.Generic.IEnumerable<HatchPatternLineDefinition> | lineDefinitions | The definition of the lines that make up the pattern (not applicable in Solid fills). |
| System.String | description | Description of the pattern (optional, this information is not saved in the DXF file). By default it will use the supplied name. |
HatchPattern(String, String)
Initializes a new instance of the HatchPattern class.
Declaration
public HatchPattern(string name, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Pattern name, always stored as uppercase. |
| System.String | description | Description of the pattern (optional, this information is not saved in the DXF file). By default it will use the supplied name. |
Properties
| Improve this Doc View SourceAngle
Gets or sets the pattern angle in degrees.
Declaration
public double Angle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Description
Gets or sets the hatch description (optional, this information is not saved in the DXF file).
Declaration
public string Description { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Dots
Dots hatch pattern.
Declaration
public static HatchPattern Dots { get; }
Property Value
| Type | Description |
|---|---|
| HatchPattern |
Remarks
The predefined pattern values are based on the acad.pat file of AutoCAD.
Fill
Gets the solid fill flag.
Declaration
public HatchFillType Fill { get; }
Property Value
| Type | Description |
|---|---|
| HatchFillType |
Line
Lines hatch pattern.
Declaration
public static HatchPattern Line { get; }
Property Value
| Type | Description |
|---|---|
| HatchPattern |
Remarks
The predefined pattern values are based on the acad.pat file of AutoCAD.
LineDefinitions
Gets the definition of the lines that make up the pattern (not applicable in Solid fills).
Declaration
public List<HatchPatternLineDefinition> LineDefinitions { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<HatchPatternLineDefinition> |
Name
Gets or sets the hatch pattern name.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Net
Net or squares hatch pattern.
Declaration
public static HatchPattern Net { get; }
Property Value
| Type | Description |
|---|---|
| HatchPattern |
Remarks
The predefined pattern values are based on the acad.pat file of AutoCAD.
Origin
Gets or sets the pattern origin.
Declaration
public Vector2 Origin { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Scale
Gets or sets the pattern scale (not applicable in Solid fills).
Declaration
public double Scale { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Solid
Solid hatch pattern.
Declaration
public static HatchPattern Solid { get; }
Property Value
| Type | Description |
|---|---|
| HatchPattern |
Remarks
The predefined pattern values are based on the acad.pat file of AutoCAD.
Style
Gets the hatch style.
Declaration
public HatchStyle Style { get; }
Property Value
| Type | Description |
|---|---|
| HatchStyle |
Remarks
Only normal style is implemented.
Type
Gets or sets the hatch pattern type.
Declaration
public HatchType Type { get; set; }
Property Value
| Type | Description |
|---|---|
| HatchType |
Methods
| Improve this Doc View SourceClone()
Declaration
public virtual object Clone()
Returns
| Type | Description |
|---|---|
| System.Object |
Load(String, String)
Creates a new hatch pattern from the definition in a PAT file.
Declaration
public static HatchPattern Load(string file, string patternName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | PAT file where the definition is located. |
| System.String | patternName | Name of the pattern definition that wants to be read (ignore case). |
Returns
| Type | Description |
|---|---|
| HatchPattern | A Hatch pattern as defined in the PAT file. |
NamesFromFile(String)
Gets the list of hatch pattern names defined in a PAT file.
Declaration
public static List<string> NamesFromFile(string file)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | Hatch pattern definitions file. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | List of hatch pattern names contained in the specified PAT file. |
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. |