Click here to download this tutorial and a dwg example.
STEP 1
Prepare the source drawing. This must be fit in a 1x1 square.
All objects inside this square must be lines. A hatch pattern can be composed only by lines - this limitation is imposed by the format of the 'pat' file.
STEP 2
Load and launch the Haci program.
You can load also the program using the pull-down menu: Tools->Load Application.
A new command is created: haci. Launch the program using this new command.
STEP 3
Configure the new pattern.
In this dialog, if the checkbox 'Create new pattern file' is checked, the new pattern will be saved in a sepparate file, and will be available as custom pattern. If this checkbox remains unchecked, the new pattern will be append to the 'acad.pat' file.
The precision will affect the quality of your resulted pattern. But if you choose a smaller value (better quality), the time necessary to process the source drawing will be increased. If your source contains many objects, this will affect also the time necessary to regenerate your Autocad drawing in which this pattern will be used.
After pressing Ok, the program will ask you to select the source objects for your pattern.
In this example the square is also selected, but this is a polyline and will be ignored in the hatch generation phase.
Then the program will automatically adjust your source drawing according to precision you choose. In an ideally case, you will not see any difference between the two drawings. It is recommended to draw your pattern using the snap mode toggled ON, with a snap value equally with the desired precision.
STEP 4
Select the pattern file.
Enter the name of your pattern file. This will have the extension 'pat'. The name of the pat file must be identical with the name of the pattern. In our example, this is 'Pebble_01'. Here we select an existing pat file. This file will be overwritten. The directory where this file will be located must be in the Autocad support search path. If you choosen to not create a new file, the new pattern definition will be append at the end of the 'acad.pat' file. In this case you must indicate here the path to that file.
STEP 5
The new pattern is created.
The pattern generation process is started. In the coordinates area you can see a counter that show you the number of lines remains from your source objects. After all the lines were processed, the counter will indicate '0 lines left'.
STEP 6
Test your pattern.
The new pattern is created and is stored in a pat file. Now we can test them using the bhatch (or hatch) command.
The result will look like this:
The content of the pattern file (Pebble_01.pat) is this:
*Pebble_01, hatch pattern generated by HACI 1.3
15.25511,0.552,0.952,7.27958125,0.08770581, 0.18242807,-11.21932571
-14.62087,0.368,1,4.12289091,0.04207032, 0.19015783,-23.57957039
8.74616,0.088,0.672,6.08228733,0.07602859, 0.10522357,-13.04772279
41.18592,0.192,0.688,1.41108119,0.09407209, 0.08504117,-10.54510381
65.55604,0.256,0.744,9.84851048,0.08276059, 0.09666437,-11.98638211
90,0.296,0.832,0,1, 0.08,-0.92
-23.96248,0.224,0.944,7.61509572,0.10153462, 0.07879086,-9.77006625
8.74616,0.12,0.928,6.08228733,0.07602859, 0.10522357,-13.04772279
36.86989,0.056,0.88,1.39999985,0.20000002, 0.08,-4.9199995
81.86989,0.048,0.824,0.98994949,0.14142135, 0.05656854,-7.0144994
-84.2894,0.048,0.824,9.05483855,0.09950372, 0.080399,-9.96947674
-66.03751,0.056,0.744,2.23376158,0.10153462, 0.07879086,-9.77006702
4.3987,0.624,0.448,12.04135023,0.0766965, 0.10430724,-12.93409748
-28.61045,0.728,0.456,2.23464308,0.0798087, 0.10023971,-12.42972322
-71.56505,0.816,0.408,2.21359438,0.31622776, 0.17708755,-2.98519013
74.0546,0.824,0.072,4.12081699,0.13736056, 0.17472264,-7.1053874
36.86989,0.728,0,1.39999985,0.20000002, 0.12,-4.8799995
7.59464,0.64,0.512,7.07075897,0.06608186, 0.12106197,-15.01168386
30.25643,0.76,0.528,5.83050715,0.07198158, 0.11113955,-13.78130342
71.56505,0.856,0.584,0.9486833,0.31622776, 0.12649111,-3.03578658
-67.61986,0.84,0.84,12.99988667,0.05439283, 0.14707821,-18.23769875
-6.70983,0.704,0.856,9.05519657,0.05842062, 0.13693794,-16.98030459
12.09475,0.592,0.832,9.21927965,0.06984303, 0.11454257,-14.20327812
63.43494,0.544,0.736,0.89442721,0.44721356, 0.10733126,-2.12873689
29.0546,0.512,0.368,8.06167233,0.09712859, 0.08236504,-10.21326469
49.3987,0.584,0.408,7.8094971,0.10846522, 0.07375636,-9.14578884
86.18592,0.632,0.464,0.99778516,0.06651901, 0.12026637,-14.9130301
-77.47119,0.624,0.656,4.12167874,0.10846523, 0.07375636,-9.14578818
-48.81407,0.568,0.72,1.41108141,0.09407208, 0.08504117,-10.54510543
-33.69006,0.496,0.768,2.21880061,0.27735012, 0.08653323,-3.51901773
22.61986,0.4,0.728,7.61538434,0.07692308, 0.104,-12.89599953
59.03624,0.352,0.648,2.22948168,0.17149858, 0.09329523,-5.73765688
-86.42366,0.352,0.648,15.03316706,0.06237829, 0.12824976,-15.90296988
-44.99999,0.36,0.52,0.70710666,0.7071069, 0.21496046,-1.19925285
59.53445,0.92,0.448,13.89235219,0.05070201, 0.15778466,-19.56529929
90,0.92,0.312,0,1, 0.136,-0.864
-44.99999,0.92,0.312,0.70710666,0.7071069, 0.06788225,-1.34633106
18.43494,0.968,0.264,2.21359421,0.31622778, 0.02529822,-3.13697928
6.70983,0,0.272,8.06204596,0.05842062, 0.13693794,-16.98030459
28.61045,0.136,0.288,10.29531985,0.0798087, 0.10023971,-12.42972322
51.34019,0.224,0.336,4.9975605,0.15617376, 0.10244999,-6.30067441
-79.99202,0.264,0.552,11.18018982,0.05792844, 0.13810141,-17.1245751
-33.69006,0.192,0.6,2.21880061,0.27735012, 0.08653323,-3.51901773
-5.71059,0.112,0.608,0.99503719,0.09950372, 0.080399,-9.96947656
12.09475,0,0.584,9.21927965,0.06984303, 0.11454257,-14.20327812
0,0.944,0.2,0,1, 0.056,-0.944
45,0.864,0.12,0.70710678,0.70710678, 0.11313708,-1.30107648
86.18592,0.856,0,0.99778516,0.06651901, 0.12026637,-14.9130301
0,0.944,0.88,0,1, 0.056,-0.944
-35.53767,0.888,0.92,3.60367646,0.11624765, 0.0688186,-8.53350583
-68.19859,0.856,1,2.22834407,0.18569534, 0.08616264,-5.29900219
55.00797,0.072,0.92,3.60462087,0.08192318, 0.09765244,-12.10890463
35.53767,0.016,0.88,4.99864797,0.11624765, 0.0688186,-8.53350583
0,0,0.88,0,1, 0.016,-0.984
-77.90524,0.104,0.112,9.21928001,0.06984303, 0.11454257,-14.20327865
-59.03624,0.056,0.192,3.60147043,0.17149858, 0.09329523,-5.73765688
-8.1301,0,0.2,0.98994949,0.14142136, 0.05656854,-7.01449923
-65.22485,0.32,0.104,2.23497713,0.06984302, 0.11454257,-14.20327958
86.82016,0.32,0.104,0.99846035,0.05547002, 0.14422205,-17.8835345
56.30993,0.328,0.248,2.21880084,0.27735009, 0.14422205,-3.46132933
26.56505,0.408,0.368,1.34164077,0.4472136, 0.07155418,-2.16451378