<?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: Using a list of feature classes as an input for the &amp;quot;generate points along lines&amp;quot; tool in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1247987#M49768</link>
    <description>&lt;P&gt;You're trying to use a list of layers as input, but the tool expects a layer.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1673603408162.png" style="width: 466px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60366iEEBCD63A12CEFD45/image-dimensions/466x156?v=v2" width="466" height="156" role="button" title="JohannesLindner_0-1673603408162.png" alt="JohannesLindner_0-1673603408162.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you will have to create your output fc and iterate through your SampleLines and append the result to the oputput fc.&lt;/P&gt;&lt;P&gt;Or you can do it with an InsertCursor. And at that point, you can take the next logical step and skip the tools altogether and just use the geometry methods.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;input_point_fcs = ["TestPoints"]
bearings = [0, 90, 180, 270, 45]
distances = [50, 100, 150, 200]
output_folder = "memory"
output_name = "result"

output_fc = arcpy.management.CreateFeatureclass(output_folder, output_name, "POINT")
arcpy.management.AddField(output_fc, "Source", "TEXT")
arcpy.management.AddField(output_fc, "Bearing", "DOUBLE")
arcpy.management.AddField(output_fc, "Distance", "DOUBLE")

with arcpy.da.InsertCursor(output_fc, ["SHAPE@", "Source", "Bearing", "Distance"]) as i_cursor:
    for point_fc in input_point_fcs:
        with arcpy.da.SearchCursor(point_fc, ["SHAPE@"]) as s_cursor:
            for point, in s_cursor:
                for bearing in bearings:
                    for distance in distances:
                        new_point = point.pointFromAngleAndDistance(bearing, distance)
                        i_cursor.insertRow([new_point, point_fc, bearing, distance])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1673608268602.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60374iD4B490D57D42B249/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1673608268602.png" alt="JohannesLindner_1-1673608268602.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2023 11:12:09 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2023-01-13T11:12:09Z</dc:date>
    <item>
      <title>Using a list of feature classes as an input for the "generate points along lines" tool</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1247943#M49762</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am writing an ArcPy script in which I have created a list of line features. I want to use this list as the input for the "generate points along lines" tool.&lt;/P&gt;&lt;P&gt;Here is a sample of my code -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Creating lines in each of the compass directions
for field in Dirfields:
    arcpy.management.BearingDistanceToLine("SusBui_Point", field.name + "Lines", "POINT_X", "POINT_Y",
                                           "LengthOfSampleLine", "METERS", field.name, "DEGREES", "GEODESIC", None,
                                           '{spatial_reference}', "NO_ATTRIBUTES")
#Creating list of lines
SampleLines=["DirWestLines", "DirSouthLines", "DirNorthLines", "DirWestLines"]
#Generating points along endpoints of line
###Here is where I get the error
for fc in SampleLines :
    arcpy.management.GeneratePointsAlongLines(SampleLines, r"C:\Users\Kedaravindan Bhaskar\Desktop\FBM_research\Testing_ArcpyScript\TestingArcpyScript.gdb\SamplePoints"
    "DISTANCE", "400 Meters", None, "END_POINTS")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the error message I get -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;RuntimeError: Object: Error in executing tool&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error message doesn't elaborate on the error but from my understanding either the input list (&lt;SPAN&gt;Input_Features)&amp;nbsp;&lt;/SPAN&gt;or the output_feature_class&amp;nbsp;is invalid. Refer to the syntax of the generate points along lines tool -&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;arcpy.management.GeneratePointsAlongLines(Input_Features, Output_Feature_Class, Point_Placement, {Distance}, {Percentage}, {Include_End_Points})&lt;/PRE&gt;&lt;P&gt;Any idea what I'm doing wrong?&lt;/P&gt;&lt;P&gt;Please let me know if there is anything else you need to assist me.&lt;BR /&gt;&lt;BR /&gt;Warm regards&lt;/P&gt;&lt;P&gt;Kedar&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 04:35:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1247943#M49762</guid>
      <dc:creator>KedaravindanBhaskar</dc:creator>
      <dc:date>2023-01-13T04:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using a list of feature classes as an input for the "generate points along lines" tool</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1247960#M49764</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/bearing-distance-to-line.htm" target="_blank" rel="noopener"&gt;Bearing Distance To Line (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;in lines 3-5&lt;/P&gt;&lt;PRE&gt;arcpy.management.BearingDistanceToLine("SusBui_Point", field.name + "Lines", "POINT_X", "POINT_Y",
                                           "LengthOfSampleLine", "METERS", field.name, "DEGREES", "GEODESIC", None,
                                           '{spatial_reference}', "NO_ATTRIBUTES")&lt;/PRE&gt;&lt;P&gt;you can remove the last 2 parameters since you don't specify a spatial reference and '{spatial reference}' isn't valid in any event, it is either None or a spatial reference&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 09:36:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1247960#M49764</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-01-13T09:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using a list of feature classes as an input for the "generate points along lines" tool</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1247987#M49768</link>
      <description>&lt;P&gt;You're trying to use a list of layers as input, but the tool expects a layer.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1673603408162.png" style="width: 466px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60366iEEBCD63A12CEFD45/image-dimensions/466x156?v=v2" width="466" height="156" role="button" title="JohannesLindner_0-1673603408162.png" alt="JohannesLindner_0-1673603408162.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you will have to create your output fc and iterate through your SampleLines and append the result to the oputput fc.&lt;/P&gt;&lt;P&gt;Or you can do it with an InsertCursor. And at that point, you can take the next logical step and skip the tools altogether and just use the geometry methods.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;input_point_fcs = ["TestPoints"]
