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
- 350 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 652 GM Script Language
- 56 User Scripts
- 115 GPS Features
- 421 Projection Questions
- 835 Raster Data
- 1.4K Vector Data
- 6.7K Support
- 181 Announcement and News
- 939 Bug Report
- 562 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 579 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 244 How I use Global Mapper
- 110 Global Mapper Forum Website

