BILT Speaker

BILT Speaker
RevitCat - Revit Consultant
Showing posts with label define. Show all posts
Showing posts with label define. Show all posts

Sunday, 17 February 2019

Stretcher Bond Hatching in Revit

A few years back I posted a description of how to create a complex custom hatch pattern for Revit - that example was for repeating octagons.  Since then I have often needed to quickly create much simpler patterns such as stretcher bond elevation views for bricks, blocks and tiles.  The Octagon pattern was quite complex and it still takes a while to get your head around the logic - so here is a much easier to follow set of examples:


Pattern Definition Format

The pattern file is a text file, saved with a '.pat' extension.
Definition of units (important for metric):
;%UNITS=MM

Each pattern definition has an * prefixed header :   a title and description separated by a comma
      *Stretcher 400x200,   400mm x 200mm stretcher bond
Drafting or Model definition:
       ;%TYPE=MODEL
Each line repeat (in the pattern) is described in one row of text, with comma delimited format.  eg:
0,     1200, 1000,         0,  1000,       400,  -1500

  • Angle  = angle of line from horizontal measured in an anti-clockwise direction
  • Origin x = horizontal distance of start of line from setout point (always orthogonal)
  • Origin y = vertical distance of start of line from setout point (always orthogonal)
  • Shift u (x axis of line) = offset distance of start of repeat line measured parallel to start of line
    (in the direction of the line,  ie. to match the angle).  The Shift values are measured from the start of the line, not from the setout point.
  • Shift v (y axis of line) = offset distance of start of repeat line measured perpendicular to start of line
  • Pen down = length of solid line measured in the direction of the line (optional - it draws a continuous line if omitted)
  • Pen up = length of gap in the line before the next segment of the line starts repeating (measured in the direction of the line);  is always a minus value.  (optional - as per pen down)
NB. I have labelled the shift directions as u & v (not x & y, as Autodesk labels them) because the directions relate to the axis of the line, not the whole pattern - so a vertical line would have a u offset measured vertically (labelled as x direction by Autodesk, which is confusing).

Stretcher Bond Hatching Definitions


A typical staggered tile pattern (stretcher bond) consists of :
  • a series of continuous horizontal lines at regular spacing;
  • Short vertical lines that run between alternate horizontal lines, at a spacing equal to the length of the brick/block/tile
  • Another set of short vertical lines that run between alternate horizontal lines, at a spacing equal to the length of the brick/block/tile - but these are typically offset horizontally by half a length and vertically by one pattern height.
These should almost always be defined as MODEL patterns, as they are meant to be dimensionally correct on the surface of the material.

There are actually two ways to define this:

Option 1 - separate definitions for the two vertical lines

*Stretcher-450x150-1/2,      450 x 150 1/2 stretcher bond
;%TYPE=MODEL
0,         0,0,           0,150
90,       0,0,           0,450,        150,-150
90,    225,150,      0,450,        150,-150

The first row defines the horizontal lines
0,         0,0,           0,150
  • The lines are at zero degrees (horizontal)
  • The first line starts at 0 offset from the origin, both x and y (0,0)
  •  The repeat has a shift of zero horizontally (x or u), and 150mm vertically (y or v) from the line origin (0,150),
  • The next repeat is the same values (0,150) from the start of the previous repeat. 
  • The line is continuous, as the are no pen up/down values




The second row defines the first set of vertical lines
90,       0,0,           0,450,        150,-150
  • The lines are at 90 degrees (vertical )
  • The first line starts at 0 offset from the origin, both x and y (0,0)
  •  The repeat has a shift of zero vertically (u) , and 450mm horizontally (v) , from the line origin (0,450)
  • The next repeat is the same values (0,450) from the start of the previous repeat. 
  • The line is segmented, 150mm solid, 150mm gap (pen up/down 150,-150)
The v shift in this instance is horizontal, perpendicular to the line, with a positive value to the left of the line origin (same as pattern setout point in this case). 
  • As the pattern is symmetrical, it makes no difference if the v shift value is positive or negative
  • Seen below in context, the pattern repeats in both directions from the origin:








The third row defines the second set of vertical lines
90,    225,150,      0,450,        150,-150
  • The lines are at 90 degrees (vertical )
  • The first line starts at 225mm x offset from the origin, and 150mm y offset from the origin (225,150) - ie. half a tile along and one tile up.
  • The repeat has a shift of zero vertically (u) , and 450mm horizontally (v) , from the line origin (0,450)
  • The next repeat is the same values (0,450) from the start of the previous repeat. 
  • The line is segmented, 150mm solid, 150mm gap (pen up/down 150,-150)
 


Option 2 - one definition for both vertical lines