bearings = [0, 90, 180, 270, 45]
distances = [50, 100, 150, 200]
output_folder = "memory"
output_name = "result"

output_fc = arcpy.management.CreateFeatureclass(output_folder, output_name, "POINT")
arcpy.management.AddField(output_fc, "Source", "TEXT")
arcpy.management.AddField(output_fc, "Bearing", "DOUBLE")
arcpy.management.AddField(output_fc, "Distance", "DOUBLE")

with arcpy.da.InsertCursor(output_fc, ["SHAPE@", "Source", "Bearing", "Distance"]) as i_cursor:
    for point_fc in input_point_fcs:
        with arcpy.da.SearchCursor(point_fc, ["SHAPE@"]) as s_cursor:
            for point, in s_cursor:
                for bearing in bearings:
                    for distance in distances:
                        new_point = point.pointFromAngleAndDistance(bearing, distance)
                        i_cursor.insertRow([new_point, point_fc, bearing, distance])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1673608268602.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60374iD4B490D57D42B249/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1673608268602.png" alt="JohannesLindner_1-1673608268602.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 11:12:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1247987#M49768</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-01-13T11:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using a list of feature classes as an input for the "generate points along lines" tool</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1248305#M49784</link>
      <description>&lt;P&gt;In my original code I used a spatial reference but it was very long and made the code difficult to read. In the post I changed it to '{spatial reference}'. I meant to leave a note mentioning I made this change but I forgot. My bad.&lt;/P&gt;&lt;P&gt;Regards, Kedar&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2023 03:09:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1248305#M49784</guid>
      <dc:creator>KedaravindanBhaskar</dc:creator>
      <dc:date>2023-01-14T03:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using a list of feature classes as an input for the "generate points along lines" tool</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1248306#M49785</link>
      <description>&lt;P&gt;I think I would prefer to iterate through the sample lines and append the output to the output fc. If so, would I be able to use the list as a input FC, rather than a layer?&lt;BR /&gt;&lt;BR /&gt;Regards, Kedar&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2023 03:14:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1248306#M49785</guid>
      <dc:creator>KedaravindanBhaskar</dc:creator>
      <dc:date>2023-01-14T03:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using a list of feature classes as an input for the "generate points along lines" tool</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1257850#M50333</link>
      <description>&lt;P&gt;I found a solution that worked for me. In this example, to create endpoint on the line I used this code -&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for lines in SampleLines:
arcpy.management.GeneratePointsAlongLines(lines, 'points_{}'.format(lines), "DISTANCE", "400 Meters", None, "END_POINTS")
SamplePoints = ["points_DirWestLines", "points_DirSouthLines", "points_DirNorthLines", "points_DirEastLines"]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 05:41:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-a-list-of-feature-classes-as-an-input-for/m-p/1257850#M50333</guid>
      <dc:creator>KedaravindanBhaskar</dc:creator>
      <dc:date>2023-02-14T05:41:04Z</dc:date>
    </item>
  </channel>
</rss>

