Layer 3D to feature class generates an empty output

71
0
01-04-2021 12:22 AM
AndresKasekamp
New Contributor II

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:

AndresKasekamp_0-1609747813998.png

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()

 

 

 

Tags (3)
Reply
0 Kudos
0 Replies