Layer 3D to feature class generates an empty output

01-04-2021 12:22 AM
New Contributor III

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 ="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"


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




Tags (3)
0 Kudos
2 Replies
New Contributor

seeing the same thing - you every figure this out?

0 Kudos
New Contributor

Instead of using the multipatch_lyr, try save it to the lyrx. And use the lyrx path for the in_feature_layer parameter., path_to_lyrxNone"CURRENT")

arcpy.ddd.Layer3DToFeatureClass(path_to_lyrx, path_to_multipatch)
0 Kudos