Skip navigation
All Places > TBC Macros and Extensions > Blog
Gary Lantaff

TML - Adjust Area

Posted by Gary Lantaff Mar 18, 2019

This TML will slide a line perpendicular to a reference line until a specified area is computed. There is an option to create a polygon object (containing part of the specified boundary) or just a line.

 

 

The direction of the computed line is determined by which line is selected as the "Reference line". The reference line does not need to be a member of the boundary lines (but can be). This example has two boundary lines and an optional third line to be used as the reference line.

 

 

 

If the solid red line is selected as the reference line, the computed line will be the dashed red line (perpendicular to the red line). If the solid green line is selected as the reference line, the dashed green line will be computed.

 

TIP: If you pick at a control point of the line, the line is computed by pivoting about that location instead of computing a perpendicular line.

 

NOTE: I'm testing the "compile" option so the attached zip file contains a compiled python macro (with a file extension of *.pydll). Just place file in same location as TBC will look for both compiled and non-compiled versions.

 

As I said, this macro is being provided in a compiled form. Windows sometimes "blocks" files that are downloaded. You may need to "unblock" the file after copying it to the macros folder. If you get an error starting TBC after adding the macro, go to properties of the file (AdjustArea.pydll) and see if you need to unblock the file. (you will have a "Security" section at the bottom of the properties dialog). Just check the "Unblock" checkbox if it is present.

 

This TML will extract the materials assigned to a surface and create a legend. There are two styles of legends. (Examples shown below)

NOTE: This macro requires TBC version 5.0 (patch 1 - Released 1/18)

 

The TML allows the user to assign the text styles used for each part of the legend.

 

If any line or text from an existing legend is selected when the TML is started, the macro assumes that the user wants to edit the existing legend instead of creating a new legend.

 

If the "Include Material Layers" option is checked, 

 

If the "Include Material Layers" option is  not checked,  the legend will look like this;

Gary Lantaff

TML - Lines To AOI

Posted by Gary Lantaff Jan 16, 2019

This is a simple TML to create Takeoff AOI's from the selected lines. The name of the AOI is taken from the lines name property.

A number of customers have asked me for a list of possible TML developers that could do work for them to solve problems that they want resolved. At Trimble we strive to meet customer requirements, but like any organization we have limited resources and available bandwidth to do so. We developed the TML capability for this specific reason, if something is important enough to you to resolve that you are prepared to pay to get it solved in a timely manner, there are a growing number of people out there that can do TML development on TBC v5 or later to help you to solve your issues, independent of waiting for Trimble to solve the issue for you.

 

I thought that this was a good way to share that list and allow TML programmers offering programming services to represent themselves on this Blog Post.

 

I am going to just put a few names out there to start off with, if you are a TML Programmer please add a Post to this list giving the following information about yourself or your company. Feel free to promote what you have done in a Blog of your own, posting videos of your work and references as you see fit. You can link to your own Blog from the Post you make here. Please keep this list as a "Yellow Pages" of TML Developers and keep the posts here short and concise please.

 

Name

Location e.g. Colorado, USA

Company Name

eMail Address

Phone Number

Specialist Areas

 

e.g. If you are a specialist in Revit, Sketchup, AutoCAD C3D etc. please promote those specialist Areas so people can see more about you in the Blog Profile. Since you are a member of the Forum, you can update your User Profile and provide a Link to that if you want to also.

 

Whenever I see a request for a solution that we do not have and I don't feel that we will solve any time soon, I will point customers to this list as a reference.

 

Note: At this time we have no way to validate that an individual on this list is capable or skilled in the development of TMLs, only that they are self representing that they have the skill set to do this type of work - so we cannot guarantee the outcome of any engagement that you may have with a developer listed here. If you do work with one of the people on this list, and have success, please put a Like on their Blog Post here and then add comments to the programmers own Blog as to what they did for you and how you found working with them etc. 

 

Here is the starting List - Please add your profiles to this list and I will then edit the post here to remove you from this specific post.

 

