import arcpy
from pprint import pprint
# Path to mosaic dataset - This is an SDE connection
mosaic_dataset = r"\\UNC_path\mosaic_dataset_name"
# Set the maximum number of rasters per mosaic
max_rasters = 42
# Update the mosaic dataset properties
arcpy.management.SetMosaicDatasetProperties(
in_mosaic_dataset=mosaic_dataset,
max_num_per_mosaic=max_rasters
)
pprint(arcpy.GetAllMessages(), width=120)
print(f"Updated the maximum number of rasters per mosaic to {max_rasters} for {mosaic_dataset}.")
Here above is a very simple script, that runs perfectly within the Python window of ArcGIS Pro (v3.3.1), and updates the mosaic properties as expected.
However, I run the exact same script, and it runs with no errors, but doesn't update the number from the default of 20 to 42.
Any ideas?