UNLOAD_LAYER unloading all instances
veddycent
Global Mapper User
Hi all,
I'm trying to unload a group via script but seen as there is no way of doing that (not that I'm aware of) I'm looping through the group and unloading each layer one by one. Unfortunately this closes every instance of that layer, even when the instances which are in different groups.
Here is the script:
I'm trying to unload a group via script but seen as there is no way of doing that (not that I'm aware of) I'm looping through the group and unloading each layer one by one. Unfortunately this closes every instance of that layer, even when the instances which are in different groups.
Here is the script:
LAYER_LOOP_START FILENAME="Group2<sub>*.shp"
UNLOAD_LAYER FILENAME="%LAYER_FNAME_W_DIR%"
LAYER_LOOP_END
This is the hierarchy structure:
Group1 - Start
---Shape file 1.shp
---Shape file 2.shp
---Shape file 3.shp
Group1 - End
Group2 - Start
---Shape file 1.shp
---Shape file 2.shp
---Shape file 3.shp
Group2 - End
After the script finishes all layers have been closed.
I haven't found anything in the documentation or on the forums, am I missing anything?
Regards
Ved
This is the hierarchy structure:
Group1 - Start
---Shape file 1.shp
---Shape file 2.shp
---Shape file 3.shp
Group1 - End
Group2 - Start
---Shape file 1.shp
---Shape file 2.shp
---Shape file 3.shp
Group2 - End
After the script finishes all layers have been closed.
I haven't found anything in the documentation or on the forums, am I missing anything?
Regards
Ved
Tagged:
Answers
-
Hello Ved,
Please give this a try:UNLOAD_LAYER FILENAME="Group2<sub>%LAYER_FNAME_W_DIR%"
I ran a quick test and it worked for me.
Cheers,
Bob -
I can't believe I hadn't tried that

Much appreciated!
Thank you!
Categories
- 13K All Categories
- 5.8K Features Discussion
- 351 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 652 GM Script Language
- 56 User Scripts
- 115 GPS Features
- 423 Projection Questions
- 837 Raster Data
- 1.4K Vector Data
- 6.7K Support
- 183 Announcement and News
- 944 Bug Report
- 565 SDK
- 1.2K Suggestion Box
- 3.8K Technical Support
- 583 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 246 How I use Global Mapper
- 111 Global Mapper Forum Website

