AddHatch Method

Creates a Hatch object.

See Also | Example

Signature

RetVal = object.AddHatch(PatternType, PatternName, Associativity [, HatchObjectType])

Object

ModelSpace Collection, PaperSpace Collection, Block
The object or objects this method applies to.

PatternType

AcPatternType or AcGradientPatternType enum; input-only
If the HatchObjectType enum value is acHatchObject, then use the AcPatternType enum; if the HatchObjectType enum value is AcGradientObject, then use the AcGradientPatternType enum.

PatternName

String; input-only
If the HatchObjectType enum value is acHatchObject, then PatternName should contain the hatch pattern name. If the HatchObjectType enum value is acGradientObject, then PatternName should contain one of the the gradient pattern names listed in GradientName.

Associativity

Boolean; input-only

TRUE: The hatch will be associative.

FALSE: The hatch will not be associative.

HatchObjectType

HatchObjectType; optional; input-only
The default value is the AcHatchObjectType enum value of AcHatchObject. If the AcHatchObjectType enum value is AcGradientObject, then PatternType should be of type AcGradientPatternType, and PatternName should contain the gradient pattern name.

RetVal

Hatch object
The newly created Hatch object.

Remarks

The PatternType constant values are as follows:

acHatchPatternTypePredefined

Selects the pattern name from those defined in the acad.pat file.

acHatchPatternTypeUserDefined

Defines a pattern of lines using the current linetype.

acHatchPatternTypeCustomDefined

Selects the pattern name from a PAT file other than the acad.pat file.

After the Hatch object is created, you must add the outer loop using the AppendOuterLoop method. The outer loop must be closed and must be created before any inner loops can be created. Inner loops are created one at a time, using the AppendInnerLoop method.

WARNING! Once the Hatch object has been created, you must append the outer loop to the Hatch object for it to become a valid AutoCAD object. If you attempt any operation other than calling the AppendOuterLoop method, AutoCAD will enter an unpredictable state.

 

   Comments?