Hello, writing a script to generate all the extents of a map series so they can be displayed in the extent map.
Here is my relevant code:
import arcpy
p = arcpy.mp.ArcGISProject("G:\\Game_program\\Web_maps\\Controlled_Hunt\\Controlled_Hunt.aprx")
arcpy.env.addOutputsToMap = True
gdb = "G:\\Game_program\\Web_maps\\Controlled_Hunt\\Controlled_Hunt.gdb"
fc = 'Map_Series_Extents'
arcpy.CreateFeatureclass_management(gdb, fc, "POLYGON",
has_m = "DISABLED", has_z = "DISABLED",
spatial_reference = "G:\\Game_program\\Web_maps\\Controlled_Hunt\\Controlled_Hunt.gdb\\Divided_ControlledHunt_tobeMapped_2022")
arcpy.management.AddField(fc, "Name", "TEXT")
For whatever reason the field just stopped getting added and there are no errors that come up when I run the code. I know it worked at some point.