Assistance Needed for Creating a Custom Hatch Pattern (.PAT) in AutoCAD

Assistance Needed for Creating a Custom Hatch Pattern (.PAT) in AutoCAD

ishaq03
Advocate Advocate
1,855 Views
19 Replies
Message 1 of 20

Assistance Needed for Creating a Custom Hatch Pattern (.PAT) in AutoCAD

ishaq03
Advocate
Advocate

Hi Everyone,

I need to create a custom hatch pattern (.PAT file) in AutoCAD that follows a specific brick pattern with defined dimensions.

- How can I create a new .PAT file manually?
- What is the best way to define line spacing and dashes?
- Are there any Autodesk tools or plugins that simplify this process?

I have tried defining a .PAT file in Notepad but need help with spacing and alignment Imasharing the file here. Any guidance or sample patterns would be appreciated.

Thanks in advance!

0 Likes
Accepted solutions (2)
1,856 Views
19 Replies
Replies (19)
Message 2 of 20

Moshe-A
Mentor
Mentor

@ishaq03 hi,

 

This kind of hatch is not so complicate to code, acad.pat (acadiso.pat) has a bunch of patterns like BRICK or AR-* that do bricks, take a look there to get some ideas.

 

Moshe

 

0 Likes
Message 3 of 20

_gile
Consultant
Consultant
Accepted solution

Hi,

If the final hatch have to look like this:

_gile_0-1741789345189.png

You can use the following code:

*ishaq03, custom bricks,
0, 0,0, 0,255
90, 0,0, 0,30, 15,-240
0, 0,15, 0,255
90, 15,15, 0,30, 15,-240
0, 0,30, 0,255
90, 0,30, 0,10, 5,-250
0, 0,35, 0,255
90, 0,35, 0,30, 15,-240
0, 0,50, 0,255
90, 15,50, 0,30, 15,-240
0, 0,65, 0,255
90, 0,65, 0,30, 15,-240
0, 0,80, 0,255
90, 15,80, 0,30, 15,-240
0, 0,95, 0,255
90, 0,95, 0,30, 15,-240
0, 0,110, 0,255
90, 15,110, 0,30, 15,-240
0, 0,125, 0,255
90, 0,125, 0,30, 15,-240
0, 0,140, 0,255
90, 15,140, 0,30, 15,-240
0, 0,155, 0,255
90, 0,155, 0,10, 5,-250
0, 0,160, 0,255
90, 5,160, 0,10, 5,-250
0, 0,165, 0,255
90, 0,165, 0,30, 15,-240
0, 0,180, 0,255
90, 15,180, 0,30, 15,-240
0, 0,195, 0,255
90, 0,195, 0,30, 15,-240
0, 0,210, 0,255
90, 15,210, 0,30, 15,-240
0, 0,225, 0,255
90, 0,225, 0,30, 15,-240
0, 0,240, 0,255
90, 15,240, 0,30, 15,-240

To create Hatch patterns I use this schematic diagram:

_gile_1-1741789643172.png

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 4 of 20

Kent1Cooper
Consultant
Consultant

[Just bear in mind that a Hatch pattern definition will not be able to include the infill shading in your sample drawing, not even if it were all the same color.]

Kent Cooper, AIA
0 Likes
Message 5 of 20

Sea-Haven
Mentor
Mentor

Writing a make pline outline is feasible as you have rules about the way the rows are made. But a big task but doable. Its a up left up right etc in patterns. I can see if the 120 is different then a new outline, or even as shown by @_gile multi rows. Or it may be as simple as explode a rectang of the hatch, and then use xtrim to removes linework outside of rectang. Hopefully then using bpoly will make a new boundary around the shape, which can have a solid hatch.

 

Gave it a try on a random shape, saved the hatch thanks to @_gile exploded the hatch and used extrim. Sort of got there. Tried making a new outline. But bpoly does not like gaps so some of the tile trims did not join correctly for making the shaded background. So need to think more. 

SeaHaven_1-1741830174792.png

SeaHaven_2-1741830223305.png

 

 

 

 

 

0 Likes
Message 6 of 20

ishaq03
Advocate
Advocate

@_gile 

I sincerely appreciate your help in providing the hatch pattern. Your support has been valuable, and I truly thank you for sharing it.

