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.
Perhaps you are looking for something like this? arcgis 10.1 - A tool or way to Extend line by specified distance? - Geographic Information Systems Stack Exchange
I've put the script into a working script tool attached to this thread for you to try.
Apologies for the late reply @Britta_Schroeder. We no longer have access to ArcMap on our systems so I cannot troubleshoot the error you are experiencing. Line 54 is simply compiling coordinate pairs into a list. It could be that older versions of Python in ArcMap are not compatible with the zip list function that is being called here or perhaps there is an issue with some of your lines. Also, the tools assumes that the data are in a projected coordinate system with a linear reference of meters or feet so if your data are in a geographic coordinate system this could also be causing issues.
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.
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!
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!
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).
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.
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
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?
Useful to extend a line both ways by using with flip tool.
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
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.