1

I have a map, with point layers A, B and C.

A is the main point layer. I would like to make something like this but I have no idea how I am going to do this.

When I start an edit session, click on a point in layer A, delete it, all surrounding object within a radius of r meters in layer B and C would be deleted as well.

0

2 Answers 2

2

What you are asking could easily be accomplished interactively (manually) by first selecting the desired point feature in layer A, doing a Select by Location to select the features of layers B and C that intersect the selected feature in layer A using a buffer ("search distance" on the Select by Location dialog) of r meters, and then deleting all of the selected features.

A similar approach could be also be used with geoprocessing tools in ModelBuilder or a Python/arcpy script tool to automate the process, though you would need to add a check that ensures that layer A has exactly 1 feature selected before continuing or you might end up deleting everything.

Also, in ArcGIS 10, if you set up a script tool or model with no parameters and place it on a toolbar, it will run immediately without user interaction.

5
  • or a pure ArcObjects script (my favorite!) Aug 10, 2011 at 4:43
  • I guess your answer is the manual approach. But I couldnt find such things as "delete" in the toolbox. Like what Ragi suggested above, would be awesome, I have thought of that but couldnt really find a way to do it, barely know how to code with arcobject.
    – Nicholas
    Aug 10, 2011 at 5:59
  • My first paragraph was the manual approach, the second and third were about automation. Data Management->Features->Delete Features is the tool you would most likely want to use. I think ArcObjects is probably overkill for this application. Unless you're using VBA (which goes away at 10.1), you would have to either recompile every time the layers change, or implement some way to configure it at runtime. I don't normally advocate ModelBuilder but it is probably the best tool for this particular job.
    – blah238
    Aug 10, 2011 at 6:23
  • I got your idea and am trying to build the model now but the "check" part is really tricky. Also I have no idea how to integrate it to the map. Cuz actually I want to create a user friendly application, I mean users open the map, start an edit session, click on the object in A, press Delete button on the keyboard, that point and all surrounding object in B and C get deleted immediately, users save edit.
    – Nicholas
    Aug 10, 2011 at 8:18
  • You can add a Calculate Value tool that returns a true/false based on the value returned by Get Count and use that as a precondition to the next tool to prevent it continuing if exactly 1 feature in A is not selected. I'm actually not sure how to check whether the user is in an edit session without ArcObjects -- that requirement may not be possible with either plain Python or ModelBuilder. And are you sure you really want to override what the Delete key does? Seems fraught with perils to me.
    – blah238
    Aug 10, 2011 at 17:04
0

If you are using ArcMap 10.1 or later, then you could use a Python AddIn to do this. To learn about Python AddIns see What is a Python add-in?:

An add-in is a customization, such as a collection of tools on a toolbar, that plugs into an ArcGIS Desktop application (that is, ArcMap, ArcCatalog, ArcGlobe, and ArcScene) to provide supplemental functionality for accomplishing custom tasks.

ArcGIS 10 introduced a new and innovative Desktop add-in model, making it easier for you to customize and extend the ArcGIS Desktop applications. The new add-in model provides you with a declarative-based framework for creating a collection of customizations conveniently packaged within a single, compressed file with a .esriaddin file extension.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.