Extend line to specific distance or a line

11666
12
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

12 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.

ArthurCrawford
Esri Contributor

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

0 Kudos
Deborah_Priss
New Contributor II

Hi,

Sorry for bothering you again with this issue. The Extend Lines script worked perfect for me, thank you @LukeSturtevant  for that! I need to extend the lines in both directions but the flip tool doesn't seem to work. The lines are still extended into the same direction as before. Any ideas what the problem might be?

Thank you!

0 Kudos
lsturtevant
New Contributor II

Hi @Deborah_Priss. I've attached an updated version of this tool that might help with extending in both directions. Make sure that you run the tool in an open ArcMap document or ArcGIS Pro project and not through ArcCatalog. As a check, I would suggest you run the Feature Vertices To Point tool to get both end and start points for your lines before running this tool and then do a manual check to see if the tool is behaving the way you are expecting.

EDITED: I've replaced the attached zip file to comply with ArcMap script tool parameter syntax. Deborah has confirmed that it works in ArcMap now. There is also an additional option to extend in both directions.

Deborah_Priss
New Contributor II

Thank you again! However, I cannot run it: Error - value is not member of Feet | Meter. I've never really used Python and am not familiar with arcpy, so I cannot adjust the script myself - Sorry! My .shp is in a projected coordinate system with meters as linear unit.

0 Kudos
EVEA0
by
New Contributor

Hi Isturtevant,

Thank you for this solution. I want to include your tool in my model builder process flow, and therefore need an output variable so I can use its outputs in the process. Do you have any tips for how to achieve this?

0 Kudos
lsturtevant
New Contributor II

Hello @EVEA0. To add an output variable for a model builder process you can edit the Extend Line script tool parameters to include a "Derived" output like so:

lsturtevant_0-1635168571652.png

 

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