Relative paths for importing

I would like to be able to run a GM script that imports all of the files in the same folder of the script file.
For example; my script is located at C:\LIDAR\NAD_27\Geotiffs\BareEarth\script.gms
Once I load and run the script I would like to be able to import all files under the directory "C:\LIDAR\NAD_27\Geotiffs\BareEarth\

Ideally, I will be moving this script file to different folders (with same file/folder structure) and run them to execute the steps.
Changing the folder location everytime I move this script file to a new folder will not work as I am trying to automate the whole process of importing/processing LIDAR datasets.
I would appreciate any suggestions.

Best Answer

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,160
    Answer ✓

    The scripting reference, under the command DEFINE_VAR, has a list of built-in variables, which includes:
    %SCRIPT_FOLDER% - inserts the full path of the running script/workspace file. This will include a trailing slash. So a script 'C:\path\my_script.gms' would get 'C:\path\' inserted


  • kaankaan Posts: 12

    this is line  I am using to load files from absolute path.
Sign In or Register to comment.