Table of Contents

Class CadHatchSettings

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

The settings HATCH makes a hatch with and HATCHEDIT changes, as the Hatch Creation tab holds them: what it is filled with, the pattern, its angle and scale or spacing, the origin, the island style, whether it follows its objects, and the one colour or two of a gradient; and the layer, colour, background colour and transparency a new hatch takes in place of the current ones, and the widest gap a boundary is taken as closed over. AutoCAD's own start: ANSI31 at angle nought and scale 1, associative, the Outer island style (HPISLANDDETECTION 1), a gradient GR_LINEAR from blue to a pale yellow, no gap tolerance, the current layer and colour.

public sealed class CadHatchSettings
Inheritance
CadHatchSettings
Inherited Members

Properties

Angle

Gets or sets the angle of the pattern or the gradient, in degrees.

Annotative

Gets or sets whether a new hatch is annotative, as -HATCH's ANnotative asks: made annotative at the annotation scale of its space, so that its pattern is drawn at the scale of the view; false as AutoCAD starts.

Associative

Gets or sets whether the hatch follows the objects its loops were made of (HPASSOC); true as AutoCAD starts.

BackgroundColor

Gets or sets the colour behind the lines of a new hatch's pattern; null for none, as HPBACKGROUNDCOLOR's "." says.

Color

Gets or sets the colour a new hatch is drawn in; null for the current colour, as HPCOLOR's "." says.

Double

Gets or sets whether the lines of a pattern made by the user are crossed by as many square to them.

GapTolerance

Gets or sets the widest gap between two loose ends that a boundary is taken as closed over (HPGAPTOL), in drawing units; 0 for none, as AutoCAD starts.

GradientCentered

Gets or sets whether a gradient is centred (its shift nought) rather than shifted a quarter towards its end.

GradientColor1

Gets or sets the first colour of a gradient: blue, as GFCLR1 starts.

GradientColor2

Gets or sets the second colour of a gradient: a pale yellow (255, 255, 153), as GFCLR2 starts.

GradientName

Gets or sets the gradient, by the name AutoCAD's dialog gives it: GR_LINEAR.

GradientNames

Gets the names of AutoCAD's nine gradients as its dialog gives them: GR_LINEAR, GR_CYLIN, GR_INVCYL, GR_SPHER, GR_INVSPH, GR_HEMISP, GR_INVHEM, GR_CURVED, GR_INVCUR.

GradientOneColor

Gets or sets whether a gradient runs from GradientColor1 to its shade or tint (GradientTint) rather than to GradientColor2, as AutoCAD's Single color (GFCLRSTATE 1); false as it starts.

GradientTint

Gets or sets how a gradient of one colour is shaded or tinted, from 0, black, through the colour's own hue at 0.5 to 1, white, as AutoCAD's GFCLRLUM; 1 as it starts. The second end of the gradient is the colour's hue and saturation at that lightness: red (255, 0, 0) at 0.25 ends in (128, 0, 0), at 0.75 in (255, 128, 128).

IslandStyle

Gets or sets which areas of islands within islands are filled: Outer as AutoCAD starts (HPISLANDDETECTION 1).

Layer

Gets or sets the layer a new hatch is on; null for the current layer, as HPLAYER's "." says. A layer the drawing has not (any more) leaves the hatch on the current one.

OriginMode

Gets or sets where the pattern is laid from: the origin given, or a corner or the middle of the box round the hatch (HPORIGINMODE).

OriginX

Gets or sets the x of the point the pattern is laid from.

OriginY

Gets or sets the y of the point the pattern is laid from.

PatternFile

Gets or sets the file the pattern is of: a full path of a .pat file, or BuiltInName; null to take it from the presenter's own set, and from a file of the user's support folders only where that set has no pattern of the name. No file of AutoCAD's is looked for.

PatternName

Gets or sets the name of the pattern, as ANSI31.

Scale

Gets or sets the scale of a pattern of a file: 2 draws its lines twice as far apart.

Spacing

Gets or sets the spacing of the lines of a pattern made by the user.

Transparency

Gets or sets how much a new hatch lets show through; null for the current setting, as HPTRANSPARENCY's "." says.

Type

Gets or sets what the hatch is filled with.

Methods

Clone()

Gets a copy.

Of(DxfHatch)

Reads the settings of a hatch, as HATCHEDIT shows them: its type, pattern, angle in degrees, scale, spacing, double, island style and association, whether it is annotative, and its gradient's name, colours, one colour or two, tint and shift. The origin, layer, colour, background colour and transparency are not read back (they stay as a new hatch leaves them, null): a hatch keeps its origin in its lines' base points, and HATCHEDIT lays them again from the origin it is given.

Preview(CadDocument)

Makes a drawing of a square hatched with these settings, for a dialog's preview drawn through the presenter's own display: 25 across times the scale of a pattern, ten spacings for lines of the user's, 25 for a fill; the pattern found as the source document finds it. A pattern that cannot be found or read leaves the square drawn by its edge.