I have a few gp tools that I do not want the user to use or at least use with caution.
So the first option is to remove some gp tools from Pro using the SDK - is there such an option?
If this is not possible I would like to pop a warning message.
I tried to get the GPExecuteToolEvent. I see in the event parameters a lot of info but I could not find the name of the running tool.
Any idea?
Thanks
I am still looking at this, but this appears to be a bug in the API since the Path property is null when the tool is being executed. It looks like when the event is triggered only the GPResult property is populated in GPExecuteToolEventArgs , but unfortunately GPResult doesn't contain the tool path or id either. It looks like the Event is called twice, once with IsStarting set to 'true' before the tool runs and once with IsStarting set to 'false' after the tool completes. There are no provisions to 'cancel' the tool, so once the Path property is set to a proper value you will be able to get the tool's name to display a warning in case a 'specific' tool is run. I will report the issue to the GeoPrcoessing dev team. The 3.5 release contains a new GeoProcessing community sample called 'GPToolInspector' that contains the code to retrieve GPTool attributes from a given path. The 3.5 release is available next week. But unfortunately, you'll have to wait for the 'Path' property fix before you can implement a warning.
Hi Wolf
Thanks for the answer.
Do you see any way to remove any GPtools from Pro on startup time? Maybe with Configuration?
Maybe overwrite it with my own tool (that will make some tools before running the original tool)?
Thanks
It will also be nice if the event can return something that will stop the tool (cancel code?)