Peter Kistler - peter@thekistlers.com (He is based in Colorado, USA)

 

Wyn Sleeman - wyn@sleemanuk.org (He is based in the UK)

 

Fernando Calvo - calvo@calvo-geospatial.com (He is based in Germany)

 

Dorthe Merete Larsen - dml@geoteam.dk (Based in Denmark)

 

Quan Mueller - quan.mueller@revenantsolutions.com (He is based in Colorado, USA)

 

Thanks

 

Alan Sharp

This TML will copy a layer group and all the layers (that have members) into a new layer group where the group and each layer is named the existing name with a prefix (or suffix). Just select the layer group and enter a layer/group prefix.

 

I have updated the macro to allow the "prefix" text to be place after the layer or layer group name. Just enter the "^" character for the first character in the name and the layer name will be first with the new text appended. So if "^-P2" entered for prefix text, the layer group would be named "old-name-P2"

 

There is also a checkbox to allow "replacing" the prefix text. In this case, the same number of characters contained in the prefix will be removed from the existing name. So if you wanted to copy a layer group named "P2-Road intersection line" to a group named "P3-Road intersection line", just enter "P3" for prefix and select the replace option. Note, this applies to all the newly created layer too.

 

The new layer group name is now displayed in the Textbox so it can be checked before pressing the "Ok" button.

After running cmd, the view filter will show the new group and all the layers.

Gary Lantaff

TML - SurfaceToGrid

Posted by Gary Lantaff Nov 29, 2018

This TML will compute grid locations from a specified surface and write either (or both) an *.xyz file or a *.csv file. This can be useful for reporting purposes or to reduce the number of points in a surface.

 

An optional boundary can be specified. In this case, only grid points located in the boundary are computed. If an *.xyz file is created, the user is giving the option to import that as a point cloud. If a simple file name is supplied (no path defined), the file will be created in the project subfolder.

 

 

An option to compute the grid based on an alignment is available. When this is checked, the UI changes a bit. The grid locations are computed based on the station and offset to the defined alignment.

 

There is also an option to compute delta elevation between the specified surface and another reference surface. In this case, the computed elevation is the difference between the two surfaces. When computing the delta elevation between the two surfaces, you can restrict the points to elevations that fall outside the defined tolerances. When using this option, a rough volume is reported (just using average grid size time delta elevation)

 

Gary Lantaff

TML - AssignNameFromLayer

Posted by Gary Lantaff Nov 29, 2018

This TML can be used to name line objects using the name of the objects layer. You just select the line to name and enter a name "mask". 

You specify the new name using a name mask. If "{L}" is included in the new name, the layer name will replace that. Using "{N}" will insert previous name. So if you enter something like " L={L} old={N}" you will get something like "L=MyLayer old=OldName"

