Skip navigation
All Places > TBC Macros and Extensions > Blog
1 2 3 Previous Next

TBC Macros and Extensions

31 posts

This macro will compute the elevation difference between each point in a linestring and the computed elevation of a specified corridor. The elevation differences are used to create a polyline in the profile view of the corridors alignment. A vertical offset can be applied.


This macro is handy when doing pavement resurfacing. The computed lines would then show the difference between the surveyed location and the design elevation at each station. From there you can then easily see in the profile view where you have to make vertical adjustments. After adjusting the template or the vertical alignment, then delete the old computed lines and run the TML again.


Gary Lantaff

TML - Explode Lines

Posted by Gary Lantaff Jan 14, 2020

This macro will explode the selected lines into individual segments. Each segment can be converted into a new line or only break into new lines whenever the deflection angle between segments exceeds specified angle.


There is also an option to relayer the new linework based on where the exploded segment was in the original line. This option only applies if the original line was closed.


This is ideal for breaking up CAD and PDF cross-section data in preparation for conversion into 3D lines, which saves hours of painstaking work and makes selecting data easier and faster in the 3D View.


Gary Lantaff

TML - Increment Text

Posted by Gary Lantaff Jan 14, 2020
Use this macro for many things, including labeling cross-sections imported from PDF where the text in the PDF is absent (replaced with polylines that look like text, but are not text). Often PDF files have text drawn as polylines, rendering the text useless for station labels and grid labels (for offsets and elevations).

The TML allows you to specify the text style, layer, text height, etc. and then specify a start value and an increment (like
station 0 with an increment of 100), and then rapidly click all of the section zero offset line end points to place station text on the cross-sections which can then be used to convert them into stored cross-sections or 3D lines. The "Template Text" defines how the text is computed. Using just "{}" will convert the compute value to a string without any decimal precision. If you want to include more precision, specify the number of decimals inside the "{}" text. For example, "{2}" would format the computed value with 2 decimal places.
If you want the computed value to be formatted as a station, use "{s}" for the "Template Text". Any extra text in the "Template Text" will just be included in the result. For example, in the attached image, the "Template Text" included the "Sta " text.

This macro is kind of like simple feature coding. It creates lines by joining selected points where the feature code name is the same. The points are sorted by station from a reference alignment. If the station difference between points is larger than the "Max segment length", then a new line will be started (leaving a "gap").



This macro will move selected points so that they fall exactly on even stations (if the move distance is less than the specified station tolerance).

There is also an option to move selected points to a specified station (as long as current computed station is withen the "station tolerance" of specified station).


This can be handy if you import points that are expected to be at the same station but due to roundoff (or survey measurement accuracy), the stations are a bit "off". If you then use those points in a surface, the computed cross-section may contain extra nodes due to the way triangles are computed.


Gary Lantaff

TML - TrackLineEdge

Posted by Gary Lantaff Jan 14, 2020

This macro can be used to connect the outside edges of linework (as computed from the selected reference alignment). Each node in every selected line has its station and offset computed. The min and max offset values at each computed station is then used to create a linestring connecting the edges.


This is usually used to connect 3D cross-section linework in order to produce surface models.   


This macro is helpful in cases where you have lots of points to key in based on their station and offset values.  The station and elevation support the "Auto-Advance" option. If "Auto-Advance" set on the station field, when user presses the "Apply" button (usually by pressing "Enter"), then the focus returns to the offset control. 


Use TmlStatus to download the latest version of the macro.


The macro does have one option. By default, the macro creates normal points (same as using the CreatePoint command). If the "Create Dependent Points" checkbox is checked, then points that remember their station and offset values are created. In this case, updates to the alignment used to create the points would cause the points location to be updated.


Gary Lantaff

TML - Voice Commands

Posted by Gary Lantaff Dec 2, 2019

If you want to play around using your voice to execute TBC commands, just run TMlStatus and download the macro VoiceCommand. The macro is being provided "as-is" (but it's fun to play with)


It's actually a simple macro that loads every TBC command into the default speech engine of windows. I tested it using Windows 10 but it should work with older versions. The default voice input device is used and there are no voice settings defined in the macro.


When the speech engine hears a "match", it calls a method in the macro and the macro starts that command. 


Four other "commands" are added to the command list.

1) "OK" will cause the default accept button to be "pressed"

2) "Cancel" will cause the default cancel button to be "pressed". This is true even when the button label says something else (like "Done" or "Close")

