Show / Hide Table of Contents

Class Hatch

Represents a hatch EntityObject.

Inheritance
System.Object
DxfObject
EntityObject
Hatch
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.Normal
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 Hatch : EntityObject, IHasXData, ICloneable

Constructors

| Improve this Doc View Source

Hatch(HatchPattern, Boolean)

Initializes a new instance of the Hatch class.

Declaration
public Hatch(HatchPattern pattern, bool associative)
Parameters
Type Name Description
HatchPattern pattern

HatchPattern.

System.Boolean associative

Defines if the hatch is associative or not.

Remarks

This constructor is initialized with an empty list of boundary paths, remember a hatch without boundaries will be discarded when saving the file.
When creating an associative hatch do not add the entities that make the boundary to the document, it will be done automatically. Doing so will throw an exception.
The hatch boundary paths must be on the same plane as the hatch. The normal and the elevation of the boundary paths will be omitted (the hatch elevation and normal will be used instead). Only the x and y coordinates for the center of the line, ellipse, circle and arc will be used.

| Improve this Doc View Source

Hatch(HatchPattern, IEnumerable<HatchBoundaryPath>, Boolean)

Initializes a new instance of the Hatch class.

Declaration
public Hatch(HatchPattern pattern, IEnumerable<HatchBoundaryPath> paths, bool associative)
Parameters
Type Name Description
HatchPattern pattern

HatchPattern.

System.Collections.Generic.IEnumerable<HatchBoundaryPath> paths

A list of HatchBoundaryPath.

System.Boolean associative

Defines if the hatch is associative or not.

Remarks

The hatch boundary paths must be on the same plane as the hatch. The normal and the elevation of the boundary paths will be omitted (the hatch elevation and normal will be used instead). Only the x and y coordinates for the center of the line, ellipse, circle and arc will be used.

Properties

| Improve this Doc View Source

Associative

Gets if the hatch is associative or not, which means if the hatch object is associated with the hatch boundary entities.

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

BoundaryPaths

Gets the hatch boundary paths.

Declaration
public ObservableCollection<HatchBoundaryPath> BoundaryPaths { get; }
Property Value
Type Description
ObservableCollection<HatchBoundaryPath>
Remarks

The hatch must contain at least on valid boundary path to be able to add it to the DxfDocument, otherwise it will be rejected.

| Improve this Doc View Source

Elevation

Gets or sets the hatch elevation, its position along its normal.

Declaration
public double Elevation { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Pattern

Gets the hatch pattern.

Declaration
public HatchPattern Pattern { get; set; }
Property Value
Type Description
HatchPattern

Methods

| Improve this Doc View Source

Clone()

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

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

A new Hatch that is a copy of this instance.

Overrides
EntityObject.Clone()
Remarks

If the hatch is associative the referenced boundary entities will not be automatically cloned, its associative property will be set to false. Use CreateBoundary if required after cloning.

| Improve this Doc View Source

CreateBoundary(Boolean)

Creates a list of entities that represents the boundary of the hatch and optionally associates to it.

Declaration
public List<EntityObject> CreateBoundary(bool linkBoundary)
Parameters
Type Name Description
System.Boolean linkBoundary

Indicates if the new boundary will be associated with the hatch, turning the associative property to true.

Returns
Type Description
System.Collections.Generic.List<EntityObject>

A list of entities that makes the boundary of the hatch.

Remarks

If the actual hatch is already associative, the old boundary entities will be unlinked, but not deleted from the hatch document. If linkBoundary is true, the new boundary entities will be added to the same layout and document as the hatch, in case it belongs to one, so, in this case, if you also try to add the return list to the document it will cause an error.
All entities are in world coordinates except the LwPolyline boundary path since by definition its vertexes are expressed in object coordinates.

| Improve this Doc View Source

OnHatchBoundaryPathAddedEvent(HatchBoundaryPath)

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

OnHatchBoundaryPathRemovedEvent(HatchBoundaryPath)

Declaration
protected virtual void OnHatchBoundaryPathRemovedEvent(HatchBoundaryPath item)
Parameters
Type Name Description
HatchBoundaryPath 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

UnLinkBoundary()

Unlinks the boundary from the hatch, turning the associative property to false.

Declaration
public List<EntityObject> UnLinkBoundary()
Returns
Type Description
System.Collections.Generic.List<EntityObject>

The list of unlinked entities from the boundary of the hatch.

Remarks

The entities that make the hatch boundaries will not be deleted from the document if they already belong to one.

Events

| Improve this Doc View Source

HatchBoundaryPathAdded

Declaration
public event Hatch.HatchBoundaryPathAddedEventHandler HatchBoundaryPathAdded
Event Type
Type Description
Hatch.HatchBoundaryPathAddedEventHandler
| Improve this Doc View Source

HatchBoundaryPathRemoved

Declaration
public event Hatch.HatchBoundaryPathRemovedEventHandler HatchBoundaryPathRemoved
Event Type
Type Description
Hatch.HatchBoundaryPathRemovedEventHandler

Implements

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