All the Better to Hatch You With (Learning Curve AutoCAD Tutorial)1 Feb, 2007 By: Bill Fane
AutoCAD 2006 includes crosshatching improvements that save time -- and aggravation.
It was a dark and stormy night. The wind was blowing, it was cold and icy rain was falling.
"I'm sick of this terrible weather," moaned Captain LearnCurve. "We need a tropical vacation."
"Forget it!" replied his gorgeous wife. "It's less than a week since we got back from six weeks on Maui!"
Captain LearnCurve sighed and resigned himself to watching the criss-crossing patterns made by rain running down the windows. He would be stuck in the house, quite miserable, until the storm let up. The predicament reminded him that in the good old days of PAP (pencil and paper) drafting and one of the worst jobs it entailed -- applying crosshatching to a complex section view. It could, quite literally, take several days.
When AutoCAD came on the scene, things got a lot better. It automatically applied hatching "almost instantly," depending on the complexity of the hatch area and on the speed of the computer (see my 20th Anniversary column).
Good as it was, however, it still had a couple of thin spots. The thinnest spot involved the definition of the hatch boundary. It had to be formed from a set of objects that exactly touched at their ends. There could not be any gaps or overlaps, or things would not work properly. If you did make a mistake, or if the design subsequently changed, then you had to delete the hatching and start over.
Figure 1. Gaps and overlaps confused the early versions of the Hatch command.
By the way, if you want to duplicate this in the current releases, then simply click on Add: Select Objects instead of the usual Add: Pick Points button in the Hatch and Gradient dialog box.
The major breakthrough came in Release 12. In fact, the change was so significant that it became a new command called BHatch (Boundary Hatch). It was no longer necessary to select each boundary object, nor was it necessary for the boundary objects to exactly touch at their ends. They still couldn't have gaps, but at least they could overlap.
All we had to do was select a point within the desired area. BHatch would go out looking for objects or sections of objects that bounded the area, and would then create a polyline boundary. The single boundary polyline would then be hatched using the old Hatch command mechanism.
For all its other flaws, the ill-fated Release 13 did have some redeeming features. One of these was the fact that hatched areas now became associative with their boundaries. This meant that you could use grip editing or the Stretch command to change the shape of the area and the hatching would automatically update to conform to the new boundary.
Release 14 added the ability to apply solid fills to areas. This is essentially the hatch command as we know it today -- or at least it was until recently.
AutoCAD 2006 only added five improvements to hatching, but they are all very significant.
Area Answers. Okay, I've started with a lie already. This is not directly part of the BHatch command, but it is an improvement to hatching nonetheless.
Have you ever had fun trying to use the Area command on a complex, multi-object area? It can get a little messy as you add and subtract objects. Now, however, all you need to do is to hatch the area. Single-click on it and then start the Properties command (Modify / Properties), or vice-versa, and watch in shock and awe as the properties palette now lists the area covered by the hatching. If you select two or more hatched areas, then it displays the total cumulative area.
Oh, rats. My topic for next month was going to be on how to handle the complexities of the Area command. Oh, well?
Several Degrees of Separation. Previously, Hatch and BHatch let us select several non-contiguous boundary definitions in one run of the command. This produced a single hatch object that was applied to all of the enclosed areas.
Usually this is desirable from a simplicity point of view, but now it's possible to select several non-contiguous boundary definitions at one time and yet have a separate hatch object applied to each of them. Better yet, you can break an existing multi-area single-hatch object up into separate hatch objects.
The dialog boxes are virtually identical, whether you're creating a new hatch or editing an existing one. I'll use the Edit dialog box for my examples, because the Create box has several options greyed out.
Select Modify / Object / Hatch, or double-click on a hatched area to invoke the HatchEdit command. This brings up the Hatch Edit dialog box.
Figure 2. The Hatch Edit dialog box is used to edit hatched areas.
Select the Separate Hatches option, and then click OK. Like magic, each separate hatched area is now a discrete, separate object.
In the Beginning... In the earliest releases, the Hatch command always began at the drawing origin (0,0) when creating a hatched area. If the hatched area didn't surround the origin then there wouldn't be a line that passed through the origin, but there would always be one whose imaginary extension did. If the hatching did not line up with the area boundaries, well, that was too bad.
This got marginally better when UCS (User Coordinate Systems) were introduced, in that hatching always aligned with the current UCS origin. If hatching did not align properly with the boundaries we could always delete the hatching, move the UCS origin and then hatch again.
In the current releases, the hatch dialog boxes have a new zone in the lower left that let us specify the origin for each hatch object individually. Among other modes, we can pick a specific point, which is usually snapped to a significant point on the boundary, or we can have it default to using the extents of the area boundary.
Déjà Vu — Deux. BHatch usually works by starting from the picked point. It radiates outward, looking for boundary objects and then builds a polyline that defines a single boundary object. It applies the hatching and then normally it deletes the boundary object. If we want, we can have it retain the boundary polyline or convert it to a region.
HatchEdit now lets us recreate the boundary, either as a polyline or as a region, if we decide we need it back.
Buddy, Can You Spare a Change? Let's end with one of the most significant of the new features. BHatch now lets you edit a hatch boundary. Okay, you caught me in another lie. BHatch doesn't allow this, but HatchEdit does.
Start with a drawing that looks something like this.
Figure 3. A hatched area.
Now add another rectangular island within the hatched area.
Figure 4. Add a rectangular island within the hatched area.
In previous releases it would have been necessary to delete the hatching and then create it again in order to add this island. Now, in AutoCAD 2006 and later, simply click on the Add: Select Objects button in the Boundaries section in the upper-right corner of the dialog box. The box is dismissed, and you are invited to select objects. Click on the rectangle and then press Enter to complete the selection process.
Click on OK to complete the editing, and your drawing now looks like this.
Figure 5. The rectangular island has been added to the hatched area.
That was a lot easier than the old way, wasn't it? This is especially true when you realize that you can add more than one object at a time to the boundary set, and that added objects need not fall within the existing hatched area. Not only that, but everything is still fully associative.
Figure 6. Boundary objects added with HatchEdit need not fall within current hatched areas.
There are two final points to note with the new HatchEdit functionality. The first is that it can also be used to remove boundary objects, so that figure 5 can be turned back into Figure 4.
The second point is that we are not limited to selecting objects to add. We can also pick a point within the bounded area, just as we are used to doing when creating hatched areas. The results can be a little bizarre, however, until you realize one thing. As near as I can tell, picking a point reverses the current hatch status. That is, if you pick inside an existing hatched area, it then it becomes unhatched and unhatched islands within it become hatched, and vice-versa. Experiment a bit and you will see what I mean.
A Hatch-It Job
Okay, I lied a bit again, but it's not my fault. The New Features Workshop for AutoCAD 2006 only lists five improvements to hatching, but there is a sixth. If you click on the sideways arrowhead in the lower-right corner of the BHatch/HatchEdit dialog boxes, they expand out to show advanced options. Another feature that was added in AutoCAD 2006 is that it is now possible to specify a "fuzz factor." This means that gaps smaller than the specified amount are ignored and the hatch is created properly.
Unbelievable -- I managed to get through an entire column on hatching without once using the word "egg."
And Now For Something Completely Different
There are two kinds of swimming snorkel in the world. The ones with a rigid molded U-shape at the bottom are best for surface snorkelling, because they do not pull sideways at your mouth. Those with a ribbed flexible section at the bottom are best for scuba diving, because the mouthpiece tends to pull down and away from your scuba regulator when not in use.
Autodesk Technical Evangelist Lynn Allen guides you through a different AutoCAD feature in every edition of her popular "Circles and Lines" tutorial series. For even more AutoCAD how-to, check out Lynn's quick tips in the Cadalyst Video Gallery. Subscribe to Cadalyst's free Tips & Tools Weekly e-newsletter and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!