Bug
Bug ID Number | BUG-000153681 |
---|---|
Submitted | November 14, 2022 |
Last Modified | June 5, 2024 |
Applies to | ArcGIS Pro |
Version found | 2.9 |
Operating System | Windows OS |
Operating System Version | 10.0 64 Bit |
Version Fixed | 3.2 |
Status | Fixed |
In ArcGIS Pro 3.0, add the following lines to force Python to init the plugin manager to allow the Add function to work correctly:
import arcpy from pathlib import Path # Workaround for missing init of Add-Ins in Python from ctypes import * hDADFLib = cdll.LoadLibrary(rcpy.GetInstallInfo()['InstallDir'] + r"bin\DADFLib.dll") hDADFLib.InitializeAddInManager.argtypes = [ c_void_p, c_wchar_p ] hDADFLib.IntiializeAddInManager.restype = c_int result = hDADFLib.InitializeAddInManager(0, "en_us")
mydir = Path(__file__).parent.absolute()
arcpy.management.AddRastersToMosaicDataset(str(mydir /r"test_md.gdb\ingest_test"), "NITF", r"'C:\data-local\test_images\'", "UPDATE_CELL_SIZES", "UPDATE_BOUNDARY", "NO_OVERVIEWS", None, 0, 1500, None, "*.NTF;*.NITF;*.NSF;*.NSIF;*.r0;*.bif", "SUBFOLDERS", "ALLOW_DUPLICATES", "NO_PYRAMIDS", "NO_STATISTICS", "NO_THUMBNAILS", "", "NO_FORCE_SPATIAL_REFERENCE", "NO_STATISTICS", None, "NO_PIXEL_CACHE", r"C:\Users\dan2120\AppData\Local\ESRI\rasterproxies\test_py_add_rasters")
Get help from ArcGIS experts
Download the Esri Support App