Extend line to specific distance or a line

9092
7
Jump to solution
01-07-2016 12:35 AM
MonirRahman
New Contributor II

I want to extend my polyline to a given distance. How can I do this. I have attached image to clear my specification.

I am using .net in arcmap . I am also using python

Thanks.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
LukeSturtevant
Occasional Contributor III

Perhaps you are looking for something like this? arcgis 10.1 - A tool or way to Extend line by specified distance? - Geographic Information Systems S...

I've put the script into a working script tool attached to this thread for you to try.

View solution in original post

7 Replies
DanPatterson_Retired
MVP Esteemed Contributor

I agree with Reza, you need to figure out what you want to use first

arcpy - Extend line to specific distance or a line - Geographic Information Systems Stack Exchange

0 Kudos
LukeSturtevant
Occasional Contributor III

Perhaps you are looking for something like this? arcgis 10.1 - A tool or way to Extend line by specified distance? - Geographic Information Systems S...

I've put the script into a working script tool attached to this thread for you to try.

View solution in original post

ArthurCrawford
Esri Contributor

Useful to extend a line both ways by using with flip tool.

0 Kudos
Britta_Schroeder
New Contributor II

Thanks, Luke Sturtevant‌ for creating a toolbox for this script, this tool seems to be the solution I'm looking for. Unfortunately, I receive an error with the following information when I try to use the script with a feature class in a file geodatabase in ArcMap 10.6: 

Traceback (most recent call last):

File "C:\Users\bschroeder\Desktop\Extend Lines.tbx\Extend Lines.tbx#extendLines2.py", line 54, in <module>
SystemError: error return without exception set

Any thoughts on what may be causing the error Arthur Crawford‌?

0 Kudos
LukeSturtevant
Occasional Contributor III

Hi Britta Schroeder‌. Sorry to hear the script isn't working for you. Amazingly after 5 years I downloaded the script tool and ran it on some sample data in a geodatabase and it worked. I'm guessing that error you are seeing is due to a schema lock on the data or perhaps the environment the data are in. Additionally, you could try initiating an edit session in the script by using arcpy.da.Editor before the script enters the update cursor near the end of the script. You could also try exporting the data to a shapefile or possibly a new geodatabase and testing the script on the new export.

Britta_Schroeder
New Contributor II

Thanks, Luke Sturtevant‌, it was user error: my dataset was GCS with degree units and I was trying to enter a number intended for meters (which exceeded 360). It works great with the right units (said NASA).

0 Kudos
LukeSturtevant
Occasional Contributor III

Ahh okay. Yes, that script could certainly be refined to do some linear conversions based on spatial reference of the input or force a consistent projected spatial reference throughout processing regardless of the inputs. Glad you got it to work though!

0 Kudos