If you just want the name of the object to be the layers name, use "{L}" for name mask. (don't add quote characters)

 

By default, lines with an existing name will be skipped but you can "uncheck" the "Ignore lines with a name" option and all lines will have their name assigned.

 

An option to add a text label at the mid-point of the line has been added. The text will be the line's new name.

 

Gary Lantaff

TML - OffsetSurface

Posted by Gary Lantaff Nov 27, 2018

The OffsetSurface TML is included in the TBC 5.0 install but I have updated it to include support for adding a clipping boundary while it copies the surface. The clipping boundary is optional. If you download this zip file, make sure you unzip it in the same folder as the macro installed with TBC (C:\ProgramData\Trimble\MacroCommands\Trimble)

Gary Lantaff

TML - FindSurfaceArea

Posted by Gary Lantaff Nov 4, 2018

Macro to find triangles inside area bounded by any surface breakline. The triangle planimetric and slope area are computed. The button "Create Text.." will bring up a dialog box allowing user to create a text label containing the computed areas. If you hold the "shift" key down, the areas are totaled.

 

Gary Lantaff

TML - VPI at Elevation

Posted by Gary Lantaff Oct 22, 2018

This simple TML will add a vertical PI at the specified elevation. If the linestring has more than one segment that intersects with the defined elevation, a VPI will be created at each intersection.

 

Gary Lantaff

TML - View Project Data

Posted by Gary Lantaff Oct 22, 2018

This TML is helpful for macro developers to explorer the object model of a TBC project file. The tree view displays every object found (starting at the top level "Project" object). When an object is selected, the bottom area of the window will report every interface defined for that object. You can also see the full "namespace" of each object. In the example shown, you can tell that the arc is defined in the Trimble.Vce.ForeignCad namespace. This is helpful when using the "Object Browser" view in Visual Studio.

 

Gary Lantaff

TML - 3D points to arc

Posted by Gary Lantaff Oct 22, 2018

This TML will create an arc in the plane defined by three 3D points. Coordinates 1 and 3 define the beginning and end of the arc. This command is useful when used with building scans and you want to create an arc from the scanned locations.

 

Gary Lantaff

TMLs - Start Here

Posted by Gary Lantaff Oct 17, 2018

TBC now supports command extensions using the python language. The python scripts are scanned when TBC starts and valid macro commands are added to the command list in TBC.

 

TBC scans for macros (the *.py files) in the folder C:\ProgramData\Trimble\MacroCommands or any folder below that. This makes it convenient to place all the macros from one source (user developed, 3rd parties, Trimble) in separate folders.

 

Note, the folder C:\ProgramData is typically a hidden folder. You can either turn on the display of hidden items in File Explorer or just enter the folder path in File Explorer. 

 

Any macros downloaded from the community (or created by the user) can be placed anywhere under the macro folder. You may find it convenient to create a folder named "Community" to store the macros downloaded from here. Another option is to store the macros in a folder named after the macro author. 3rd party developers of macros are likely to store their macros in a named folder location. If you download a compiled macro (extension of *.pydll), you may need to unblock the file (see last field in file properties)

 

 

When TBC is installed, a small set of macros is placed in a folder named Trimble in the macro folder. Feel free to open these files with a text editor to see how macro commands are added to TBC. It's best not to add any macros obtained from other sources to this folder.

 

Whichever method you use, just unzip the downloaded macro into a location under the macro folder and the next time TBC is started, it will find the new macro commands and add them to the command list.

 

Warning: If you install the same macro in multiple folders (under the macro folder) then you will get an error when TBC starts (see image). Just delete the duplicate macro file to stop this error from occurring again.

 

Gary Lantaff

TML - ConvertToDll

Posted by Gary Lantaff Oct 17, 2018

This macro can be used to compile a TML macro into a DLL. A compiled macro will have an extension of *.pydll.

 

A compiled DLL still needs access to the xaml file (if used) so include that if sending your TML to other users. See sample macro "QuickLine.py" for sample of how to embed the xaml source into the python source (so you would only need to send the pydll file)

 

TBC will find macros (the *.py files) if the file is located in the folder C:\ProgramData\Trimble\MacroCommands or any folder below that. This makes it convenient to place all the macros from one source (user developed, 3rd parties, Trimble) in separate locations. This macro is best placed in the top level folder (C:\ProgramData\Trimble\MacroCommands) as it searches for macros to convert from its location and sub-folders from there.

 

Just check the name of the macro you want converted into a DLL. This macro should be run before any other macro is executed. (If you have run a DLL macro, you can't use this command to update the DLL untill TBC is restarted)

 

Gary Lantaff

TML - InsertLineSegment

Posted by Gary Lantaff Oct 17, 2018

 

This TML simply lets you select a linestring (for now it only works with linestrings) and then pick a coordinate to insert into the line. The coordinate is inserted at the nearest segment of the line.

 

You can set the "AutoTab" feature (the blue icon) to control if command lops back to pick another linestring or lets the user pick additional coordinates for same linestring.

 

Now updated to allow elevations to be defined.

 

To try out the TML (assuming you have TBC version 5.0 or later), download the attached zip file and place the TML files in the macro folder (C:\ProgramData\Trimble\MacroCommands). Note, on some computers the C:\ProgramData folder is hidden. Just enter the path in File Explorer.