How do I run a tool from the Toolbar or ArcGis Pro in code?

1374
3
Jump to solution
07-05-2016 09:16 AM
Highlighted
Occasional Contributor II

For example, (as per my requirements,) how do I activate in code the button 'Add Data' form the Layer group, and get notified of the end of the operation?

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Regular Contributor

Hi Horia

You can use existing ArcGIS Pro commands in your own add-in by using the FrameworkApplication class' GetPlugInWrapper method.

There are a few samples that shows you how to do this:

Hook Pro Commands sample​.

Identify Window sample

Thanks

Uma

View solution in original post

3 Replies
Highlighted
MVP Esteemed Contributor

are you looking for the SDK literature specifically ArcGIS Pro SDK | ArcGIS for Desktop

or how to run the quivalent tool to add a layer in arcgis pro

An overview of the Data Management toolbox—Data Management toolbox | ArcGIS for Desktop

specifically those dealing with layers?

An overview of the Layers and Table Views toolset—Data Management toolbox | ArcGIS for Desktop

Reply
0 Kudos
Highlighted
Occasional Contributor II

I don't want to do the action myself, since the pull-down menu has many options, (and that would be a problem too!)

The thing is that in my UI I have a button with instructions for the user to press on 'Add Data' button, add whatever data s/he pleases then click back my button to continue.

My manager wants that button to automatically do like clicking that button (as I said the pull down menu would be an issue, but for now I have to do what I'm told...)

Reply
0 Kudos
Highlighted
Esri Regular Contributor

Hi Horia

You can use existing ArcGIS Pro commands in your own add-in by using the FrameworkApplication class' GetPlugInWrapper method.

There are a few samples that shows you how to do this:

Hook Pro Commands sample​.

Identify Window sample

Thanks

Uma

View solution in original post