Custom Hatch Pattern

Custom Hatch Pattern

sneenanKFX38
Contributor Contributor
17,254 Views
14 Replies
Message 1 of 15

Custom Hatch Pattern

sneenanKFX38
Contributor
Contributor

Hi everyone! I am trying to create a custom glass hatch pattern and I was relatively certain I had it but I'm having difficulties. This is my first attempt so I figured I would try something simple but I can't seem to get things to line up properly. My code is

 

*Glass Hatch, glass hatch pattern
60, 0,0, 1.9077,2.5981, 2,-1.9077
60, 0.0434,0.5082, 1.9077,3.3043, 1.1845,-1.9077
60, 0.3077,0.1000, 1.9077,3.3043, 1.1845,-1.9077

sneenanKFX38_0-1703616060961.png

 

I'm trying to get the pattern above and I've gotten it to start well from the origin but then it becomes nonsensical lines. Any tips or thoughts are greatly appreciated!

 

 

0 Likes
Accepted solutions (1)
17,255 Views
14 Replies
Replies (14)
Message 2 of 15

TheCADnoob
Mentor
Mentor

I couldnt quite figure out what you had going on. The below definition works but I'm not sure it is exactly how you want it. 

 

*Glass Hatch, glass hatch pattern
60,0,0,2.5,4.3301, 2,-3
60,.0434,.5082, 2.5, 4.3301,1.1845,-3.8155
60,.3077,.1, 2.5, 4.3301,1.1845,-3.8155
60,0,2,2.5,4.3301, 2,-3
60,.0434,2.5082, 2.5, 4.3301,1.1845,-3.8155
60,.3077,2.1, 2.5, 4.3301,1.1845,-3.8155
60,2.5,2,2.5,4.3301, 2,-3
60,2.5434,2.5082, 2.5, 4.3301,1.1845,-3.8155
60,2.8077,2.1, 2.5, 4.3301,1.1845,-3.8155

 

The first digit is the angle

The next two are the origin XY of your first line

The next two are the offset origin XY of the second line. This is where the next line will begin

The last two are the lengths of on and off. Its like pen down pen up commands. In the first line it will draw a line for 2, then it will skip over and not draw the next 3 units of length. 

 

TheCADnoob_0-1703640420413.png

TheCADnoob_1-1703641652495.png

 

CADnoob

EESignature

Message 3 of 15

richard_387
Advocate
Advocate
Accepted solution

When starting out, it is difficult to see what is required for the hatch pattern definition and there are several individual rules that only apply to hatching. Perhaps my diagram of the various quantities might help.

 

Definition diagram.PNG

In the line definition, the first quantity is the angle of the line, and then the next two are the line's start coordinate (measured in World coordinate system). The next two quantities (I call the "sideways repeat", d and e) are measured along and perpendicular to the line. As each of your three lines repeat at the same amount, these quantities would be the same for each of the three lines.

The final two quantities (I call "in-line repeat", f and g) are also measured along the line. Whatever the length of the dash line, the overall length of the dash plus the space (f + g) will always be the same for this type of symmetrical hatch.

Finally, for a standalone file, the file name does not allow spaces. So you can save this file as Glass-AA (give it a unique name because there may be other glass hatch files around!)

*Glass-AA, glass hatch pattern
60, 0,0, 1.875,1.0825317847, 2,-3
60, 0.0434,0.5082, 1.875,1.0825317847, 1.1845,-3.8155
60, 0.3077,0.1000, 1.875,1.0825317847, 1.1845,-3.8155
*

 

And a picture of how the hatch looks

 

glass-aa hatch.PNG

Message 4 of 15

Kent1Cooper
Consultant
Consultant

Just as a point of graphic effect, I would aim for something a little less regimented-looking, without the "units" in perfectly horizontal and vertical rows and columns, for example like this:

Kent1Cooper_0-1703695802854.png

which is defined this way:
60, 0,0, 1.2,1.5, 2,-2.5
60, 0.04,0.5, 1.2,1.5, 1.2,-3.3
60, 0.3,0.1, 1.2,1.5, 1.2,-3.3

