Macro File

Macros are Lava scripts and as such they have the file extension .lava .

Collecting text output from the Report Window

The following example collects any text output that has been produced by the Distance option (under the Analyse > Details submenu) and displays it in the Vulcan Console tab of the Report Window. In this case, the total length has been collected.

use Macro; 
RunMenu('ANL_DETAIL_DIST','abort', 
   "POINT_INTERACTIVE_SET", 
   "POINT_CANCEL", 
   "FINISH")|| die "Macro mismatch while running ANL_DETAIL_DIST\n"; 
my @lines = GetReportWindow();
my ($length) = $lines[1] =~ /Total length =\s*(.*?)\s*Plan/i;
print "got $length\n";

Setting the active window

The following example opens a symbol and swaps back to the Primary Window.

Use Macro; 
RunMenu('SYMBOL_OPEN','abort',
    sub {PanelResults ("Open Symbol", 
        "Symbol name" => "3D-Maptek", 
        "button_pressed" => "ok"
        ); }, 
   "FINISH")|| die "Macro mismatch while running SYMBOL_OPEN\n"; 
SetActiveWindow("PRIMARY");