I would like to request a small modification—please adjust the pattern dimensions as per the CAD file I am sharing. The drawing is in meters, and it is important that the hatch pattern match the exact dimensions specified in the CAD file.

Additionally, there is no need for infill shading—only the pattern should be adjusted as per the required dimensions.

I am attaching both the CAD file and an image for reference. Your assistance in this matter would be greatly appreciated.

Looking forward to your kind support

ishaq03_0-1741842532307.png

 

0 Likes
Message 7 of 20

ishaq03
Advocate
Advocate

@_gile 

I sincerely appreciate your help in providing the hatch pattern. Your support has been valuable, and I truly thank you for sharing it.

I would like to request a small modification—please adjust the pattern dimensions as per the CAD file I am sharing. The drawing is in meters, and it is important that the hatch pattern matches the exact dimensions specified in the CAD file.

Additionally, there is no need for infill shading—only the pattern should be adjusted as per the required dimensions.

I am attaching both the CAD file and an image for reference. If any other Autodesk representative can also assist with this request, I would highly appreciate the support.

ishaq03_1-1741842887578.png

 

0 Likes
Message 8 of 20

_gile
Consultant
Consultant

@ishaq03  a écrit :

@_gile 

I would like to request a small modification—please adjust the pattern dimensions as per the CAD file I am sharing. The drawing is in meters, and it is important that the hatch pattern matches the exact dimensions specified in the CAD file.


I wrote this pattern according to the dimensions of the first DWG you provided.

To get a hatch with the "new dimensions", you can simply scale hatch to the fiftieth (0.02).

If you want to re-write the pattern, simply scale all dimensions the same way, replacing 255 with 5.1, 30 with 0.6, 15 with 0.3, 240 with 4.8, and so on...

*ishaq03, custom bricks,
0, 0,0, 0,5.1
90, 0,0, 0,0.6, 0.3,-4.8
0, 0,0.3, 0,5.1
90, 0.3,0.3, 0,0.6, 0.3,-4.8
; ...


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 9 of 20

ishaq03
Advocate
Advocate

Can you provide the full code as per the new dimension please?

0 Likes
Message 10 of 20

_gile
Consultant
Consultant

@ishaq03  a écrit :

Can you provide the full code as per the new dimension please?


I'm here to help people learn, not to do their work for them.

You're certainly capable of writing this code on your own using the information I've provided.

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 11 of 20

ishaq03
Advocate
Advocate

@_gile 

Thank you for previously providing the .PAT file codes. I appreciate your support.

I would now like to create a custom .PAT file similar to the pattern shown in the attached image. and drawing The pattern consists of:

  • 8 big rows, followed by
  • 1 small row, then
  • 4 big rows, followed by
  • 2 small rows

This drawing is in meters, and I request that the pattern dimensions be followed exactly as per the attached drawing

.

ishaq03_0-1741935660511.png

 

0 Likes
Message 12 of 20

Sea-Haven
Mentor
Mentor

I only have one question is the outer boundary like I posted in image above ? Or must it always have the 1/2 brick/tile missing ? Ie a diagram/detail.

 

You need to look at what @_gile has provided and look for a repeating pattern of lines. Then you can make a 5 6 7 8 rows etc.

 

The only other way is after you answer my question is to make the patterns with as many rows as you want and the size of the rectangs is use an Array multiple times. Have done a 2 line array not hard to do. 

 

Do 8 rows 15x30, do 2 rows 5x10 and so on. Fit to a shape.

0 Likes
Message 13 of 20

_gile
Consultant
Consultant

If you do not want to learn how to create your own hatch pattern despite the examples I provided, you can use a more flexible way with a single simple bricks hatch pattern to hatch different boundaries with the corresponding scale.

*SMALL_BRICKS, 0.1 x 0.05 bricks
0, 0,0, 0,0.05
90, 0,0, 0.05,0.05, 0.05,-0.05

_gile_0-1741943671385.png

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 14 of 20

ishaq03
Advocate
Advocate

@_gile 

I understand your point, but I would like to apply the hatch without specifying the scale manually. Could you please provide me with a full code for this? I know I might be troubling you, but I will focus on learning after completing this task."

0 Likes
Message 15 of 20