[And I couldn't imagine a reason for all those decimal places, for something like this.  Also, trailing zeroes do absolutely nothing for you in Hatch pattern definitions.]

 

EDIT:

Or even something closer to random-ish-looking:

Kent1Cooper_1-1703707699502.png

which takes two sets at different starting positions:

60, 0,0, 2.4,3, 2,-2.5
60, .04,.5, 2.4,3, 1.2,-3.3
60, .3,.1, 2.4,3, 1.2,-3.3
60, -.2,2.5, 2.4,3, 2,-2.5
60, -.16,3, 2.4,3, 1.2,-3.3
60, .1,2.6, 2.4,3, 1.2,-3.3

 

[And I remembered that leading zeroes before decimal points are also not necessary.]

Kent Cooper, AIA
Message 5 of 15

muhammad_nadeem
Participant
Participant

Can any one convert this coordinate to in a PAT file for hatch, consider coordinate from red line

Thanks

muhammad_nadeem_0-1761720417579.png

 

0 Likes
Message 6 of 15

TheCADnoob
Mentor
Mentor

@muhammad_nadeem wrote:

Can any one convert this coordinate to in a PAT file for hatch, consider coordinate from red line

Thanks

muhammad_nadeem_0-1761720417579.png

 


@muhammad_nadeem  Give this a try

CADnoob

EESignature

0 Likes
Message 7 of 15

TheCADnoob
Mentor
Mentor

*INSULATION,legname
72.758541,0.51,0.75,13.60143064,0.03293325,0.30364453,-30.06080837
254.577839,0.48,0.25,11.40170579,0.03324112,0.30083218,-29.78238573
75.963757,0.4,0.96,0.9701425,0.24253563,0.04123106,-4.08187457
142.125016,0.18,0.86,4.99923071,0.0877058,0.22803509,-11.17371917
180,0.31,0.86,0,1,0.13,-0.87
228.012788,0.4,0.96,12.04136517,0.07432941,0.13453624,-13.31908781
322.125016,0.82,0.14,4.99923071,0.0877058,0.22803509,-11.17371917
0,0.69,0.14,0,1,0.13,-0.87
48.012788,0.6,0.04,12.04136517,0.07432941,0.13453624,-13.31908781
75.963757,0.59,0,0.9701425,0.24253563,0.04123106,-4.08187457
37.874984,0.82,0.36,6.40252354,0.0877058,0.22803509,-11.17371917
0,0.69,0.36,0,1,0.13,-0.87
311.987212,0.6,0.46,1.41225888,0.07432941,0.13453624,-13.31908781
287.241459,0.51,0.75,16.76302226,0.03293325,0.30364453,-30.06080837
217.874984,0.18,0.64,6.40252354,0.0877058,0.22803509,-11.17371917
180,0.31,0.64,0,1,0.13,-0.87
131.987212,0.4,0.54,1.41225888,0.07432941,0.13453624,-13.31908781
105.422161,0.48,0.25,18.68151212,0.03324112,0.30083218,-29.78238573

CADnoob

EESignature

0 Likes
Message 8 of 15

drexworthy
Explorer
Explorer

Curious, is there a quick way to generate the coordinates from a series of lines?

0 Likes
Message 9 of 15

h_s_walker
Mentor
Mentor

@drexworthy do you have full AutoCAD?

If you do have you tried using the Express Tool Superhatch?

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 10 of 15

drexworthy
Explorer
Explorer

I have but I do not like how it functions.
I want to create a proper .pat 

0 Likes
Message 11 of 15

h_s_walker
Mentor
Mentor

@drexworthy I just googled "create .pat file from autocad drawing" and it came up with the following suggestion

You can also convert an existing block to a PAT file:

  1. Explode the block to lines or polylines.
  2. Move it near the origin (0,0).
  3. Export as DXF (R12/2000 format).
  4. Use a DXF-to-PAT converter to generate the .PAT file.
  5. Load it in AutoCAD as described above 

So then I googled "dxf to pat" and got loads of help

dxf to pat - Search

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

Message 12 of 15

drexworthy
Explorer
Explorer

Thanks @h_s_walker  I will give that a try.

0 Likes
Message 13 of 15

Kent1Cooper
Consultant
Consultant

@drexworthy wrote:

.... is there a quick way to generate the coordinates from a series of lines?


By "generate the coordinates" do you actually mean "generate a hatch pattern definition"?  Hatch patterns are not defined in terms of coordinates, except for the origin points of linesets relative to the overall origin.  They are defined in terms of angle, origin, offsets in two directions, dash length(s) and gap length(s).

Put "hatch pattern generator" into a web search -- lots of hits, including the HatchKit program that @hugha often uses to post patterns made from drawings here.

Kent Cooper, AIA
0 Likes
Message 14 of 15

drexworthy
Explorer
Explorer

Thanks @Kent1Cooper I will look into that.

And yes, I mean the hatch pattern definition.

0 Likes
Message 15 of 15

Kent1Cooper
Consultant
Consultant

@Kent1Cooper wrote:

.... the HatchKit program ....


Oh, but in connection with that specifically, see also >this recent Topic<.

Kent Cooper, AIA
0 Likes