How to Export and Import custom hatch pattern in AutoCAD

Generally you can export a drawing with its fonts, texture, materials, references, data links etc using e-transmit but unfortunately, it can’t export custom hatch pattern file (PAT) with the package and you have to add it in the package separately.

But if you did not receive a drawing with PAT file then you can export it from drawing as well using the method shown below.

Exporting hatch pattern

Let’s assume that you have a drawing with custom hatch applied in it with name ZIGZAG. In order to export that hatch, you need to create its PAT file. I am using a LISP routine in this tutorial to extract PAT file from drawing.

Download the LISP routine from this link

Extract it from the compressed package and paste it on the desktop. Also, make sure that your source drawing is copied to the desktop from which you want to extract hatch pattern.

Now open the drawing from your desktop and drag and drop lisp routine to the drawing as shown in the image below.

How to Export and Import custom hatch pattern in AutoCAD

Now type GETPAT on the command line and click on ZIGZAG pattern present in drawing. This pattern will be exported as ZIGZAG.PAT on the desktop. For some cases the file is exported to C:\Users\[user name]\Documents so if you are unable to find it on the desktop then look it there.

Importing hatch in your AutoCAD

Now you have this hatch pattern all you need to do is import it to your AutoCAD software, for this copy ZIGZAG.PAT file and paste it to support folder of the installation directory.

To locate support folder type OP on the command line then press enter, options window will pop up select files tab and expand “support file search path” tree there you will see the location of support file. See image below for reference.

How to Export and Import custom hatch pattern in AutoCAD

After pasting the file launch your software if it is already open then close it and launch it again. You will now find ZIGZAG hatch pattern among all the patterns, and you can use it just like other hatch patterns.


Some users are unable to use the original GETPAT.LSP file and they are getting this error

Command: GETPAT
Select hatch: ; error: bad argument value: positive 0

If that’s the case with you too then use this modified routine, all the steps are exactly the same you just need to close your older session of AutoCAD and start a fresh one to use it.


Thanks, Paul Turvill for providing access to GETPAT.LSP file, You can find more free LISP routines on his website

A big thanks to Cooper Francis for providing us access to this modified routine, you can get many free and premium Autodesk tools on his website

Get access to all Courses, eBooks and Downloads on SourceCAD

See details

About the Author:

