Hello,
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.
Here is a sample of my code -
#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")
This is the error message I get -
RuntimeError: Object: Error in executing tool
The error message doesn't elaborate on the error but from my understanding either the input list (Input_Features) or the output_feature_class is invalid. Refer to the syntax of the generate points along lines tool -
arcpy.management.GeneratePointsAlongLines(Input_Features, Output_Feature_Class, Point_Placement, {Distance}, {Percentage}, {Include_End_Points})
Any idea what I'm doing wrong?
Please let me know if there is anything else you need to assist me.
Warm regards
Kedar