Is it possible to add this type of tool to the editor toolbar written in python?

1200
2
08-10-2012 08:28 AM
BillMiller
New Contributor
What I would like is a tool that:
1) Allows the user to select a line
2) Delete the line
3) Then add a new line
4) Maybe save the attributes of the old line but not required

Hitting the "delete key" to delete the line works fine
but then the user has to go back up to the menu to add the line.
Just removing this step would save a lot of time.
Any help at all would be appreciated.
Tags (2)
0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus
If the functionality doesn't exist within arctoolbox, then it can't be used within the Python environment, you are looking at arcobjects.
0 Kudos
RichardFairhurst
MVP Honored Contributor
What I would like is a tool that:
1) Allows the user to select a line
2) Delete the line
3) Then add a new line
4) Maybe save the attributes of the old line but not required

Hitting the "delete key" to delete the line works fine
but then the user has to go back up to the menu to add the line.
Just removing this step would save a lot of time.
Any help at all would be appreciated.


Python cursors and geometry objects can do all of these steps, but the main issue is whether there a way to do it interactively with the user through some type of event trigger detection and editing action event monitoring in Python.  I do not think that Python can read editing event triggers, so ArcObjects is needed.  However, I believe that if Python could detect edit event like ArcObjects (delete, create and modify), that then both ArcObjects and Python would be able to use cursors and geometry object to read a selected record in a layer, store it in a row or dictionary object for later attribute transfer, delete the selected line, create a new line's geometry if a set of ordered coordinates is provided (an event based thing if following mouse clicks), create a feature object (newrow for Python) that gets the new geometry and a transfer of attribute data, and insert the new line into a target feature class.
0 Kudos