How to make custom hatch patterns in AutoCAD

Updated on February 23, 2025 | By Jaiprakash Pandey | Category AutoCAD | min reading time


AutoCAD essentials for beginners free course

Get AutoCAD essentials beginners course completely for free and get a certificate when you finish the course.

No credit card required, lifetime access

AutoCAD has a comprehensive library of hatch patterns but if you are wondering how to make custom hatch patterns in AutoCAD then I have two methods explained in this article.

The first one is a simple code method and the second one is a no-code method using AutoCAD express tool called Superhatch.

In this article, I have also explained the process of transferring hatch patterns from one drawing to another.

Before we start I also want to mention that making hatches using Superhatch is pretty easy and it does not need any kind of code but you won’t be able to transfer these custom hatches from one drawing to another which might be very limiting for most of the uses.

On the other hand, you can easily transfer hatches made with “hatch code”.

So, I will start with making custom hatch patterns using hatch codes and then about the Superhatch tool.

But if you don’t feel like reading the article you can watch this video as well which explains both the methods.

Making Hatches using “Hatch Code”

In this case, I will make this simple stair-type hatch pattern using the “hatch code”.

So, to do this open Notepad (or any other Unicode text editor if you want) and type the following lines.

*TESTHATCH, Our test hatch with the staircase effect

0, 0,0, .2,.2, .2,-.2

90, .2,0, .2,.2, .2,-.2

These lines will actually make the pattern which you see in the image above.

After adding these lines in the text editor save it as a PAT file using the same name defined in line 1 of this code.

In this case, you need to save the file as TESTHATCH.PAT, if you keep a different name for the PAT file then the custom hatch pattern will not work.

Let’s deconstruct these lines and to simplify this I have colored the horizontal segment Red and the vertical one Green.

Now, let’s move back to the Hatch code which I just showed you above.

The complete code has three lines with characters in each line separated with commas.

Every set of characters inside a comma has its own meaning and all of these lines will add up to make the complete pattern.

70 lessons| Easy Level

If you are absolute beginner of AutoCAD then you can get started right from scratch using this free course.

In this case, line 1 will determine the name and description of the hatch pattern, line 2 is for the horizontal segment of the hatch and line 3 is for the vertical segment.

Line 1: *TESTHATCH, Our test hatch with the staircase effect

In this line, the hatch code starts with a star sign followed by the name of the hatch in uppercase.

Then we have a description for the hatch separated by a comma.

So, essentially the hatch code should start with a star sign then a name and then a description all separated by a comma.

Line 2: 0, 0,0, .2,.2, .2,-.2

Line 2 is for the Red line shown in this image.

Here the first character 0 is for the angle which is 0 degrees which makes the line horizontal.

The second and third characters 0,0 are the coordinates of the starting points of the horizontal line.

In this case, 0,0 is not the absolute coordinate rather its an origin assigned by the hatch pattern for that particular pattern only.

The next characters .2,.2 are for the starting point on the next set of the horizontal line with respect to the origin set for the first point.

The last two characters .2,-.2 are for the length of the line segment and gap length.

The length of the segment is shown as .2 (positive value) and the gap is shown as -.2 (negative value) unit.

If you are familiar with making custom linetypes in AutoCAD then you will notice that this hatch code is quite similar to the linetype code for custom AutoCAD linetypes.

Line 3: 90, .2,0, .2,.2, .2,-.2

Line three is for the green lines as shown in the image below.

Here the first character 90 is for the angle of the line which you can see that, in this case, is vertical or at an angle of 90 degrees.

The second set of characters .2,0 are the coordinates of the starting point of the first green line towards the lower left column and this coordinate point is with respect to the origin defined in line 2 of the hatch code, which for this case is the starting point of the first red line as shown in the image 3 above.

The third set of characters .2,.2 is once again the offset value of the 90-degree line along the X and Y axis or the displacement of the next set of the vertical line along the X and Y axis and its in this case again 0.2 units.

The last set of characters .2,-.2 are once again the length of the vertical segment and the gap of the segment.

The positive value is for the length and the negative value is for the gap.

Getting the complete hatch pattern

As you just now saw that each line has its own role in making the complete hatch pattern and you can add even more lines in this code that will eventually add up to make a complete pattern.

So, in a nutshell, each line of the hatch pattern code will make a set of similar parallel lines which end up giving a pattern shape.

There are also some finer details related to making a hatch pattern that you need to take care of like you need to add at least one blank line at the end of the hatch code in order to make the hatch code work.

Also, you need to ensure that the hatch pattern name defined in the code and the name of the PAT file should be the same.

More can be seen in this Autodesk knowledge network article.

Using and Transferring Hatch Patterns

To use this hatch pattern in the drawing you need to copy the PAT file in the support folder.

To find the location of the support folder type OP and press enter.

Then select the file tab and expand the “Support File Search Patch” tree and there you will see the location of the support folder.

I have marked the support folder for my PC in this image in the red box.

To transfer the hatch pattern to another PC all you need to do is just copy and paste this custom PAT file into the support folder of the PC where you want it to transfer.

Alternatively, you can also add a location to this list of support files and then save all your custom hatch patterns in that folder.

This method has been explained in the video above.

Making Hatches using Superhatch

Hatches work the way that fonts do, as vector images.

Under normal circumstances, you cannot upload image files and identify them as a Hatch.

Instead, you must make a text file with specific coding but with Superhatch, you can even make hatches with images.

70 lessons| Easy Level

If you are absolute beginner of AutoCAD then you can get started right from scratch using this free course.

Super Hatches, as the name would imply, allow you to go above and beyond when creating hatches.

