200 AutoCAD Commands and Shortcuts PDF eBook

Download the free eBook containing fully categorized list of 200+ AutoCAD commands, shortcuts, function keys and more

IN THIS ARTICLE

How to make custom hatch patterns in AutoCAD

Last Updated: July 10th, 2023By Categories: AutoCAD

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.

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.

Learn AutoCAD right from scratch with video courses by published Authors

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.

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.

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

Xrefs 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.

Conclusion

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.

200 AutoCAD Commands and Shortcuts PDF eBook

Download the free eBook containing fully categorized list of 200+ AutoCAD commands, shortcuts, function keys and more

22 Comments

  1. Aaron October 4, 2022 at 1:47 am - Reply

    I have prepared a hatch pattern with three 45 degree lines. I would like each 45 degree line to have a different color. Such as your red horizontal and green vertical. However, when I add my sourcecad.pat to the pattern library in AutoCAD it only allows me to change the color for all the 45 degree angles simultaneously and add a background color to the hatch. Please advise…

  2. Brian Marsden April 15, 2022 at 10:39 pm - Reply

    Does not work in AutoCAD 2023, pasting your staircase pattern into notepad and saving it in the support folder will show the staircase pattern in the hatch preview but when I confirm the pattern I get an error:

    Bad pattern definition file:
    Missing parameter on line 5.

    Tried lots of changes to make this work but it won’t

  3. Ani July 15, 2021 at 11:08 pm - Reply

    Hello, what if the pattern I’m trying to create has a spacing in between and is staggered? I’m trying to create a Brick Veneer of the size 3-1/2″ x 11-1/2″ staggered 50% and has a spacing of a 1/4″ in between each brick. I initially followed these steps, which worked but is putting my rectangle stacked exactly on top of each other.

  4. Barbara Marik May 31, 2021 at 6:04 am - Reply

    Hi, how are you saving the Notepad files as “PAT” files. Notepad will not allow me to use that extension.

    • Martin June 3, 2021 at 7:44 pm - Reply

      I would suggest saving them as .txt or without any extension and after that renaming them to .pat in your file explorer.

  5. Wiam Becharef March 11, 2021 at 12:06 am - Reply

    Hello, i need urgent help on this matter.

  6. Daniel April 8, 2020 at 8:35 am - Reply

    CAN I TRIM A SUPERHATCH?

  7. David Perrings September 8, 2019 at 12:30 am - Reply

    i would like to leave a comment

    • David Perrings September 8, 2019 at 12:33 am - Reply

      so my question is how can i find out when this blog was posted ?

  8. Nagarajanjayam August 3, 2019 at 10:01 am - Reply

    HI,

    I am Nagarajanjayam, I request you that Could you upload video or .pat file for Hatch 30 angle and 60 angle Hatch pattern . I am working as piping Draftman and i am using Bluebeam revu software, In that , i need to import those patterns . so kindly upload or guide me how to create for 30& 60 degree inclined hatch pattern as .pat file .

    Advance Thank you

  9. luis baron May 28, 2019 at 6:59 am - Reply

    thank you very much.. couldnt have done it without you

  10. Curly March 18, 2019 at 9:36 am - Reply

    Beauty, thanks mate!
    Is there any way to make the linetype ByLayer? Currently it’s coming up as continuous. I need to explode the hatch and change it for what I’m trying to achieve.

  11. Dezignext Technologies February 28, 2019 at 7:05 am - Reply

    Really like this tutorial as this is a common training question. Well written

  12. Joseph Moore February 7, 2019 at 7:30 am - Reply

    Question. I’ve created a custom hatch and saved it. When I insert my hatch it shows up with missing lines. But if I explode the hatch the missing lines reappear. Any thoughts or suggestions?

  13. Sunny February 4, 2019 at 12:26 pm - Reply

    Can you please send me a video of AUTOCAD basics ๏ผŸ

  14. Dayananda November 26, 2018 at 1:58 pm - Reply

    Very Useful Indeed! Thank You

  15. dhillipabi November 23, 2018 at 1:07 pm - Reply

    It’s really nice work

  16. Umesh tripathi November 20, 2018 at 2:18 pm - Reply

    Sir please provide vedio about this topic because in written pattern not understanding properly.

  17. Kyaw Zin November 20, 2018 at 5:35 am - Reply

    Nice work! Can I use alphabets in custom hatch pattern?
    So that hatching may result in alphabetical pattern.
    Thanks a lot.

  18. Maria November 20, 2018 at 12:32 am - Reply

    When would one use an image as a hatch?

  19. Mintu November 19, 2018 at 10:53 pm - Reply

    Amezing Very nice tutorial indeed …………………..
    Thanks a lot

Leave A Comment