Global Mapper v26.0

Script to generate DTM/DSM

How can I create a script to generate a DTM for the current view without requiring specific coordinates as an input?

I already have a script to generate a DTM for the entire area or within a specified polygon, but I want to make it so it automatically extracts the coordinates of the current view and generates the product accordingly. Here is the script I currently use to generate for the whole area:

GLOBAL_MAPPER_SCRIPT VERSION=1.00 

SET_OPT LIDAR_FILTER="NONE,2" 

GENERATE_ELEV_GRID ELEV_UNITS="METERS" GRID_ALG="BIN_MAX" GRID_BIN_SIZE="5" LAYER_DESC="DSM" NO_DATA_DIST_MULT="0" GRID_SAVE_TIN="NO" GRID_FILL_TO_BOUNDS="NO" GRID_FLATTEN_AREAS="YES" GRID_HEIGHTS_RELATIVE="NO" GRID_USE_CONSTRAINTS="YES" GRID_IGNORE_ZERO="NO" GRID_TYPE="ELEV" SOFT_EDGE_DIST="2"


Additionally, is there a way to assign a keyboard shortcut, such as F2, to instantly execute this script for quicker access? The closest I found is to run the script manually and then use the "Run Previous Script" shortcut.