pavsanto

How to pass parameters as inputs to BaseTool or BaseCommand from my main application

Discussion created by pavsanto on May 6, 2014
Hola/ Hi,
I am working on ArcObjects10.1 Engine in C# stand alone application (dont have a desktop license). I have a doubt which had been haunting me from several days. How do I pass inputs from my main application to some add-ins developed using BaseTool or BaseCommand. The issue I face is my main App. is in different class and the add-ins are different class, I can only add the basetool to my application through toolbar properties and adding the registered add-ins.

For example if I want to develop a basetool for LineofSight Analysis tool and I want to pass an ISurface object or an IRasterLayer object which I already have in my application, to LineOfSight BaseTool. How do I do it ? Is there a way to pass parameters that can be caught in the constructor of the BaseTool. As far as I know we can get the Handle to mapControl object using Hooker object, apart from that any other parameters we need out of the main application I cant get.

Currently I am developing all those functionality in a normal button ( exactly the size of baseTool button size) with in my main application class and placing it on the toolbar which I dont think is a good alternative. Suggest me if there is a way to do this please.


Thanks and Regards,
Pavan

Outcomes