The function of this document is to provide information on the TSL hsbViewhatching is used for the generation of hatches.

12 August 2019
  Minutes read


The function of this document is to provide information on the TSL hsbViewhatching is used for the generation of hatches. HsbViewHatching is used to create hatches in

  1. 2d-Section objects in model space
  2. Element viewports
  3. Autocad viewports
  4. Shop drawing viewports

Definition of hatch properties

The properties of the hatch are defined in the form of a map object. (*xml), this can be found in your hsbCompany\TSL\Catalog
This map object can be defined in an xml file and will be saved by the TSL as a map object in the dwg. Each time the TSL is inserted, it will use the map object saved in the dwg. If this map need be changed, via a new definition in the xml, then a new xml can be imported using the TSL “hsbTslSettingsIO”. This is also located in the DACH ribbon under hsbBSP->hsbEinstellungen-> TSL Einstellungen.

Figure 1 Location of TSL for the import of xml file

This way the map defined within the xml can be imported

Figure 2 Import of the xml file

At the beginning, if no map object or no xml file is found, a default map will be generated by the TSL and used.
This map can be exported into an xml file via a custom command “Export Xml”.
The command will only be available if no xml file is found in the directory.
The exported xml can serve as a muster xml to be extended further by the user.
In the xml one can define different hatch patterns and their properties.
A muster of an xml is shown below.


Figure 3 Muster of the xml for the definition of the hatch patterns

Below we give a brief description of the properties of the hatch map defined in the xml.

“Name” indicates the name of the hatch pattern. It can be left blank; it does not influence anything.

“Anisotropic” takes the values 1 or 0 and indicates if the hatch pattern is isotropic or anisotropic. If the hatch pattern is defined as isotropic or 0 then properties of the first orientation will be used for each direction. If the hatch pattern is defined as anisotropic or 1, then each direction will use the corresponding orientation.

In “Material[]” one can define a list of materials for which the hatch is applicable. At the figure above, the first hatch pattern “Hatch1” is applied for default materials “*” and material “FI”. So all entities with material “FI” or a material that is not defined in the xml, will use the hatch pattern “Hatch1”.

In “Orientation[]” one can define a list of maps of “Orientation” for the three orientations “X”, “Y” and “Z”.

A map “Orientation” includes the following properties.

“Name” will take the values “X”, “Y” or “Z” and shows the direction for which this map is applied to.

“Pattern” can take a string of an Autocad hatch pattern e.g. “ANSI31”

“Color” takes an integer and defines the color of the hatch. -2 will indicate that the hatch will use the color of the entity being hatched. -1 or 0 will indicate that the hatch will use the color of the layer or block of the TSL.

“Transparency” defines the transparency of the hatch.

“Angle” defines the orientation angle of the hatch.

“Static” takes the values 0 or 1. It determines the way the hatch scaling factor is calculated. For “Static” =1, the hatch scaling factor ScaleHatch is calculated as


For “Static” =0, the hatch scaling factor ScaleHatch is calculated as

ScaleHatch = Scale*dmin

Where dmin is the minimal dimension of the envelope rectangle of the plane profile to be hatched. So, for larger plane profiles the ScaleHatch will be adapted. The calculated ScaleHatch cannot be smaller than ScaleMin

“Scale” is the scaling factor when calculating “dynamic” scaling for “Static”=0.

“ScaleMin” is a minimal scaling value. The calculated ScaleHatch cannot be smaller than “ScaleMin”.

Description of each of the four cases where the tsl is applied to

After the TSL has been fired the properties dialog box is shown. The three properties are “Section level”, “Section depth” and “Global scaling factor”. Depending on the space the TSL will be inserted the user will select either a 2d-section object or an element viewport or an Autocad viewport or a shopdraw viewport.

2d-section objects in model space

For 2d-sections the TSL allows for a graphical control of the properties “Section level” and “Section depth”. After the TSL has been inserted, 2 grip points are available for the modification of these properties.
Figure 4 Grip points for the manipulation of properties in model space
When the “Section depth” is larger than zero, 2 bounding lines will be shown. The region between the 2 bounding lines defines the region of objects that will receive hatching. The value of “Section level” is measured with respect to the section line. The value of “Section depth” is defined with respect to the “Section level”.


Figure 5 Visualization of the bounding region
If the “Section depth” =0, the 2 grip points will be located on the same line and the bounding lines will not be visible. When the grip points are moved, the properties “Section level” and “Section depth” will be updated representing the values defined by the 2 grip points. The same is said when the properties “Section level” and “Section depth” are modified. The grip points will be updated so they represent the values defined in the properties.

Element viewports

TSL can be inserted at a viewport. At viewports, the “Section level” is measured based on the top point. In element viewports, will be considered for hatching all entities contained within the element viewport. At the figure below are shown the 2 most extreme points “ptMin” and “ptMax”. The “Section level” is measured with respect to the top point “ptMax”. The bounding box in red color defined from the “Section level”=300 and “Section depth”=1000 is also shown below.

Figure 6 3d visualization of the bounding region for viewports

The generation of the hatch at the element viewport is shown at the figure below


Figure 7 Generated hatch

Autocad viewports

Non-element viewports are similar to element viewports. They have 2 custom commands “Add Entity(s)” and “Remove Entity(s)”. When one of the two commands is selected, the model space will be activated and the prompt for the selection of entities will be shown in the command line. The selected entities will be considered for hatching within the region defined by the “Section level” and “Section depth”. At the figure below is shown the hatch at an Autocad viewport where the selected entities to be considered for hatching are the two left vertical beams and the horizontal beam.


Figure 8 Generated hatch at the selected entities in an Autocad viewport

For isometric views, the rule is the same, the isometry will be projected at the layout and the area within the region will be hatched. At the figure below is shown in red the bounding box defined by “Section level” and “Section depth”. Parts of the objects available for hatching that are located within the bounding box will be hatched


Figure 9 Bounding box for an Autocad viewport with isometric view


Figure 10 Generated hatch at an isometric view of an Autocad viewport

shopdraw viewports

Viewports at shop drawings are similar as the viewports in layout. Below is shown the shop drawing of a beam and the hatching for each of the viewports.

Figure 11 Generated hatch at the shop draw viewports