AcadApps
Applications for AutoCAD
PatGen 1.0

Introduction

PATGEN is a simple hatch pattern generator which allows the creation of new patterns without any knowledge of the description language used in AutoCAD PAT files. The user simply draws the pattern using AutoCAD entities, selects these entities, enters the pattern unit rectangle and finally names the new pattern. Once the pattern generated, it is loaded as the current hatch pattern for BHATCH command.

PATGEN can generate a hatch pattern from points, lines, polylines, arcs, circles, ellipses and splines. PATGEN is the only hatch pattern generator to allow the use of splines. Moreover, most similar tools use a square unit when PATGEN can generated rectangle-based patterns.

Example of a hatch pattern

Creation method : Objects to select and pattern unit


Basic options

PATGEN command displays a dialog with the following options :

Select objects :

Click on the button to choose the AutoCAD entities which compose the hatch pattern.

Draw unit :

Click on the button to define the rectangular pattern unit .

Preview area :

The preview area is updated each time the user selects objects or draws the pattern unit.

Name :

The program suggests a default pattern name (e.g. Patgen04567). The user is free to choose another name instead.

Description :

You can enter an optional text description that will be saved in the PAT file.


Advanced options

In the Details area of the dialog box, several options are available. The changes made to these options are preserved all along the session.

Filename and location :

Two options are available :

  1. The pattern can be saved as a custom hatch file, located in the support directory ; in this case, the filename is composed of the pattern name and the .pat suffix. If the user changes the filename in the "Save as" dialog box, the pattern name is modified accordingly. This is a condition for AutoCAD to load properly the pat file. The new hatch pattern appears in the custom patterns list.
  2. Instead, the pattern description can be appended to the general AutoCAD hatch file. This file could be either acad.pat or acadiso.pat, depending on the loaded template file. The new pattern appears in the predefined patterns list.

The first option is set by default and is the most recommended. It prevents from modifying the original AutoCAD PAT files.

The default location for the PAT files is the user support directory ( C:\ Documents and Settings\ userName\ Application Data\ Autodesk\ R16.0\ eng\ Support). If you change the file location in the "save as" dialog, the new location will be used for the following patterns.

Curve resolution :

Number of divisions of curved objects (arcs, circles, ellipses, splines). Increasing this value improves the curvature but generates a slightly larger PAT file. The default value is 16.

Tolerance value :

Maximum relative error during the conversion of the objects' geometry to PAT file format. Increasing this value improves the pattern quality but requires from AutoCAD longer computing times while applying the pattern. Since this value is a percentage of the pattern unit size, the default value of 0.01 suits most cases.


Known limitations

  • When using BHATCH command, the pattern preview does not appear properly. In order to avoid this, hatch patterns must be defined inside a square area from 0,0 to point 1,1, with a pattern unit of 1x1. In any case, the preview appearence has no effect on the final quality of the pattern .
  • AutoCAD restricts pattern names to not include special characters (space,comma,point, etc.)