In ArcGIS 3.2.2, I am trying to create a toolbox that would occasionally output a 3D Tiles file (in .3tz format). Using the AddDataFromPath method gives an error.
Here is my sample code done in the Python Window
import arcpy
aprx = arcpy.mp.ArcGISProject("CURRENT")
active_map = aprx.activeMap
arcpy.env.addOutputsToMap = True
active_map.addDataFromPath(r"path/to/3Dtiles.3tz")
And I get the following error (on both maps and scenes):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\utils.py", line 191, in fn_
return fn(*args, **kw)
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\_mp.py", line 3744, in addDataFromPath
return convertArcObjectToPythonObject(self._arc_object.addDataFromPath(*gp_fixargs((data_path, web_service_type, custom_parameters,), True)))
RuntimeError: Failed to add data. Possible credentials issue.
I can successfully add the same .3tz file via the Add Data From Path buttons on the ribbon, but I wish to make an automated Python tool. The AddDataFromPath method works with .slpk files. Is there a separate tool I should use for 3D Tiles?
Thanks!
Will