Table of Contents

Method SetGradient

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

SetGradient(DxfGradientPatternType, string)

Fills the HATCH with a gradient, as AutoCAD's SetGradient: filled solid (70 of 1) with the pattern SOLID, its pattern's angle, scale and lines taken out, and its gradient data (450 of 1 on) of the name given; the angle, shift, tint and colours it has kept, or, where it had no gradient data, nought and AutoCAD's colours of a new gradient, blue (0, 0, 255) to a pale yellow (255, 255, 153), as the variables GFCLR1 and GFCLR2 start.

public void SetGradient(DxfGradientPatternType gradientType, string gradientName)

Parameters

gradientType DxfGradientPatternType

Where the gradient comes from: one of AutoCAD's nine, or one of another name.

gradientName string

The name: LINEAR, CYLINDER, INVCYLINDER, SPHERICAL, INVSPHERICAL, HEMISPHERICAL, INVHEMISPHERICAL, CURVED or INVCURVED, letters of either case the same, for one of AutoCAD's.

Exceptions

ArgumentNullException

Thrown when the name is null.

ArgumentException

Thrown when the name is empty or has a line break in it, or is not one of AutoCAD's for PreDefinedGradient.

InvalidOperationException

Thrown when the file is older than R2004 (AC1018), which has no gradients, or the HATCH is erased.