Hatches

autocad_entity: autocad_hatch

Hatch features represent AutoCAD hatch entities. They are composed of two-dimensional boundary loops that define areas which can be filled with line patterns or color gradients. The loops of each hatch are closed, simple, continuous, and are not self-intersecting except at their endpoints. (Since loops are closed lines that are considered area boundaries, they are essentially polygons.)

The AutoCAD Reader creates features with varied geometry depending on the geometry of the loops that compose them. Features created may be of polygon, donut, or aggregate geometry, where the aggregates may contain either donuts and polygons or just ordered polygons depending on the usage of the Preserve Complex Hatches and MPolygons reader parameter. The AutoCAD reader will also preserve polyline bulge information.

The AutoCAD Reader has the following limitations when reading hatch features: Associative hatches are not preserved, one pattern is allowed per hatch, only one or two color gradients are supported, unclosed hatch boundary loops are closed, and splines are not supported for hatch boundary loops.

The AutoCAD Writer has the following limitations when writing hatch features: Hatch features must be closed area features of polygon, donut, or aggregate geometry according to how the AutoCAD Reader created them. The Workbench writer parameter Prefer Writing Donuts as Hatches can also be used to control hatch writing. In addition, their geometry must be 2D or planar 3D with a constant Z, which can be stored as an elevation value.

Hatch patterns exist in external pattern files. The AutoCAD writer references such pattern files to write patterns of the predefined or custom types, see the autocad_hatch_pattern_type attribute below. However, the ACAD and REALDWG writers look for patterns in different ways.

The ACAD format writer will look for custom hatch patterns in custom <filename>.pat files located in folder specified by the ACAD operating system environment variable, or in the related folder for any installed AutoCAD product.

The REALDWG format writer will look for custom hatch patterns in custom <filename>.pat files in the <FME install folder>/plugins/realdwg/Support folder. Predefined patterns can be found in the acdb.pat file in that folder, and additional patterns can also be added to that file.

The following attributes may be set when reading hatches.

Attribute Name

Content

autocad_hatch_associative

Used only for reading

The flag indicating if the hatch is associative.

Range:

  • 0 for no
  • 1 for yes

Default: 0

autocad_hatch_complex_mode

The flag that represents whether the hatch feature was created to preserve complex hatches. This indicates how the structure of loops is created.

Range:

  • 0 for no
  • 1 for yes

Default: 0

autocad_hatch_gradient_angle

The angle of the gradient fill for the hatch feature in degrees.

Range: Any 64-bit floating point number

Default: 0

autocad_hatch_gradient_color1

The first color used to interpolate a two color gradient fill. It the single color used in a one color gradient fill. Specified as a character string of comma-separated red, green and blue values.

Range: 0..255,0..255,0..255.

Default: None.

autocad_hatch_gradient_color2

The second color used to interpolate a two color gradient fill. Specified as a character string of comma-separated red, green and blue values.

Range: 0..255,0..255,0..255

Default: None.

autocad_hatch_gradient_name

 

The name of the gradient. Must be a predefined value for predefined gradients. This is mandatory for hatches with gradients.

Range:

  • Curved
  • Cylinder
  • Hemispherical
  • Linear
  • Spherical
  • Invcurved
  • Invcylinder
  • Invhemispherical
  • Invspherical

Default: None

autocad_hatch_gradient_one_
color_mode

 

The flag indicating whether only one color should be used in gradient calculation. Gradients can be two color, or one color with a luminance value set by autocad_hatch_shade_tint_value.

Range:

  • 0 for no
  • 1 for yes

Default: 0

autocad_hatch_gradient_
shift

The interpolation value between the default and shifted values of the gradient's definition.

Range: 0..1

Default: None

autocad_hatch_gradient_type

The type of the gradient. Currently this is set to 0 for predefined gradient. In the future a value of 1 may be supported for user-defined gradients. This is only used for hatches with gradients.

Range:

  • 0 for predefined
  • 1 for user-defined

Default: None

autocad_hatch_loop{}.autocad_hatch_bulge{}

The list of bulge values for polyline bulge arcs in each of a list of hatch boundary loops. The list of bulge values parallel the vertices in each loop. A bulge value represents the tangent of 1/4 the included angle in the arc measured counterclockwise. A value of 0 represents a line, and a value of 1 represents a semicircle.

Range: 0..1

Default: 0

autocad_hatch_loop{}.autocad_hatch_bulges_present

The flag indicating if polyline bulge arcs exist in each of a list of hatch boundary loops.

Range:

  • 0 for no
  • 1 for yes

Default: 0

autocad_hatch_loop{}.autocad_hatch_type

The type of the hatch loop. This is an integer representing the addition of applicable type flags.

Range: numeric value

Default: None

autocad_hatch_object_type

The general type of the hatch, specifying the usage of either patterns or gradients.

Range:

  • 0 for classic hatch
  • 1 for color gradient

Default: 0

autocad_hatch_origin_point_x

The x-axis coordinate of the origin of the hatch in world coordinates.

Range: Any 64-bit floating point number

Default: 0

autocad_hatch_origin_point_y

The y-axis coordinate of the origin of the hatch in world coordinates.

Range: Any 64-bit floating point number

Default: 0

autocad_hatch_pattern_angle

The angle of the pattern fill for the hatch feature in degrees.

Range: Any 64-bit floating point number

Default: 0

autocad_hatch_pattern_double

The flag indicating if the hatch pattern is doubled by adding a second set of lines at 90 degrees to the first. This is only used for user-defined patterns.

Range:

  • 0 for no
  • 1 for yes

Default: 0

autocad_hatch_pattern_name

 

The name of the pattern. May be a predefined value for predefined patterns, a predefined value for custom patterns, or any string for user-defined patterns.

Range:

  • Predefined or custom pattern name
  • any string

Default: SOLID

autocad_hatch_pattern_scale

This represents the scaled size of the pattern for predefined and custom-defined patterns.

Range: positive floating point value > 0

Default: 1

autocad_hatch_pattern_space

This represents the space between the parallel lines of the hatch pattern. This is only used for user-defined patterns.

Range: positive floating point value > 0

Default: 1

autocad_hatch_pattern_type

The type of the hatch pattern. Custom-defined patterns are pre-created patterns that must be present in the location of the predefined patterns. This is only used for hatches with patterns.

Range:

  • 0 for user-defined
  • 1 for pre-defined
  • 2 for custom-defined

Default: None

autocad_hatch_pixel_size

The size of pixels for intersection and ray casting when drawing the hatch.

Range: positive floating point value > 0

Default: 1

autocad_hatch_shade_tint_value

The luminance value of the hatch. If the hatch has a gradient and is using one color mode, this value is applied to the first color.

Range: 0.0..1.0

Default: 0