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!