Click or drag to resize

DXFReaderNETControlAddHatch Method (String, ListEntityObject, ListEntityObject, Double, Double, Int16, String, String)

Adds a new hatch to the current drawing giving the pattern name.

Namespace:  DXFReaderNET
Assembly:  DXFReaderNET (in DXFReaderNET.dll) Version: 20.10.54
Syntax
public EntityObject AddHatch(
	string PatternName,
	List<EntityObject> Boundary,
	List<EntityObject> HollowBoundary = null,
	double Rotation = 0,
	double Scale = 1,
	short ACIColor = 256,
	string LayerName = "",
	string LineTypeName = ""
)

Parameters

PatternName
Type: SystemString
The pattern name.
Boundary
Type: System.Collections.GenericListEntityObject
A list of entities defining the boundary.
HollowBoundary (Optional)
Type: System.Collections.GenericListEntityObject
A list of entities defining the boundary that encloses or defines empty or open spaces within an area.
Rotation (Optional)
Type: SystemDouble
The hatch rotation in drawing's units (Default value = 0).
Scale (Optional)
Type: SystemDouble
The hatch scale in drawing's units (Default value = 1).
ACIColor (Optional)
Type: SystemInt16
A number for 0 to 256 corresponding to the AutoCAD Color Index (0 = ByBlock; 256 = ByLayer. Default value = 256).
LayerName (Optional)
Type: SystemString
The layer name. If omitted, or layername doesn't exist, the CurrentLayer will be used.
LineTypeName (Optional)
Type: SystemString
The layer name. If omitted, or layername doesn't exist, , or layername doesn't exist, the CurrentLineTypeName will be used.

Return Value

Type: EntityObject
The new added Hatch.
Examples
Adds a solid hatch to a closed object. Assuming that in the following drawing:

the ellipse is the entity #0, the circle is the entity #1 and the rectangle is the entity #2 use the following code:
[C#]

List<EntityObject> Boundary = new List<EntityObject>();
List<EntityObject> BoundaryOutermost = new List<EntityObject>();

Boundary.Add(dxfReaderNETControl1.DXF.Entities[0]);
BoundaryOutermost.Add(dxfReaderNETControl1.DXF.Entities[1]);
BoundaryOutermost.Add(dxfReaderNETControl1.DXF.Entities[2]);

dxfReaderNETControl1.AddHatch("SOLID", Boundary, BoundaryOutermost);
The result is:
See Also