Select to view content in your preferred language

issue with deleteItem(map)

527
3
12-05-2024 01:16 AM
DavideBollo
Emerging Contributor

Hi everyone, i created a simple map switcher in python and I put it in a toolbox script.

the script receives as input:

  1. aprx project;
  2. map name to be deleted (from aprx project);
  3. input mapx with the new map;
  4. pagx exporting checkbox;
  5. exported pagx path.

The script performs the following operations:

  1. Project backup;
  2. Deleting target map;
  3. Loading new map;
  4. Renaming new map as deleted one;
  5. Optionally export layout as pagx file with new map.

If executed in "stand alone" from windows shell, the script works perfectly but, if inserted in a toolbox script, launched from ArcGIS (in a blank project) the execution remains stuck at the deleteItem command.

Why? I can't find any reason.

Somebody can help? (script and validation attached).

Thank you in advance.

Tested with ArcGIS Pro 3.3.1 and 3.4
Windows 10 Pro for Workstation
22H2 build 19045.4894

0 Kudos
3 Replies
jameslogan5
New Contributor

Seeing a similar issue in a Python script tool run from Toolbox. Trying to programmatically remove extraneous map objects from the workspace before the script completes. Did you find a solution?

0 Kudos
DavideBollo
Emerging Contributor

what do you mean with "extraneous map objects"?
no solution right now...

0 Kudos
DavideBollo
Emerging Contributor

update...


I tried deleting all the layers and then deleting the map...the result still the same: my process gets stuck on "deleteMap"...

 
 
 
0 Kudos