My department has a Python script that has two variations; one is to run automatically each night through server jobs and the second is to run manually on-demand. The Python script was configured with an ArcGISPro 2.9 APRX and works fine. The script includes several definition queries and is based off a map series printing out data from the utility network we have set up to a pdf file.
We just upgraded to ArcGISPro 3.3 and the script was updated to have V3 within (instead of V2) along with the APRX updated to that version. When either the automatic or manual script runs, however, the element for the page number becomes non-sequential, i.e. instead of Page 1 of 10, Page 2 of 10, etc. it becomes Page 9 of 10, page 3 of 10 etc.
I've tried several troubleshooting steps like using the Page Number element provided by 3.3 instead of the one from 2.9 in our layout and updating our script back to having V2 instead of V3 to no avail. I just wanted to see if anyone else had a similar issue.
Thanks!
I don't have any experience upgrading from 2.9 to 3.3, but I am currently writing scripts to automate layouts in ArcGIS Pro. You mention that you are using the Page Number element, is this the Sort Field? There is also a 'Sort Ascending' property that can be set to True.
I'd check first to see if there is a field in the utility network data that can be used as a Sort Field.
This is an excerpt of a script I wrote recently:
ms = arcpy.cim.CreateCIMObjectFromClassName('CIMSpatialMapSeries', 'V3')
ms.enabled = True
ms.mapFrameName = map_frame_name
ms.startingPageNumber = 1
ms.currentPageID = 1
ms.indexLayerURI = layer_URI
ms.nameField = "Sheet_Name"
ms.sortField = "Sheet_Num"
ms.sortAscending = True
ms.scaleRounding = 1000
ms.extentOptions = "BestFit"
ms.marginType = "Percent"
ms.margin = 10
"Sheet_Name" & "Sheet_Num" come from the layer's attribute table and are sorted in order based on "Sheet_Num"