<?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 Re: ArcGIS PRO: ArcPy: Creating a 3D polyline, visible in Map_3D? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139597#M10890</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is how I create the target polygon FC first:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.CreateFeatureclass_management(ws, 'diag', 'POLYGON', has_z = 'ENABLED', spatial_reference = spatialRef)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed the spatial reference sometimes gets created correctly, sometimes not. pretty erratic though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Aug 2016 16:18:52 GMT</pubDate>
    <dc:creator>MatthiasBuehler</dc:creator>
    <dc:date>2016-08-12T16:18:52Z</dc:date>
    <item>
      <title>ArcGIS PRO: ArcPy: Creating a 3D polyline, visible in Map_3D?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139596#M10889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using this code to create a polylineZM in PRO, but I cannot see it in Map_3D (3d viewport).&lt;/P&gt;&lt;P&gt;I do have x,y,z coordinates..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could somebody help me with this?&lt;/P&gt;&lt;P&gt;Any input welcome!&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;def write_polyLine(data,outfile):&lt;/P&gt;&lt;P&gt;&amp;nbsp; array = arcpy.Array()&lt;/P&gt;&lt;P&gt;&amp;nbsp; point = arcpy.Point()&lt;/P&gt;&lt;P&gt;&amp;nbsp; features=[]&lt;/P&gt;&lt;P&gt;&amp;nbsp; for feature in data:&lt;/P&gt;&lt;P&gt;&amp;nbsp; for part in feature:&lt;/P&gt;&lt;P&gt;&amp;nbsp; point.X=part[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp; point.Y=part[1]&lt;/P&gt;&lt;P&gt;&amp;nbsp; point.Z=part[2]&lt;/P&gt;&lt;P&gt;&amp;nbsp; array.add(point)&lt;/P&gt;&lt;P&gt;&amp;nbsp; MP=arcpy.Polyline(array,None,True,True)&lt;/P&gt;&lt;P&gt;&amp;nbsp; array.removeAll()&lt;/P&gt;&lt;P&gt;&amp;nbsp; features.append(MP)&lt;/P&gt;&lt;P&gt;&amp;nbsp; arcpy.CopyFeatures_management(features, outfile, "", "0", "0", "0")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2016 15:21:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139596#M10889</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2016-08-12T15:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS PRO: ArcPy: Creating a 3D polyline, visible in Map_3D?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139597#M10890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is how I create the target polygon FC first:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.CreateFeatureclass_management(ws, 'diag', 'POLYGON', has_z = 'ENABLED', spatial_reference = spatialRef)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed the spatial reference sometimes gets created correctly, sometimes not. pretty erratic though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2016 16:18:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139597#M10890</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2016-08-12T16:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS PRO: ArcPy: Creating a 3D polyline, visible in Map_3D?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139598#M10891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;​ has a series of blog posts on creating 3D features which you may be interested.&amp;nbsp; There are code examples, see &lt;A href="https://community.esri.com/migration-blogpost/56105"&gt;Creating a 3D tree with Arcpy for 3D Analysis&lt;/A&gt; the bottom example and refer to his other posts for more code samples and examples&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2016 16:30:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139598#M10891</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-08-12T16:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS PRO: ArcPy: Creating a 3D polyline, visible in Map_3D?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139599#M10892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks, this did help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came up with this method that works now:&lt;/P&gt;&lt;P&gt;def write_one_line_feature(linePointList, fc, spatialRef):&lt;/P&gt;&lt;P&gt;&amp;nbsp; pnt1 = arcpy.Point(linePointList[0][0], linePointList[0][1], linePointList[0][2]) &lt;/P&gt;&lt;P&gt;&amp;nbsp; pnt2 = arcpy.Point(linePointList[1][0], linePointList[1][1], linePointList[1][2])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; line = arcpy.Polyline(arcpy.Array([pnt1, pnt2]), spatialRef, True, False)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; arcpy.CopyFeatures_management(line, fc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[[&lt;/P&gt;&lt;P&gt;I'm not perfectly sure what it was, but I think I made 2 errors:&lt;/P&gt;&lt;P&gt;1] I think the FC I created was polygon, not polyline&lt;/P&gt;&lt;P&gt;2] in arcpy.Polyline(), I did not define the spatial reference&lt;/P&gt;&lt;P&gt;either or .. not sure.&lt;/P&gt;&lt;P&gt;]]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;huge thanks, also to &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2016 17:41:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139599#M10892</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2016-08-12T17:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS PRO: ArcPy: Creating a 3D polyline, visible in Map_3D?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139600#M10893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are very welcome, although I can't remember doing anything... &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am curious about is the data format of the linePointList. You use it as a list of lists (each element in linePointList is a list that consists of a list with at least X, Y, and Z elements). Is this always a straight line (so two points)?. And do you always want to write each line to a different featureclass?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2016 18:43:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139600#M10893</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-08-12T18:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS PRO: ArcPy: Creating a 3D polyline, visible in Map_3D?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139601#M10894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi .. basically yes. this was just a quick test method .. I will probably adapt it again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your experience, writing n lines individually to an FC compared to sending a list full and write once .. is there a big performance difference?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2016 19:19:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139601#M10894</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2016-08-12T19:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS PRO: ArcPy: Creating a 3D polyline, visible in Map_3D?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139602#M10895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Probably the best way is using an arcpy.da.InsertCursor. If you have a list with features and copy them to a featureclass, a single invalid feature will cause the entire process to fail. Using an&amp;nbsp;Insert cursor provides mores options to avoid that. Also the insert cursor will allow you to store attributes. This is not possible with the Copy Feature tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Aug 2016 03:24:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139602#M10895</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-08-14T03:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS PRO: ArcPy: Creating a 3D polyline, visible in Map_3D?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139603#M10896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sounds good, I may actually also need to add some attrs in the workflow. Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2016 07:42:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-arcpy-creating-a-3d-polyline-visible-in/m-p/139603#M10896</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2016-08-15T07:42:51Z</dc:date>
    </item>
  </channel>
</rss>