I am a mechanical engineer and I have worked with Design, Manufacturing and Training industries but now SourceCAD is my full-time work and I use it to train students all over the world. I also train corporate clients and help them develop the skill set of their workforce. I am Autodesk AutoCAD Certified Professional and an Autodesk expert elite member. I am a regular contributor of AUGI World magazine and apart from SourceCAD I also develop AutoCAD video courses for Pluralsight and other E-Learning businesses.


  1. KammaBall September 6, 2018 at 10:16 pm - Reply


    I was just wondering if anyone had gotten a resolve to the error kamiel Lee was getting. I have encountered the same issue.

    Command: GETPAT
    Select hatch: ; error: bad argument value: positive 0

    I have searched everywhere and short of recreating a custom pattern from scratch to get a matching hatch pattern as in a drawing send from another individual, I have no solution. Would love to be able to have this command GETPAT to work.

    • Jaiprakash Pandey October 21, 2018 at 10:28 pm - Reply

      An updated routine is now added Kamma, check it in the article. It has been provided by Cooper Francis.

  2. Paul DeFelice September 3, 2018 at 3:40 am - Reply

    I followed the instructions but the first time I dragged the LSP file to my drawing I cancelled the operation before clicking “Load”. Now every time I drag the LSP file over I get an error message “File load cancelled” in Autocad command line.

    Any help would be appreciated.


  3. keerthana February 7, 2018 at 10:48 am - Reply

    i downloaded a file from bibliocad ,which had more than 50 hatch patterns,it was in hatch format only,i just renamed it with extension (.pat),i followed the same steps but ,it didnt work,what would be the reason????

  4. kevin January 31, 2018 at 2:09 am - Reply

    Thanks Jai!

  5. Anonymus June 29, 2017 at 9:05 am - Reply

    I found the .pat file, and I right clicked on it, and went into the Support File Search Path and tried to right click and paste, but it did not work.

    • Jaiprakash Pandey July 1, 2017 at 3:31 pm - Reply

      Do you have admin rights? make sure you have admin right before pasting the file.

  6. kamiel Lee March 27, 2017 at 9:39 am - Reply

    I got a recommendation for a Lisp named getpat.lsp to export AutoCAD’s hatch as a .pat. ( <- Lisp Code
    Many people seem to be using this Lisp well, but I have an error.
    Command: GETPAT
    Select hatch: ; error: bad argument value: positive 0
    I tested both versions of AutoCAD 2011-2017, but the results were the same. Also, no matter how I search, there is no advice to solve this problem.
    I have already spent too much time solving this problem. If you know the solution to this problem, please let me know.

  7. saleh tony March 21, 2017 at 1:43 am - Reply

    If the hatch pattern has curved elements then the output is not correct any suggestions

  8. Anonymous November 26, 2016 at 3:30 am - Reply

    Just wanted to say thanks! Client requested bespoke pattern for Revit model, exported and then imported from his CAD file fine. thanks!

    • Jaiprakash Pandey November 26, 2016 at 7:59 pm - Reply

      Welcome 🙂

  9. Anonymous November 11, 2016 at 4:13 am - Reply

    Worked like a charm. Automatically placed it in the directory. Thank you!

    • Jaiprakash Pandey November 11, 2016 at 8:48 pm - Reply

      I am Glad to know this 🙂

  10. Anonymous August 18, 2016 at 1:31 am - Reply

    thank you .they really help !

    • Jaiprakash Pandey August 20, 2016 at 6:07 pm - Reply


  11. Dan July 27, 2016 at 7:21 pm - Reply

    I have found the exported pat file. When I load this pat file back into AutoCad or Invertor the file cannot be read. Anyone else having this issue

    • Jaiprakash Pandey July 30, 2016 at 12:28 am - Reply

      Try copying content from PAT file and paste it in acadiso.pat file in support folder, don’t forget to take backup of the actual pat file before making any change.

  12. Anonymous January 19, 2016 at 7:13 pm - Reply

    oh, a follow up.. a day or two later I found the .pat file in a sub directory in the drawing location… so it might use some saved file directory in the registry… so, if you cant find it, do a search. it should be there.

  13. PatMac January 19, 2016 at 3:28 pm - Reply

    I had the same issue, couldn’t find the .pat file but the hatch became usable in the drawing so presumably has saved to the support file location. Magic!

    • Jaiprakash Pandey January 19, 2016 at 5:32 pm - Reply

      Sometimes exported PAT file is pasted in the documents folder also so its better to have a look there too. and if everything else fails you can search C drive with the name of custom hatch pattern to find the location where it is exported.

  14. chris December 18, 2015 at 10:06 pm - Reply

    Was just about to wblock out the hatch, when this time, I apploaded the .lsp file (versus your drag and drop method) and tried again. It now says it wrote the hatch to the .pat file, but I cant seem to find it. its not on the desktop, or in my .lsp directory, or in the orig dwg directory… so I’m stumped again. any idea where it may have put the .pat file? (btw way my .lsp directory is on our server. should I load it from the desktop?)

    • Jaiprakash Pandey December 20, 2015 at 9:58 pm - Reply

      Sometimes exported PAT file is pasted in the documents folder also so its better to have a look there too. and if everything else fails you can search C drive with the name of custom hatch pattern to find the location where it is exported.

      Article modified to address this issue please have a look at article again.

  15. chris December 17, 2015 at 9:02 pm - Reply

    This sounds great, but of course its not running on my Arch 2015 windows 10 autocad.
    Command: GETPAT
    Select hatch: *Cancel*
    Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
    Converting (command) calls to (command-s) is recommended.

    any ideas?

    • Jaiprakash Pandey December 18, 2015 at 11:32 am - Reply

      AutoCAD is not yet officially supported on windows 10 that could be one of the reasons, but if possible can you share your file containing hatch pattern or at least a drawing containing that hatch pattern only and I will export PAT file and send it to you.

      You can send files to

  16. andrew November 30, 2015 at 8:08 am - Reply

    thank you autodesk and also Jaiprakash for putting these on line .hope to learn more

    • Jaiprakash Pandey November 30, 2015 at 9:41 am - Reply

      Welcome Andrew, I am glad you are learning from these tips

Leave A Comment