3) "Tab" will cause the focus to move to the next control.

4) "Shift Tab" will cause the focus to move to the previous control.


The macro only looks for TBC commands. It can not be used to fill in the data for any control  (so you can't say "12.5" and expect the number to be filled in)


When the command starts up, you should see a small window that defines the command options.

The slider can be used to specify how close to a match the voice command needs to be in order to execute the command. The default is 0.80 (80 percent). Only matches higher than this tolerance will be executed.


If you want to disable the voice recognition but leave the command running, you can uncheck the "Enable voice commands"  checkbox. 


If the "AutoStart" checkbox is "checked", then the macro will start when TBC starts.


If you speak a command the speech engine doesn't recognize, then you will see;

               "Rejected: [<cmd>]" in the commands window.

If you speak a command the engine matches to one of the commands in TBC, then the window shows the name of the command and the match confidence. If the confidence is greater than the match tolerance defined using the slider, then the command will be executed.


Some commands are not enabled all the time. If you speak the name of a command that is not enabled, the command is ignored.


Have fun....

The macro ComputeLotSetback (available using TmlStatus) will compute a lot setback line using user specified setback distances. 

First, define the setback offsets for each part of the lot (front, back, left, right). There is another side setback offset used in the special case where the frontage is tangent to one of the sides (usually corner lot). Once the lot setbacks have been defined, you can hide this section by collapsing this group. Just click on the ^ icon.


There are two options to select the lot boundary. If the lot boundary is already defined as a closed lines, then you can just pick it.  Otherwise, use the "Select lot boundary lines" option to select all the bounding lines and then pick inside the  lot. The lot boundary will then be computed. 



Following two images show the results of using the macro. Image on left is before computing the setback lines. Image on right shows the computed setback lines in white. Each time you pick a lot, the setback line is computed.


The nearest lines on the lot boundary is assumed to be the frontage line so it's important to pick near the frontage.



The macro can optionally also compute a "lot pad" placed at the setback distance.


First check the "Draw Pad" option and define the pad size.

If the "Auto" option is selected, the pad is computed and placed when the lot setback line was computed. 


In this case, where along the frontage line you pick effects the pad location. If you pick near the left end of the frontage line, the pad will be aligned with the direction of the left line in the lot (first image below). If you pick near the right end of the frontage line, the pad will be aligned with the direction of the right line (last image below). If you pick in the center section of the frontage line, the pad will be aligned with the average direction of the side lines. (center image below)

If the "Auto" option not used, then you can define the direction of the pad and slide the computed pad along the computed offset distance.

Peter Kistler

Nudge Line

Posted by Peter Kistler Oct 22, 2019

The Nudge Line TML allows you to quickly move / offset an existing line.  This is useful for resolving vertical surfaces. For example importing curb and gutter lines will typically be exactly on top of one another. Creating a surface from these lines will generate flagged surface due to the vertical surface.  Nudge will allow you to ever so slightly move / offset a line resolving the vertical issues.


The TML does not just do a simple move on the existing line. A simple move would not work for curved line segments. The offset line is computed internally (vertical data is not modified). The offset coordinates and curve information are applied to the original line. 


Nudge Command UI

  • Select the line to be modified
  • Select which direction (right or left) to move the line.  If you have TBC 5.2 or later you will see a "dancing arrow" to indicate the direction of the line.  (Run the Show Direction TML to specify settings for the dancing arrow)
  • Set the amount to move / offset (Nudge) the line
  • Press "Apply" to nudge the line.  You can press Apply multiple times if you want to increase the offset.


NOTE. This is intended for very small adjustments of the line. Some assumptions are made internally that may not be valid if the line is nudges numerous time or by a large amount.

Peter Kistler

Quickly Reverse Line

Posted by Peter Kistler Oct 22, 2019

Simple command to allow the user to quickly reverse the direction of a Linestring or CAD 3D Polyline without having to go into Edit.

FYI, If you have TBC 5.2 or later you will seeing a "dancing arrow" on the line which indicates the direction of the line.


Reverse Line Command UI

  • Select the line to modified.
  • Press OK or click on the line again to reverse the line
Peter Kistler

Corridor Cut Sheet TML

Posted by Peter Kistler Oct 7, 2019

The Corridor Cut Sheet Report is a Rockpile Solutions TML created to provide cross section based reports for corridor models for use by field staff as a way to check and validate highways construction. The report will generate a node list at defined corridor stations; split into Right Side and Left Side nodes ordered from Centerline outwards; and display the information in a compact or fully detailed format.

Corridor Cut Sheet TML screen snap

Command documentation is at 


If you would like a trial version of the TML, email


Corridor Cut Sheet can be downloaded, installed, and updated using TMLStatus

The Adjust Linestring Elevation, AdjustLSElevation, TML allows you the modify the elevation of a portion or all of a given linestring. 

After selecting the linestring to be modified, the portion of the linestring to be modified needs to be specified. The available options are:

  • All - The elevation of every node in the linestring will be modified
  • Start to Location 1 - The elevation of every node from the beginning of the linestring to the specified location will be modified.  The details of the about the Locations are below.
  • Location to End - The elevation of every node from the specified location to the end of the linestring will be modified. 
  • Location 1 to Location 2 - The elevation of every node from Location 1 to Location 2 of the linestring will be modified. 


Location refers to the distance along a linestring. This is sometimes referred to as the station or chainage value.  When the location is not at either end of the linestring, an extra node is inserted 1 mm before or after the specified location. This is done to avoid vertical segments within the linestring that can lead to issues with modeling and computations.


The last set of information to specify is the new Elevation value(s). There are 3 options to choose from:

  • Undefined - The elevation on the specified nodes will be removed.
  • Single Elevation - The elevation on the specified nodes will be set to the given Elevation value.
  • Interpolate - The elevation is interpolated using the 2 given values and computed for every specified node between the specified locations


AdjustLSElevation can be downloaded, installed, and updated using TMLStatus.  AdjustLSElevationis a Licensed TML and is included in the CAD Toolbox. If you would like to try this or any Rockpile Solutions TMLs, just send an email to asking for a trial or demo license.

Peter Kistler

TML - AffixName

Posted by Peter Kistler Sep 12, 2019

AffixName is a TML written by Rockpile Solutions used to Add and / or Remove a prefix or suffix from the name of selected objects.  Most of the time the name automatically assigned to an object especially during import is insufficient. Having written several importers over the years, it is hard to come up with a generic set of rules to name object intelligently.  The picture below is a good example of generic rules used during import of the utility information contained in a LandXML file.  The problem is how to easy change the name to something that makes a little more sense.  This is where AffixName comes in.


Naming issues from importing data


AffixName allows you to Remove the beginning and / or end of an object's name and replace it with a prefix and / or suffix that makes more sense to your situation.  You do not have to have both Add and Remove functionality to run the command. You are allowed to just Add or just Remove portions of the object name.  If you do chose to run both Add and Remove simultaneously, the Remove functionality is executed before the Add functionality.


AffixName screenshot


AffixName can be downloaded, installed, and updated using TMLStatus.  AffixName is a Licensed TML and is included in the CAD Toolbox. If you would like to try this or any Rockpile Solutions TMLs, just send an email to asking for a trial or demo license.

Peter Kistler

TML - TMLStatus

Posted by Peter Kistler Jun 20, 2019

TMLStatus is a TML written by Rockpile Solutions to manage registered TMLs from within Trimble Business Center. It allows you to find registered TMLs and easily install and / or update them. 

The link TMLStatus will download the TMLStatus installation program. This is the only thing you need run outside of Trimble Business Center. By providing this as an installation package, you are free from having to download, navigate, install, and unblock the files needed to run TMLStatus.

All of the latest versions of Trimble TMLs are registered as well as TMLs written by Rockpile Solutions. To install or update a TML, check the box next to the TML you are interested in. You can select more than one and they can be from different providers / authors. 

Once you have made all of your selections, press the Update button.  TMLStatus will retrieve the selected TMLs and install the latest version on your system. TMLStatus will automatically "Unblock" the TML if it is required, a step that is easily overlooked if you manually download and install a TML. Lastly, it will let you know if you need to restart TBC to access the TML.


The Author column within TMLStatus indicates the person or company that produced the TML. The Installed version indicates the version currently installed in TBC.  The Latest Version indicates the latest version registered with Rockpile Solutions.  The Status field is a quick indication in a TML is up to date or not.


The Licensed column will indicate if a license is required to run the selected TML.  TMLStatus itself does not require a license to run. To run a Licensed TML, you will need to have a Trimble Connect account and be registered with Rockpile Solutions.