Migrating tbx to atbx ArcGIS Pro 3.0 Export Map Series to PDF timeout

1015
3
08-09-2022 08:58 PM
Kaz
by
New Contributor II

Hi all, 

I am migrating a python script tool from ArcGIS Pro 2.8 to ArcGIS Pro 3.0 now that the organisation is upgrading. 

I followed this suggestion from Esri to 'copy and paste' the script from the .tbx to a new .atbx in a Pro 3.0 map document. I migrated all maps and layouts from the 2.8 document to the 3.0 document and ran the script tool. My first run was successful, but the second time I ran the script, ArcGIS Pro crashed. 

The difference between the 2 runs was that one of them was exporting a map series to PDF with only 4 maps, whereas my second run contained 14 maps in the map series. The script generated the PDF partially, but I can't open the PDF to see how far it got because the output file is corrupt. I also don't have any logs because ArcGIS Pro crashed. 

Has anyone else experienced this? Are there any changes in python methods or classes that I should be aware of in Pro 3.0? Code snippet below. 

 

AreaName = 'Area 1'
ActivityId = '12345'
layoutI = aprx.listLayouts("Investigation Layout")[0]
MS = layoutI.mapSeries # Access MapSeries
MS.refresh()
arcpy.AddMessage("14. Creating Investigation PDF...")
PDF_Name_I = "\Investigation - {0} {1}.pdf".format(AreaName, ActivityId)
MS.exportToPDF(output_path + PDF_Name_I)

 

 It's worth noting I can export the Map Series to PDF manually in ArcGIS Pro 3.0...

Thanks!

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

Are you sure that line 5 and 6 yields a valid path name?

Also, does the *.tbx tool run properly, see code example 4 in the mapseries help

MapSeries—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
Kaz
by
New Contributor II

Just updated the code, yes the path name is valid, the variables are created earlier in the script. 

Yes the tool still works in a *.tbx in Pro 2.8 and Pro 2.9, but it won't work in Pro 3.0 without moving it to *.atbx, and even then it is only working sometimes. 

0 Kudos
DanPatterson
MVP Esteemed Contributor

Tech Support is your best option.  They can examine the full script and examine the toolbox since nothing is obvious in the documentation regarding any changes made in 3.0


... sort of retired...
0 Kudos