I have a multipatch layer, whose elevation settings are set on the ground. I want to convert it to a feature class using "Layer 3D To Feature Class". When I use the geoprocessing tool, it correctly generates an output. However, when I run the tool through Python, it generates an empty output.
The multipatch features:
General idea of the script, adding the layer to the scene and converting it to Feature Class:
import arcpy
arcpy.env.workspace = r"D:\AGOL_automaatne_update\AGOL_update\AGOL_update.gdb"
arcpy.env.overwriteOutput = True
aprx = arcpy.mp.ArcGISProject(r"D:\AGOL_automaatne_update\AGOL_update\AGOL_update.aprx")
sc = aprx.listMaps("ETAK_extrude")[0]
multipatch = r"D:\AGOL_automaatne_update\AGOL_update\AGOL_update.gdb\FS_multipatch1"
sc.addDataFromPath(r"{}".format(multipatch))
multipatch_lyr = [lyr for lyr in sc.listLayers() if lyr.dataSource == "{}".format(multipatch)][0]
arcpy.Layer3DToFeatureClass_3d(in_feature_layer=multipatch_lyr, out_feature_class="multipatch_m_2")
aprx.save()
seeing the same thing - you every figure this out?
Instead of using the multipatch_lyr, try save it to the lyrx. And use the lyrx path for the in_feature_layer parameter.
arcpy.management.SaveToLayerFile(multipatch_lyr, path_to_lyrx, None, "CURRENT")