How can I define my own hatch patterns?

Tekla Structures
Not version-specific
Tekla Structures
hatch
pattern
hatching
fill
Environment
Not environment-specific

Question:

I would like to add my own hatch pattern to the available hatch patterns for drawing fills. How can I do this?
 

Image
Hatches.png

These hatches are from Default environment.

Answer:

You will need to edit the hatch_types1.pat file. The default location for this file is ...\TeklaStructures\<version>\Environments\common\inp. For some environments it is also located in ...\TeklaStructures\<version>\Environments\<environment>\inp. In these cases XS_INP  has been used to define the folder from which this file is read. For example, in the US Imperial environment the following line exists in env_US_imperial.ini:

set XS_INP=%XSDATADIR%environments\usimp\inp\

The file can also be read from a firm folder defined by XS_FIRM but the location defined by XS_INP takes priority, so a firm folder file will not be read if a file of the same name also exists in the XS_INP folder. So the hatch pattern file name have to be changed, meaning only the number, for example not to use hatch_types1.pat, but use hatch_types2.pat instead and the file must be located directly under the XS_FIRM folder (example C:\XS_Firm)!


Structure of the .PAT file

A pattern definition starts with a header line.
This starts with a * immediately followed by a name of no more than 31 characters (no spaces allowed). The name can be followed by an optional description for the pattern. 

For example:

*CHECKERED,Checkered plate

A pattern with this header will appear in Tekla Structures as CHECKERED.

 

 

Image
Checkered.png



The lines following the header each define a line used to create the pattern. For a simple hatching that consists of evenly spaced parallel lines only one line is required but more complex patterns can require several lines.

The format of each line is as follows

Angle,  X-Origin,  Y-Origin,  X offset,  Y offset,  Dash1,  Dash2,,,DashN

A pattern is inserted into a Tekla Structures drawing at a particular point (the pattern's origin), which will be a point on the boundary of the fill area. The area inside the boundary is then filled by infinitely repeating the lines defined in each row of the pattern definition along the local x and y axes of the line. Each row in the definition can define a line with different local x and y axes and different starting points relative to the pattern's origin. In this way a pattern can be developed consisting of any number of lines drawn in any direction.

 

Example

For this example, we consider the CHECKERED pattern, which is defined as follows:

*CHECKERED,Checkered plate
0, 0.0, 0.0, 25.4, 25.4, 25.4, -25.4
90, 12.7, 12.7, 25.4, 25.4, 25.4, -25.4


In TeklaStructures create a polygon in a drawing. The first point of the polygon will be the origin of the hatch pattern. Double-click on the polygon to open its properties and set the scale in x and y to 1 and the angle to 0.
In the example below the vertex surrounded by a red circle is the first point of the polygon and hence the pattern origin.

 

 

Image
Polygon.png



Consider the first line of the pattern definition.
The second and third values define it's X-Origin and Y-Origin. In this case both are zero so this line starts at the pattern origin. The angle is 0 so the line is oriented along its x axis. Since we have set the Angle of the fill to zero in Polygon properties this also corresponds to the global X axis of the drawing.

The third and fourth values (X offset and Y offset respectively) determine where copies of the line are placed.

The first copy of the line will start 25.4 units in X and 25.4 units in Y from the origin.

This is illustrated by the picture below, where the black arrows represent the displacement from one line to the next and the blue and red arrow represent the X and Y components of this displacement.

 

Image
graph1.png


The 6th and 7th values are optional. If a line definition contains only 5 values the line is a continuous line with no gaps. Dashed lines are created by adding pairs of positive and negative values. The positive values represent the length of displayed sections of the line and the negative values represent the length of hidden sections. So in this case the line consists of a line segment of 25.4 units followed by a space of 25.4 units.

This is illustrated below.

 

Image
graph2.png



The second line is rotated by 90 degrees so it is running away from the pattern origin along the global Y axis of the drawing.

Its X-Origin is 12.7 and its Y-Origin is 12.7. This is illustrated below.

 

Image
graph3.png


 

Was this helpful?