In the SUPERHATCH command, there are 5 options, we will learn how to use the first three.

From Block Option

We are going to make a Hatch Pattern from an AutoCAD block.

This can be done with any 2D block in AutoCAD.

Make a Pattern within the circle that’s in our AutoCAD drawing, it can be any sort of Pattern, I made one like this.

The next step is to make a rectangle in which we will apply the hatch.

For this next part, there are a lot of steps involved, so pay close attention.

First, type BLOCK in the Command Line, and hit ENTER to open up the Block Window.

In the Block Window, click “Pick point” and then click the bottom-most point of our circle marked in the red oval in the image below.

Where it says “Name” in the Block Window, give your Block a name.

It can be anything you like, as long as you can remember it, I’m naming mine “Pattern for Hatch Tutorial”.

Next, in the Block Window, click “Select objects” and highlight the entirety of our circle pattern.

Following that, you can click OK at the bottom of the Window to close it.

Those steps were pretty standard, we were just making our pattern into Block.

The following steps are where we make our Block into a Hatch.

If you have Express Tools, you can go to the Express Tools Tab in the Ribbon and click the Super Hatch icon.

If you don’t have Express Tools, you can just type SUPERHATCH instead in the Command line and then hit ENTER.

Express tools or SUPERHATCH command is not available in AutoCAD LT.

In the Super Hatch Window, Click “Block…”.

After that, Click “OK” in the next Window.

The next step is to click anywhere within the now-empty rectangle at the centre of our drawing.

The command dialogue will ask about x-scale.

Type 0.5 and hit ENTER.

Hit ENTER once again to apply the same scale to the Y-axis.

Hit ENTER repeatedly until you get to the part about “Specify Block [Extents]”.

Inside our rectangle will be a smaller version of our Block, with a magenta rectangle bordering that block.

Click the bottom-left point of that magenta rectangle.

After that, click the top-right point of that magenta rectangle.

Then, hit ENTER and click again anywhere inside the rectangle where you want to make the hatch and hit ENTER one final time.

Your final result should look something along these lines.

From Image Option

Making an image into a Hatch isn’t always so practical, but if necessary, it is possible.

We will be using this image wrinkled paper image.

You can download this image by right-clicking and selecting the “save image as” option from the contextual menu.

Save it to your computer as WrinkledPaper.jpg.

Back in AutoCAD, make a rectangle with a line passing vertically through its midpoint.

We will be Super Hatching that rectangle with our image.

Load up the SUPERHATCH Command and Select “Image..” from the Super Hatch Window.

In the Windows Explorer Window that pops up, locate the image you saved of the Wrinkled paper, select it, and click “Open”.

Click “OK” in the following window.

Following that, the AutoCAD command line will ask you to select an insertion point.

Click the bottom-left corner of the left rectangle in our drawing.

Next, AutoCAD will want you to pick a Scale Factor for the insertion.

It usually takes a couple of tries to figure out the best size.

Through trial and error, I found that it was best to use a scale factor of 50.0 in my case, in your case, it could be different.

Type 50.0 in the command line and press ENTER.

70 lessons| Easy Level

If you are absolute beginner of AutoCAD then you can get started right from scratch using this free course.

Hit ENTER once again to agree that you find the placement acceptable.

Next, the dialogue will ask you to pick internal points.

Click the border of the rectangle.

Half will be selected, it will be highlighted and your rectangle should look similar to the Figure below.

Hit ENTER one final time, your rectangle should now look like the Figure below.

What is really special about Image Hatches is you can individually select each tile and delete it or resize it if you like.

Updating a Hatch

Create an ordinary Hatch on the opposite side of the rectangle and then delete the vertical line separating the Image Hatch from the Pattern Hatch.

Now, if you delete Image Tiles bordering the Pattern Hatch, and then Hatch the empty spaces, it will update our previous Pattern Hatch to encompass the new area.

You will notice white lines bordering the Image Tiles.

If you want to get rid of these, doing so is quite simple.

Just type IMGFRAME into the Command Line and hit ENTER, then type 0, and again, hit ENTER.

The image attached to this hatch will behave like an Xref and if you delete the original image then the hatch will also disappear leaving only rectangular boundaries instead of image grids.

From xRef Attach

xRef's are External References.

To make an External Reference into a Hatch, you simply make a Hatch design in another drawing and then save the drawing.

Following that, use the SUPERHATCH command, and pick “xRef Attach…” from the Super Hatch Window.

In the Windows Explorer Window that appears, pick the Hatch drawing you created.

All you have to do after that is pick an insertion point and hit ENTER.

Summary

As you just saw that AutoCAD is quite flexible to allow you to make hatch patterns directly using Superhatch and also with hatch code.

Both methods can be used to make hatches but the hatch code offers you more flexibility as the patterns can be transferred easily and can be customized by changing just a few lines in the hatch code.

Which of the methods did you use often or planning to use for making custom hatches?

Don’t forget to let me know in the comments below.


Disclosure: Our content is supported by readers like you. We might earn a commission from affiliated products you buy from links placed on our website without any extra cost to you. This does not influence our content recommendations or editorial process. Learn more about our affiliate process here.

About the Author

Jaiprakash Pandey is the published author of “Practical AutoCAD book” by Packt publication he is also an Autodesk AutoCAD certified professional and Autodesk expert elite community. He has been delivering CAD training to corporate clients for more than 8 years and his clients include Steel, Power, Automobile industries and also government organizations, fortune 500 companies and the military.

Continue Learning...

Learn CAD and engineering tools for free

Get all the free courses and eBooks with lifetime access. Also, get a certificate when you finish the courses.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}