CadHatchSettings
from OpenCAD2D import CadHatchSettings
class CadHatchSettings(System.Object) ยท CadHatchSettings in the .NET reference
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.
Constructors
__init__
def __init__(self) -> None
Properties and fields
Angle
@property
def Angle(self) -> float
@Angle.setter
def Angle(self, value: float) -> None
Gets or sets the angle of the pattern or the gradient, in degrees.
Annotative
@property
def Annotative(self) -> bool
@Annotative.setter
def Annotative(self, value: bool) -> None
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
@property
def Associative(self) -> bool
@Associative.setter
def Associative(self, value: bool) -> None
Gets or sets whether the hatch follows the objects its loops were made of (HPASSOC); true as AutoCAD starts.
BackgroundColor
@property
def BackgroundColor(self) -> DxfColor | None
@BackgroundColor.setter
def BackgroundColor(self, value: DxfColor | None) -> None
Gets or sets the colour behind the lines of a new hatch's pattern; null for none, as HPBACKGROUNDCOLOR's "." says.
Color
@property
def Color(self) -> DxfColor | None
@Color.setter
def Color(self, value: DxfColor | None) -> None
Gets or sets the colour a new hatch is drawn in; null for the current colour, as HPCOLOR's "." says.
Double
@property
def Double(self) -> bool
@Double.setter
def Double(self, value: bool) -> None
Gets or sets whether the lines of a pattern made by the user are crossed by as many square to them.
GapTolerance
@property
def GapTolerance(self) -> float
@GapTolerance.setter
def GapTolerance(self, value: float) -> None
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
@property
def GradientCentered(self) -> bool
@GradientCentered.setter
def GradientCentered(self, value: bool) -> None
Gets or sets whether a gradient is centred (its shift nought) rather than shifted a quarter towards its end.
GradientColor1
@property
def GradientColor1(self) -> DxfColor
@GradientColor1.setter
def GradientColor1(self, value: DxfColor | None) -> None
Gets or sets the first colour of a gradient: blue, as GFCLR1 starts.
GradientColor2
@property
def GradientColor2(self) -> DxfColor
@GradientColor2.setter
def GradientColor2(self, value: DxfColor | None) -> None
Gets or sets the second colour of a gradient: a pale yellow (255, 255, 153), as GFCLR2 starts.
GradientName
@property
def GradientName(self) -> str
@GradientName.setter
def GradientName(self, value: str | None) -> None
Gets or sets the gradient, by the name AutoCAD's dialog gives it: GR_LINEAR.
GradientNames
GradientNames: ClassVar[System.Collections.Generic.IReadOnlyList[str]]
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
@property
def GradientOneColor(self) -> bool
@GradientOneColor.setter
def GradientOneColor(self, value: bool) -> None
Gets or sets whether a gradient runs from CadHatchSettings.GradientColor1 to its shade or tint (CadHatchSettings.GradientTint) rather than to CadHatchSettings.GradientColor2, as AutoCAD's Single color (GFCLRSTATE 1); false as it starts.
GradientTint
@property
def GradientTint(self) -> float
@GradientTint.setter
def GradientTint(self, value: float) -> None
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
@property
def IslandStyle(self) -> DxfHatchStyle
@IslandStyle.setter
def IslandStyle(self, value: DxfHatchStyle) -> None
Gets or sets which areas of islands within islands are filled: Outer as AutoCAD starts (HPISLANDDETECTION 1).
Layer
@property
def Layer(self) -> str | None
@Layer.setter
def Layer(self, value: str | None) -> None
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
@property
def OriginMode(self) -> CadHatchOriginMode
@OriginMode.setter
def OriginMode(self, value: CadHatchOriginMode) -> None
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
@property
def OriginX(self) -> float
@OriginX.setter
def OriginX(self, value: float) -> None
Gets or sets the x of the point the pattern is laid from.
OriginY
@property
def OriginY(self) -> float
@OriginY.setter
def OriginY(self, value: float) -> None
Gets or sets the y of the point the pattern is laid from.
PatternFile
@property
def PatternFile(self) -> str | None
@PatternFile.setter
def PatternFile(self, value: str | None) -> None
Gets or sets the file the pattern is of: a full path of a .pat file, or CadPatternFile.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
@property
def PatternName(self) -> str
@PatternName.setter
def PatternName(self, value: str | None) -> None
Gets or sets the name of the pattern, as ANSI31.
Scale
@property
def Scale(self) -> float
@Scale.setter
def Scale(self, value: float) -> None
Gets or sets the scale of a pattern of a file: 2 draws its lines twice as far apart.
Spacing
@property
def Spacing(self) -> float
@Spacing.setter
def Spacing(self, value: float) -> None
Gets or sets the spacing of the lines of a pattern made by the user.
Transparency
@property
def Transparency(self) -> DxfTransparency | None
@Transparency.setter
def Transparency(self, value: DxfTransparency | None) -> None
Gets or sets how much a new hatch lets show through; null for the current setting, as HPTRANSPARENCY's "." says.
Type
@property
def Type(self) -> CadHatchType
@Type.setter
def Type(self, value: CadHatchType) -> None
Gets or sets what the hatch is filled with.
Methods
Clone
def Clone(self) -> CadHatchSettings
Gets a copy.
Of
@staticmethod
def Of(hatch: DxfHatch) -> CadHatchSettings
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
def Preview(self, source: CadDocument) -> 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.