Please enable JavaScript to view this site.

TerraScan User Guide

Navigation: Batch Processing Reference > Macros

Run a macro on selected files

Scroll Prev Top Next More

Run a macro on selected files

Not Lite, Not UAV

A macro can be executed on selected files. You select a number of input files and optionally, additional transformation and/or file storage settings. When the macro is executed, the application loads one input file at a time, executes the macro steps on the points extracted from the input file and, if applicable, writes the results into an output file.

The input files can be in any format that TerraScan supports. Thus, the command provides a possibility to apply processing steps in batch mode to files that are not supported in TerraScan projects, such as text files.

After a macro has been executed on loaded points, the Macro execution window appears. It shows a report that lists for each input 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.

To run a macro on selected files:

1. Select On selected files command from the Run pulldown menu in the Macro dialog.

This opens the Run Macro on Files dialog:

run_macro_on_files

2. Click Add to add files to the list of files to process.

This opens the Select files to run macros on dialog, a standard dialog for opening multiple input files.

3. Select files and click Open.

You may continue with step 2 to add additional files.

4. Define additional settings in the Run Macro on Files dialog, if applicable.

5. Click OK to start the process.

SETTING

EFFECT

Add

Add files for processing.

Remove

Remove selected files from the list of files to process.

Input format

Definition of the input file format. The list contains all binary and text formats that are implemented in TerraScan as well as formats defined in File formats / User point formats category of TerraScan Settings. Implemented file formats are usually recognized automatically.

Input projection

Projection system of the input data. Click on the >> Button to open the Browse for Projection System dialog. The dialog provides a search option for projection systems as well as a list of all implemented systems. In addition, any user-defined projection systems are included in the list.

Active projection

Projection system of the processed data. Click on the >> Button to open the Browse for Projection System dialog. The dialog provides a search option for projection systems as well as a list of all implemented systems. In addition, any user-defined projection systems are included in the list.

Transform

Additional transformation applied to the output files. The list contains transformations defined in Coordinate transformations / Transformations category of TerraScan Settings.

Process

The process execution method:

Complete file - each process imports one file, runs the macro task, and saves the result.

Limited count at a time - for each input file, maximum specified number of points are loaded at the time, processed and saved. Each input file has one corresponding result file, as the software appends points to result files if processing of an input is done in pieces. Suitable for processing huge input files not possible to load in computer RAM. This processing option cannot execute all tasks reliably, as the process is not cautious on points processed in other chunks.

Save As

Format of the output file(s). The list contains most of the binary and text formats that are implemented in TerraScan as well as formats defined in File formats / User point formats category of TerraScan Settings. Select Do not save all points option if there is a more selective output step included in the macro.

Directory

If on, you can specify the directory into which output files are written.

File name

If on, you can specify a name for the output file(s). You may include the #name Variable as part of the file name. This uses the name of the input file as name (or part of the name) for the corresponding output file. See File Name Variables for more information.

Extension

If on, you can specify the extension of output file(s).

Run using TerraBatch

If on, processing task is added to TerraDispatcher queue and executed by TerraBatch.

Fit view

View to fit after loading an input file: None, All, or any CAD file view specified by its number. Available only if TerraBatch is not used.

Update all views after loading

If on, all views are updated after loading an input file. Available only if TerraBatch is not used.

TerraScan User Guide   01.01.2024   © 2024 Terrasolid Ltd