*Stretcher-450x150-1/2,      450 x 150 1/2 stretcher bond
;%TYPE=MODEL
0,         0,0,           0,150
90,       0,0,       150,225,        150,-150


The first row defines the horizontal lines as per previous method
0,         0,0,           0,150

The second row defines the vertical lines
90,       0,0,       150,225,        150,-150
  • The lines are at 90 degrees (vertical )
  • The first line starts at 0 offset from the origin, both x and y (0,0)
  •  The repeat has a shift of 150mm vertically (u) , and 225mm horizontally (v) , from the line origin (150,225)
  • The next repeat is the same values (150,225) from the start of the previous repeat. 
  • The line is segmented, 150mm solid, 150mm gap (pen up/down 150,-150)


  • As the pattern is symmetrical, it makes no difference if the u and v shift values are positive or negative
  • Seen below in context, the pattern repeats in both directions from the origin:


One Third Shift Patterns

The same principles can be applied when the bond is staggered by differing proportions.


Option 1 - separate definitions for each vertical line


*Stretcher-450x150-1/3,   450 x 150 1/3 stretcher bond
;%TYPE=MODEL
0,          0,0,         0,150
90,        0,0,         0,450,       150,-300 
90,    150,150,     0,450,       150,-300
90,    300,300,     0,450,       150,-300


 90,    150,150,     0,450,       150,-300

  • 90 degrees
  • 150mm x line origin, 150mm y line origin
  • Zero u shift repeat, 450mm v shift repeat
  • 150mm Pen Down, 300mm gap (Pen Up)




 90,    300,300,     0,450,       150,-300
  • 90 degrees
  • 300mm x line origin, 300mm y line origin
  • Zero u shift repeat, 450mm v shift repeat
  • 150mm Pen Down, 300mm gap (Pen Up)

Option 2 - one definitions for all vertical lines

*Stretcher-450x150-1/2,      450 x 150 1/2 stretcher bond
;%TYPE=MODEL
0,         0,0,           0,150
90,       0,0,       150,300,        150,-300
Horizontal shift (v) repeat has to be 2/3 of a tile (300mm)

As the joint offset is not half a tile, the same result can be achieved with a negative v shift repeat of -150mm:
0,         0,0,           0,150
90,       0,0,       150,-150,        150,-300



An offset by one third to the left could be achieved by a positive 150mm v shift:
0,         0,0,           0,150
90,       0,0,       150,150,        150,-300


Two Third Shift Patterns

Some patterns cannot have their vertical lines defined by only one row, as you can't define a consistent diagonal repeat.  Therefore you must have multiple rows for the vertical lines.

*Staggered-450x150-2/3, 450 x 150 2/3 stretcher bond
;%TYPE=MODEL
0,          0,0,        0,150
90,        0,0,        0,450,     150,-150
90,    300,150,    0,450,     150,-150








The direction of stagger can be changed with the x origin value:

*Staggered-450x150+2/3, 450 x 150 2/3 stretcher bond
;%TYPE=MODEL
0,          0,0,        0,150
90,        0,0,        0,450,     150,-150
90,    150,150,    0,450,     150,-150

Flemish Bond

More complex brick patterns require extra rows of definition:


*Flemish-240x86,     240 x 86 (Australian Brick size) Flemish stretcher bond
;%TYPE=MODEL
0,           0,0,         0,86
90,         0,0,         0,360,       86,-86 
90,      240,0,        0,360,       86,-86
90,        60,86,      0,360,       86,-86
90,      180,86,      0,360,       86,-86




You could continue this theme with increasing random looking patterns, but I'll leave that for you to figure out . . . . . .




Saturday, 27 June 2015

Defining Revit Custom Hatch Patterns

Over the years I have defined quite a few Revit custom hatch patterns, and each time I do it I get a headache!  It is usually about 6 months between each attempt at this so I pretty much have to learn it all over again each time.   The format for defining the hatch files (.pat) is so bizarre that it almost defies logic.  Almost, but not quite . . . .

The Autodesk help files have never changed much over the years, and just reading them gets me baffled each time.  So I decided to write my own help file that is actually understandable by human beings, so I can refer to in six months time.  And well, why not put it out there to see if anyone else finds it useful?  Of course there are now lots of  clever little hatch builder programs available, but sometimes you just want something quick and you may not have access rights to download and install that hatch builder.

For examples of stretcher bond brick or tile patterns refer to this post

The more complex example I am showing here is a series of octagons that are quite widely spaced - I originally created it to represent those 'tactile surface indicators' at the base and top of stairs.  The octagons do a pretty good representation of circles on a stair drawing.

The first step is to create a sample of the pattern using lines - say detail lines on a drafting view.  You probably need to show a couple of repeats in each direction - true octagons are simple to create using the 'Polygon Tool' with only two mouse-clicks.



