- Please select -

How to Create a Custom Hatch Pattern in SolidWorks Electrical

Tips and Tricks Bill 1 June 2016

How to Create a Custom Hatch Pattern in SolidWorks Electrical

The hatch patterns provided with SolidWorks Electrical are defined in a “.pat” file.  It depends on the template used to create your project which one you will use.

  • If your project is based on an ANSI template the file is called “Tracecad.pat”.
  • If your project is based on any other template the file is called “Tracecadiso.pat”.

Both files can be found in the “C:Program FilesSolidWorks xxxxSolidWorks ElectricalSupport” folder.

To create your own hatch pattern you simply edit the appropriate file and add your definition.

The contents of the supplied Tracecadiso.pat file are shown below.

How to create a custom hatch pattern in solidworks electrical

Lines of text beginning with an * are the hatch pattern names.  They must end with a comma.

The other lines of text are the data lines.  Each line of text represents a line in the pattern.  As you can see, you can have more than one line in a pattern.  The lines of text contain numbers separated by commas.  They do not end with a comma.  The first five numbers are compulsory and are explained below.

  1. The first number is the angle at which the lines are drawn. 0° is horizontal.
  2. The second number is the X coordinate of the start point of the first line of the pattern.
  3. The third number is the Y coordinate of the start point of the first line of the pattern.

Note: 0,0 is the bottom, left corner of the pattern.

  1. The fourth number is the offset for the start of subsequent lines within the pattern.
  2. The fifth number is the spacing between the lines of the pattern

The sixth and following numbers are optional and describe the dash pattern of the lines themselves.  If they are absent, the line does not have a dash pattern, ie, it is a solid line.  If they exist, they work as follows:

  • If the number is positive, it is the length of the visible dash of the line.
  • If the number is negative, it is the length of the gap between dashes.
  • If the number is zero, a dot is inserted.

There are two requirements for this optional data:

  1. There must be an even number of entries.
  2. Every other number (all odd-numbered or all even-numbered) must be negative, hence, the other half of them must be all non-negative, i.e., positive or zeros.

The quantity of this optional data is arbitrary, ie, you can add as many as are required to define the dash pattern you want.

 

This might be easier to understand via some visual examples shown below.  Notice how the numbers in the pattern definition can be spaced out for easier reading, if required.

 

Example Pattern 1

 Pattern Definition

0,     0,0,  0, 10,  10, -5, 0, -5

45, 0,0,  0, 5,   2, -2

Resultant Pattern

How to create a custom hatch pattern in solidworks electrical

Pattern Explanation

The first set of lines:

  • are horizontal, ie, 0°
  • start at 0,0
  • subsequent lines are not offset
  • are 10mm apart
  • the dash pattern comprises a 10mm length of line, followed by a 5mm gap, followed by a dot, followed by 5mm gap and then the pattern is repeated

The second set of lines:

  • are at 45°
  • start at 0,0
  • subsequent lines are not offset
  • are 5mm apart
  • the dash pattern comprises a 2mm length of line, followed by a 2mm gap and then the pattern is repeated

 

 

Example Pattern 2

 Pattern Definition

0,     0,0,  2.5, 10, 10, -5, 0, -5

45, 0,5,  0,         5,   2, -2

Resultant Pattern

How to create a custom hatch pattern in solidworks electrical

Pattern Explanation

In the first set of lines, each line is now offset by 2.5mm.  Everything else is unchanged.

In the second set of lines the first line starts 5mm up the Y axis (vertically).  Everything else is unchanged.

 

Here are the supplied ANSI patterns:

ANSI31

How to create a custom hatch pattern in solidworks electrical

ANSI32

How to create a custom hatch pattern in solidworks electrical

ANSI33

How to create a custom hatch pattern in solidworks electrical

ANSI34

How to create a custom hatch pattern in solidworks electrical

ANSI35

How to create a custom hatch pattern in solidworks electrical

ANSI36

How to create a custom hatch pattern in solidworks electrical

ANSI37

How to create a custom hatch pattern in solidworks electrical

ANSI38

How to create a custom hatch pattern in solidworks electrical

About the Author:
Bill Murch
Technical Support Engineer
CSWP, CSWE, CDWP
Based in Sydney, Australia

Back to Tips and Tricks