richard_387
Advocate
Advocate

I would have thought that it would be more incentive to learn to code now, because you seem to be altering dimensions daily.

 

@_gile has provided excellent instructions and a very valuable schematic diagram.

 

pavers.PNG

0 Likes
Message 16 of 20

Kent1Cooper
Consultant
Consultant
Accepted solution

Maybe I shouldn't "do your homework" for you, but it looked like an interesting challenge, what with the asymmetry of the single & double small-brick rows at unequal spacings.  This seems to work, in limited testing:

 

*TEST ; specialty masonry/tile coursing
0, 0,0, 0,1.95
0, 0,.15, 0,1.95
0, 0,.3, 0,1.95
0, 0,.45, 0,1.95
0, 0,.6, 0,1.95
0, 0,.75, 0,1.95
0, 0,.9, 0,1.95
0, 0,1.05, 0,1.95
0, 0,1.2, 0,1.95
0, 0,1.25, 0,1.95
0, 0,1.4, 0,1.95
0, 0,1.55, 0,1.95
0, 0,1.7, 0,1.95
0, 0,1.85, 0,1.95
0, 0,1.9, 0,1.95
90, 0,0, 0,.3, .15,-.15,.15,-.15,.15,-1.2
90, 0,.9, 0,.3, .15,-.2,.15,-.15,.15,-1.15
90, .15,.15, 0,.3, .15,-.15,.15,-.15,.15,-1.2
90, .15,1.05, 0,.3, .15,-.2,.15,-.15,.15,-1.15
90, .05,1.2, 0,.1, .05,-.65, .05,-1.2
90, .1,1.85, 0,.1, .05,-1.9

 

Make sure the file ends with a blank line, not with the last line of pattern definition, and if you put it in a file on its own, that the file and pattern names match.

Kent Cooper, AIA
0 Likes
Message 17 of 20

_gile
Consultant
Consultant

@Kent1Cooper

I like the way you've handled the vertical lines.

 

What's going to happen when there's nothing but demand for ready-cooked fish and no fishermen to supply it?



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 18 of 20

Sea-Haven
Mentor
Mentor

I like the @_gile idea of one hatch pattern, using areas of correct height, but change the values to something @ishaq03 can maybe get his head around about scaling hatch patterns. This is a simple ratio pattern. A scale of 200 will draw a brick 200x100.

 

 

*SMALL_BRICKS, 1 x 0.5 bricks
0, 0,0, 0,0.5
90, 0,0, 0.5,0.5, 0.5,-0.5

 

 

0 Likes
Message 19 of 20

ishaq03
Advocate
Advocate

@_gile @Kent1Cooper 


I sincerely appreciate the time and effort you have taken to create the .pat file according to my requirements. Your expertise and guidance have been invaluable in resolving my issue, and I truly appreciate your willingness to help.

Thank you once again for your support and for sharing your knowledge.

0 Likes
Message 20 of 20

richard_387
Advocate
Advocate

Now that time has passed and you have/have not been able to create your own hatch pattern, I would proffer my effort.

 

Since there has to be a blank last line of a pattern definition, I prefer to type an asterisk (*) there to show the extra line.

 

*ishaq03a, custom pavers,
0,0,0,0,3.9
0,0,.3,0,3.9
0,0,.6,0,3.9
0,0,.9,0,3.9
0,0,1.2,0,3.9
0,0,1.5,0,3.9
0,0,1.8,0,3.9
0,0,2.1,0,3.9
0,0,2.4,0,3.9
0,0,2.5,0,3.9
0,0,2.8,0,3.9
0,0,3.1,0,3.9
0,0,3.4,0,3.9
0,0,3.7,0,3.9
0,0,3.8,0,3.9
90,0,0,0,.6,.3,-.3,.3,-.3,.3,-2.4
90,0,1.8,0,.6,.3,-.4,.3,-.3,.3,-2.3
90,.1,2.4,0,.2,.1,-1.3,.1,-2.4
90,.2,3.7,0,.2,.1,-3.8
90,.3,.3,0,.6,.3,-.3,.3,-.3,.3,-2.4
90,.3,2.1,0,.6,.3,-.4,.3,-.3,.3,-2.3
*

 

0 Likes