The Nether Regions

15 Jun, 2004 By: Bill Fane

AutoCAD’s little-known Regions feature helps you create and manipulate components within your drawings.

The chain saw purred contentedly as Captain LearnCurve worked on the firewood inventory at his lakeside cabin. It was a beautiful spring afternoon, unseasonably warm for this region of the country.

Speaking of Regions . . .
Regions are among the many underused features in AutoCAD. I don't believe this is because they're difficult or complex (they're not), but simply because most users have never heard about them.

Let's start with a quick example of how to create a region, then go on to explore its properties and uses.

Start the Line command and draw a series of line segments. The only rules are that you can't cross over another line in the series and that you end with the Close option or by snapping the last segment to the start of the first segment. You need to end up with a closed loop, as shown in figure 1.

Figure 1. A suitable boundary for a region.

Region buttonNow invoke the Region command. As usual, there are several ways to do this. You can select Draw/Region, click on the Region button in the Draw toolbar, or type Region at the Command prompt.

Unlike with many commands these days, you don't get a fancy dialog box. Instead, the AutoCAD prompt area invites you to Select objects:. You can use any standard AutoCAD selection mechanism, including object picking, window, and crossing window, and you can select line segments in any order.

When you press Enter to complete the selection process, you see the message:

1 loop extracted. 1 Region created

and the Command prompt returns. Nothing much else seems to have happened.

Ah, but it has! Click on a line segment. The entire loop highlights, and grip boxes appear at the end of each line segment, as shown in figure 2.

Figure 2. The boundary has become a single object.

This now behaves suspiciously like a block insertion. You can grab it by any grip and drag it to a new location, but you can't move one line end or intersection point relative to the others. The shape always stays the same.

Click View/Shade/Flat Shaded. The result appears in figure 3.

Figure 3. A shaded region.

This suggests that a region is something more than a simple grouping together of line segments. You can obtain further evidence of this by clicking Tools/Inquiry/Region/Mass Properties. You are then invited to Select Objects:, after which you see the following information:

 ----------------  REGIONS  ---------------- 

Area:          310.3776 
Perimeter:        83.0085 
Bounding box:  X: 14.0397 -- 38.2518 
               Y: 7.8123 -- 25.5649 
Centroid:      X: 27.6700 
               Y: 16.5906 
Moments of inertia:  X: 92371.8143 
                     Y: 247697.2379 
Product of inertia: XY: 142100.6440 
Radii of gyration:   X: 17.2514 
                     Y: 28.2498 
Principal moments and X-Y directions about centroid:
           I: 6894.7583 along [0.9928 -0.1198]
           J: 10108.6127 along [0.1198 0.9928]

Hmmm, these look suspiciously like the mass properties of a solid. An AutoCAD region is actually an infinitesimally thin 3D solid. In fact, AutoCAD uses its 3D modeling modules to create, edit, and analyze regions.

To show this, let's look at a simple editing function. Turn shading off (View/Shade/2D Wireframe) and draw two circles, as shown in figure 4.

Figure 4. Draw two circles over the solid.

Start the Region command again, and select both circles. Note that AutoCAD creates two separate regions, even though they were created in one run of the command.

Now pick Modify/Solid/Editing/Union. Select the original solid plus the left-hand circle, and press Enter to complete the command. Pick Modify/Solids Editing again, but this time select Subtract. Select the original solid, press Enter, select the right-hand circle, and press Enter again.

Turn shading on (View/Shade/Flat Shaded). Figure 5 shows how we've added the left circular region and cut the hole. The result is one single region. If you want to, list the mass properties again and note the changes.

Figure 5. Adding to and subtracting from a Region.

Now that you've played with the basic principles, let's look at some of the details and then go on to consider how we might use these objects.

Here We Go, Loopy-Loo
The first significant point is the boundary loop definition. Remember that I told you not to cross over another line and to end with the Close option. The boundary for a region must form a single, continuous loop with no gaps, overlaps, or crossovers. It must outline a single continuous area. You can mix and match any combination of lines, arcs, splines, and polylines (even curve-fit polylines), as shown in figure 6. You can draw and select them in any order, as long as they form a single loop that exactly touches (use object snaps) at each vertex.

Figure 6. A Region can use lines, polylines, arcs, and splines as its boundary.

Regions can also use circles and ellipses as boundaries, but as we saw earlier each one forms a separate Region even when they are selected as multiple objects in one run of the Region command. A single region boundary can't cross itself in a figure eight or bowtie manner.

Okay, so what if you want to form a region using existing objects as the boundary, but they don't meet the rules?

Figure 7. Crossing and intersecting objects cannot form a Region boundary.

Figure 7 shows an odd collection of crossing lines and arcs We want to form a region from the central enclosed area. No problem. Pick Draw/Boundary and click the Pick Point button in the upper right corner of the dialog box. Now click a point inside the desired area and press Enter. The red object shown in figure 8 is the single polyline that's automatically created. It's a perfect boundary definition for a region.

Figure 8. The Boundary command can produce Region boundaries from odd areas.

When a region is created, it takes on the properties of the current layer. When viewed in Wireframe mode, the region boundary takes on the linetype, color, and lineweight of the host layer or any property overrides that are applied. When viewed in Shaded mode, the region takes on the "current" color (ByLayer, or any override,) but ignores linetype and lineweight.

Blowed Up Real Good
If you explode a region, its boundary reverts to lines, arcs, splines, circles, and ellipses. Polylines used in the original boundary become line segments, and curve-fit polylines become arc segments.

Now that you know how to create regions, let's take a look at some of their uses.

Probably their biggest single advantage is that they act like a block insertion without the overhead of creating a block. They can also reduce the time required to create certain shapes. Let's look at an example.

Figure 9 shows a bunch of circles. I want to cut the smaller ones from the larger one to form a sprocket, and I want to easily move the sprocket around in my drawing. I need only one copy of it in the drawing.

Figure 9. I want to make a sprocket from the circles.

The hard way would be to Trim all of the small circles and the large one, then create and insert a block of the resulting pieces. The easy way is to use the Boundary command, then form a region, as shown in figure 10. You can then erase the original circles.

Figure 10. The region formed from figure 9.

If desired, I can then subtract a region to form the central bore for the sprocket.

The analysis function can be very useful as well. Yes, the Area command produces the area enclosed by a boundary, but analyzing a region also gets you the centroid of the area and the smallest rectangular bounding box that encloses it.

Regions have a great many uses in almost any application of AutoCAD. They make it very easy to create and manipulate mechanical components, and architects can use them to create, manipulate, and analyze odd-shaped areas.

And Now for Something Completely Different
If you carry your chainsaw in a molded plastic carrying case, you should double-bag your sharpening file in sealable Zip-Loc bags before putting it in the same case. Chain oil really clings to metal surfaces, and if you get any on your file it becomes almost useless for sharpening your chain.

AutoCAD Tips!

Lynn Allen

In her easy-to-follow, friendly style, long-time Cadalyst contributing editor Lynn Allen guides you through a new feature or time-saving trick in every episode of her popular AutoCAD Video Tips. Subscribe to the free Cadalyst Video Picks newsletter, and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!

Follow Lynn on TwitterFollow Lynn on Twitter

Do you use social media — such as Facebook or Twitter updates, YouTube videos, or discussion forums — for work-related purposes?
Yes, I regularly use such resources for work-related purposes.
Yes, but on a limited or infrequent basis.
No, because my employer frowns upon or prohibits doing so.
No, because I don’t have the time or interest.
Submit Vote

Download Cadalyst Magazine Special Edition