When the octagon is repeated in a Revit pattern, it does not replicate the octagon shape - it actually treats each line as totally separate, and repeats those in two possible directions.  So in order to understand which lines are repeated where, I have colour coded them.  This pattern is based on a 1000 mm square grid with the space between each octagon exactly the same as the octagon width, which means that the orthogonal lines are repeated every 1000mm, exactly offset from each other - a very simple pattern.  The diagonal spacing between octagons is quite different to the octagon width - so the repeats of diagonal lines are much more complex . . . .

Pattern Definition Format

The pattern file is just a text file, saved with a '.pat' extension.
The overall file can have descriptions at the beginning;  it can also have an overall definition of units (important for metric):
;%UNITS=MM

Each pattern definition needs a header prefixed by an *:   a title and description separated by a comma
      *Octagons 1 x spaced,   1000mm spaced and width octagons
It also needs a type definition (Drafting or Model)
      ;%TYPE=MODEL

Each line repeat (in the pattern) is described in one line of text, with comma delimited format.  eg:
0,     1200, 1000,         0,  1000,       400,  -1500
  • Angle  = angle of line from horizontal measured in an anti-clockwise direction
  • Origin x = horizontal distance of start of line from setout point (always orthogonal)
  • Origin y = vertical distance of start of line from setout point (always orthogonal)
  • Shift u (x) = offset distance of start of repeat line measured parallel to start of line
    (in the direction of the line,  ie. to match the angle)
  • Shift v (y) = offset distance of start of repeat line measured perpendicular to start of line
  • Pen down = length of solid line measured in the direction of the line
  • Pen up = length of gap in the line before the next segment of the line starts repeating (measured in the direction of the line);  is always a minus value.
Notes.
  • The Shift values define the repeats in the direction perpendicular to the line.  The Autodesk help files mislead by calling them x and y values - I prefer to think of them as u and v values, which are not necessarily orthogonal.  The Autodesk help files completely omit to mention that they are measured parallel & perpendicular to the line.
  • The Shift values are measured from the start of the line, not from the setout point - another vital piece of information that the Autodesk help files neglect to tell you.
  • The pen down/up values effectively define repeats in the direction of the line.  They are optional.  If they are omitted, you get a continuous line
  • The pen down/up repeat is inconsistent with origin & shift because the coded value of Pen up is the distance from the end of the line to the start of the next - the repeat distance is actually the total of Pen down and (minus) Pen down.

Octagon Pattern Example

The horizontal lines (black)
Angle = 0
Start line x from origin = 1292.9
Start line y from origin = 1000
Shift u of repeat from line start = 0   (ie. it is a direct perpendicular offset)
Shift v of repeat from line start = 1000
Pen down = 414.2    (length of octagon side)
Pen up =   -1585.8   (distance to start of next octagon line from end of first)

0,   1292.9, 1000,         0,          1000,       414.2,  -1585.8


The vertical lines (blue)
90,  1000,    1292.9,     0,          1000,       414.2,  -1585.8

The 45° angle lines (red)
45,  1707.1, 1000,        1414.2, 1414.2,    414.2,  -2414.2

The opposite 45° angle lines (purple)
45,  1000,    1707.1,     1414.2, 1414.2,    414.2,  -2414.2


The -45° angle lines (green)
-45, 1000,   1292.9,      1414.2, 1414.2,    414.2,  -2414.2

The opposite -45° angle lines (orange)
-45, 1707.1, 2000,        1414.2, 1414.2,    414.2,  -2414.2

Pattern File
*Octagons 1 x spaced,
;%TYPE=MODEL
0,   1292.9, 1000,         0,          1000,       414.2,  -1585.8
90,  1000,    1292.9,     0,          1000,       414.2,  -1585.8
45,  1707.1, 1000,        1414.2, 1414.2,    414.2,  -2414.2
45,  1000,    1707.1,     1414.2, 1414.2,    414.2,  -2414.2
-45, 1000,   1292.9,      1414.2, 1414.2,    414.2,  -2414.2
-45, 1707.1, 2000,        1414.2, 1414.2,    414.2,  -2414.2


This needs to be saved as a '.pat' file type before it can be used in Revit.  It can be edited in a simple text editor like 'Notepad'.

Notes:
  • The angle for the last two could be 135° instead of -45°, but the measurement direction would then be in a backward direction, which could be confusing to figure out.
  • If the width and spacing of octagons are not the same, you would need to define two lines at zero and two at 90 degree angles (like the 45 degree line definitions).


I hope this saves me hours of grappling with the file format and help files next time I need to create a quick pattern in Revit.

For examples of stretcher bond brick or tile patterns refer to this post