home - about - advertise
    
Sponsors
Navigation
Partners

Innovate3D
 
AutoCAD Tutorial

Fit the Hatch on the Corner

by Alireza Parsai, April 10, 2003

Sometimes you may need to create a hatch that passes through one of the corners of the enclosing area. There is a simple solution to this problem:  Set the SNAPBASE system variable to a proper value.

SNAPBASE indicates the location for the snap base point. You can change the value of SNAPBASE system variable by changing the X base and Y base contents in Drafting Settings dialog box [Figure 1]. To view this dialog box, right-click on SNAP or GRID button on status bar and then select Settings.


Figure 1

You can also set this variable by typing its name in command line and assign a new value. For example:

Command: snapbase

Enter new value for SNAPBASE <0.0000,0.0000>: 4.67,1.31

The SNAPBASE alters the base point for Snap and Grid. It also affects the behavior of BHATCH command in creating hatches. Here are two typical examples to illustrate the usages of this system variable.

Example 1

You want to draw a 4 by 5 rectangle. The lower left corner of the rectangle is located at 9.54,2.43. Both Snap and Grid are enabled and their distances are set to 1.

Solution:

  1. Set the SNAPBASE to 9.54,2.43.

  2. Invoke RECTANG command.

  3. Move the cursor till you view 9.54,2.43 as the current location in coordinate display [Figure 2].


Figure 2
  1. Click.

  2. Move the cursor 4 units to the left and 5 units up.

  3. Click.

Example 2

You would like to hatch the area enclosed inside the rectangle shown in figure 3. The pattern that you will use is: User defined, Angle = 45 degrees, and Spacing = 0.5 units.


Figure 3

Solution:

If the SNAPBASE is equal to 0.0,0.0 the result will be similar to the following figure:


Figure 4

Now set the SNAPBASE to 4.25,3.75. The result is shown in the following figure. Note that one of the hatch lines passes through the lower left corner of the square.


Figure 5

A Useful Program

I have written a simple program to set the SNAPBASE by selecting a point in the drawing area. The program name is setsb.lsp and defines a command called SETSB. Click here to download the file.

If you are not familiar with loading applications into AutoCAD please read my article Loading Applications into AutoCAD 2002.

About the Author

Alireza Parsai is the founder of cadpanel.com. He is a mechanical engineer with more than 12 years experience with AutoCAD. Alireza is an Autodesk Authorized Author, the AutoCAD consultant for Al Khawarizmi Institute, a contributing editor for Augiworld magazine, a writer for CAD Digest, an instructor for AUGI Training Program, and an elected speaker for Autodesk University 2002. He has written 7 books in Farsi, 3 booklets in English, and more than 30 articles for different magazines and newsletters. You can reach him at alireza.parsai@cadpanel.com or visit his website www.cadpanel.com

More CAD Corner tutorials >>

 
Subscribe

All the week's articles
FREE!

CADdigest Weekly
TenLinks Daily
CADdepot Update