<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Layer 3D to feature class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/layer-3d-to-feature-class/m-p/735323#M56959</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello there, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; I am quite new to python and I am just trying to do a simple iteration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have Six Feature classes which need to be converted to Multipatch as part of an automated process&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried getting it done with modelbuilder but it seems that Iterate features does not work with Layer 3d to FC since it needs to look in the TOC for the 3d Polygons rather than the MDB &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would anyone be willing to shed a little light on the python setup needed to run this conversion?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jan 2012 14:12:50 GMT</pubDate>
    <dc:creator>AnthonyTimpson2</dc:creator>
    <dc:date>2012-01-31T14:12:50Z</dc:date>
    <item>
      <title>Layer 3D to feature class</title>
      <link>https://community.esri.com/t5/python-questions/layer-3d-to-feature-class/m-p/735323#M56959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello there, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; I am quite new to python and I am just trying to do a simple iteration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have Six Feature classes which need to be converted to Multipatch as part of an automated process&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried getting it done with modelbuilder but it seems that Iterate features does not work with Layer 3d to FC since it needs to look in the TOC for the 3d Polygons rather than the MDB &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would anyone be willing to shed a little light on the python setup needed to run this conversion?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 14:12:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/layer-3d-to-feature-class/m-p/735323#M56959</guid>
      <dc:creator>AnthonyTimpson2</dc:creator>
      <dc:date>2012-01-31T14:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Layer 3D to feature class</title>
      <link>https://community.esri.com/t5/python-questions/layer-3d-to-feature-class/m-p/735324#M56960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I batch process Layer 3D to Feature Class, so I authored a Python script that convert all .lyr files in a target folder to feature class.&amp;nbsp; If you build a script tool, you can click through the process. Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Import system modules
import arcpy
from arcpy import env
import exceptions, sys, traceback

try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Obtain a license for the ArcGIS 3D Analyst extension
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CheckOutExtension("3D")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Get input parameter
&amp;nbsp;&amp;nbsp;&amp;nbsp; inLyr = arcpy.GetParameterAsText (0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; outFolder = arcpy.GetParameterAsText (1) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set environment settings
&amp;nbsp;&amp;nbsp;&amp;nbsp; env.workspace = inLyr
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Use the ListFiles method to identify all layer files in workspace
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.ListFiles("*.lyr"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for lyrFile in arcpy.ListFiles("*.lyr"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set Local Variables
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #outFC = "Test.gdb/{0}".format(lyrFile[:-4]) #Strips '.lyr' from name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFC = outFolder + "/" + lyrFile[:-4]+ "_3D"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Execute Layer3DToFeatureClass
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Layer3DToFeatureClass_3d(lyrFile, outFC)
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "There are no layer files in {0}.".format(env.workspace)

except arcpy.ExecuteError:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Get the traceback object
&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = sys.exc_info()[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp; tbinfo = traceback.format_tb(tb)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Concatenate error information into message string
&amp;nbsp;&amp;nbsp;&amp;nbsp; pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .format(tbinfo, str(sys.exc_info()[1]))
&amp;nbsp;&amp;nbsp;&amp;nbsp; msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2))
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Return python error messages for script tool or Python Window
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError(pymsg)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError(msgs)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:21:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/layer-3d-to-feature-class/m-p/735324#M56960</guid>
      <dc:creator>AhjungKim</dc:creator>
      <dc:date>2021-12-12T07:21:03Z</dc:date>
    </item>
  </channel>
</rss>

