Please enable JavaScript to view this site.

TerraScan User Guide

Navigation: Batch Processing Reference > Macros

Run a macro on a project

Scroll Prev Top Next More

Run a macro on a project

Not Lite, Not UAV

Most often, macros are executed on a TerraScan project. See Working with Projects for detailed information about projects in TerraScan.

You can run a macro on all or selected blocks of a project. A macro can be performed by either using TerraScan or TerraBatch.

After a macro has been executed on a project in TerraScan, the Macro execution window appears. It shows a report that lists for each block binary file the amount of loaded points, the executed macro steps and a return value, as well as the amount of saved points, if applicable. The return value can be the amount of points that has been effected by the macro step or another value specifying the result of the macro step. If a processing step failed, the line in the report appears in red color. A definition of the return values for many processing functions is given in Section Function Prototypes. The macro report can be saved as text file using the Save as command from the File pulldown menu or printed using the Print command from the File pulldown menu in the Macro execution dialog.

If a macro is executed in TerraBatch, the report of the macro execution is saved as text file in the TerraBatch installation folder, such as c:\terra64\tBATCH\reports. One report file is created for each block included in the macro process. The TerraBatch User Guide describes in detail the processing workflow of TerraBatch.

To execute a macro(s) on blocks:

1. (Optional) Select blocks in the TerraScan Project window if you want to execute the macro on selected blocks only.

2. Select Run macro command from the Tools pulldown menu in the TerraScan Project window.

This opens the Run Macro on Blocks dialog:

run_macro_on_blocks

3. Define settings and click OK.

This executes the macro on all or selected blocks. The application loops through the blocks, loads the corresponding block binary file, performs the macro step(s) and, if applicable, saves the modified points back to the block binary file or into another output file.

SETTING

EFFECT

Process

Blocks to process: All blocks or Selected blocks.

Macros

Macro files to execute. Macros are executed in top-down order.

Neighbours

Distance from the boundary of the active block for which the application loads points from neighbouring blocks. See Section Neighbour points for more information.

Save points

Method of saving the points after processing:

Do not save - points are not saved to the original block binary files. Use this, if the macro includes an output step which writes the results into new files.

Write over original - original block binary files are overwritten.

Temporary copy & replace original - a copy is created for each processed block binary file. TerraScan moves the copies at the end of the macro process to replace the original block binary files.

Create new copy - a new file is created for each processed block binary file. Additionally, the project file is copied to the directory where the new binary files are stored. The original block binary files are not changed.

Temporary

Directory for storing the temporary copies of the block binary files. This is only active if Save points is set to Temporary copy & replace original.

Write to

Directory for storing the new block binary files. This is only active if Save points is set to Create new copy.

Run using TerraBatch

If on, the macro is performed by TerraBatch. See Section Run macros in TerraBatch for more information.

Fit view

Views to fit after loading a block binary file: None, All, or any CAD file view specified by its number.

Update all views after loading

If on, all views are updated after loading a block binary file.

Neighbour points

Neighbour points should be loaded in addition to the points of the active block, if the macro includes certain processing steps. For these steps, the application needs information from neighbouring areas in order to process the points along block boundaries correctly and to ensure smooth transitions between blocks. The steps include:

all classification steps that include a search radius parameter or rely on points within a local environment around a point, such as Air points, Closeby points, Isolated points, Low points, Below surface

Ground, Hard surface and Surface classification

Model keypoints and Contour keypoints classification

Buildings and Walls classification

Assign groups, Fix border groups, Classification routines for groups, Split groups by class

Compute distance, Compute normal vectors, Compute section parameters, Compute slope arrows

Cut overlap

Export lattice

Find paint lines, Find poles, Find wires

Fix elevation

Scale intensity

Search tie lines

Smoothen points, Thin points

Vectorize buildings

The distance for loading neighbour points measured from the block boundary outwards depends on the processing step. If only a local environment around a point is required, a small area of neighbour points may be enough. For ground, keypoints, or building classifications, the maximum edge length of buildings in the project area can be used as estimation for the neighbour points area. For other processing steps, the parameters of the step may also provide some good estimation, such as lengths, distances, radius values, etc..

If the distance for loading neighbour points is too small, the result of a macro step may not be satisfying because of lacking information from the surrounding of a block. If the distance is too big, there is a risk that too many points need to be loaded for processing a block. This may lead to memory issues and long processing duration, in worst case to the failure of the macro (step) execution.

Points from neighbour blocks do not belong to the active block and are not saved with the active block points.

TerraScan User Guide   01.01.2024   © 2024 Terrasolid Ltd