1

I've looked around I but can't seem to find a coclass/interface that would allow me to access it. I know I could make something similar but I'm curious about interacting with the built-in tool to save some work.

1 Answer 1

2

If you want to popup the existing dialog programmatically then you can find most commands here: ArcMap IDs.

The one you want appears to be: ControlsMapGoToCommand. Normally I'd be concerned that a Controls* object would only work with an ArcEngine (map) control, but the doc's say it works for ArcMap as well.

To execute you:
- get the ICommandItem from IDocument.CommandBars.Find().
- call ICommandItem.Execute().

[EDIT]
If you want to programmatically pan/zoom to a location then see the following sample code: ControlsCommandsPanZoomCommands

6
  • That could certainly be of use to me, what I'm more curious about though is if I can access the inner methods/properties of the tool. For example to set the lat/long fields and execute the "go to" functionality programmatically. Mar 7, 2017 at 17:10
  • So you don't want to use the tool per se, you just want to achieve the same effect - you want to programmatically pan|zoom a frame to a given location. Correct ? Mar 7, 2017 at 22:05
  • Well since we will often use the tool to center the map frame before exporting multiple maps in a consistent location, I do want to use the tool (as well as some of its other features). But the process of entering values into its fields often involves identifying/copying/pasting, so I'm wanting to enter values into the tool programmatically for when the center point needs to be adjusted many times. Then the tool could still be an option to the user as before. Mar 7, 2017 at 22:21
  • "for when the center point needs to be adjusted many times" Can you provide a user story explaining that ? That is fill in the rest of, "as a user I want to ..." a series of steps. Panning in code is one of the simpler things to do, not worth trying to use the tool if the code knows where you want to pan to. Mar 7, 2017 at 22:36
  • 1
    Look at the sample code link I posted. It has the full code for a pan tool. It doesn't have the popup, but that's easy enough to add. From what you've posted, I'd extend the sample code as needed a create a new tool. You can use the ESRI Object Browser to look at the interfaces the ControlsMapGoToCommand implements, again basic with no mechanism to plug into it. Mar 7, 2017 at 23:32

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.