Hatch Home

Hatch is a boundary filled with a pattern of lines or with a solid color. The boundary can have inner "islands". LiteCAD uses hatch patterns in the same format as AutoCAD. The hatches.pat file included with the LiteCAD package contains many predefined hatch patterns. You can also create your own hatch patterns.

To add a hatch into a drawing use following functions:

Function Meaning
lcBlockAddHatch Adds a hatch

A hatch has properties and functions derived from base class and the following specific properties:

Property Type Access Meaning
LC_PROP_ENT_...    Base class properties
LC_PROP_HATCH_NAME string R Pattern name (Pattern file - LC_PROP_G_HATCHFILE)
LC_PROP_HATCH_PATTERN string R Pattern data
LC_PROP_HATCH_SCALE float RW Pattern scale
LC_PROP_HATCH_ANGLE float RW Rotation angle
LC_PROP_HATCH_SIZE float R Pattern size, max distance between dashes
LC_PROP_HATCH_ASSOC bool RW "Associative hatch" flag, possible to change only from TRUE to FALSE
LC_PROP_HATCH_SOLID bool RW "Solid hatch" flag, possible to change only from FALSE to TRUE
LC_PROP_HATCH_CUSTOM bool R "Custom pattern" flag
LC_PROP_HATCH_NPT int R Number of boundary points
LC_PROP_HATCH_NLOOP int R Number of boundary loops
LC_PROP_HATCH_NHPL int R Number of pattern lines
LC_PROP_HATCH_IHPL int W Set index of active pattern line
For active pattern line
LC_PROP_HPL_ANGLE float R Angle of pattern line
LC_PROP_HPL_X0 float R X of origin point
LC_PROP_HPL_Y0 float R Y of origin point
LC_PROP_HPL_DX float R X offset
LC_PROP_HPL_DY float R Y offset
LC_PROP_HPL_NDASH int R Number of dashes
 . . .

float R Dashes lengths. Negative value means blank dash.

Hatch specific functions:

Function Meaning
lcHatchSetPattern Changes hatch pattern
lcHatchBoundStart Starts a boundary definition
lcHatchBoundPoint Adds a boundary point
lcHatchBoundEntity Adds a boundary entity
lcHatchBoundEndLoop Ends a loop of boundary
lcHatchBoundEnd Ends a boundary definition
lcHatchPatStart Starts a pattern definition
lcHatchPatLine Adds a pattern line
lcHatchPatEnd Ends a pattern definition
lcHatchGetLoopSize Retrieves a number of points in a boundary's loop
lcHatchGetPoint Retrieves coordinates of a boundary's point

See also

  Sample code,   Sample code 2,   Retrieve objects