Execute Command From External

681
2
03-18-2013 12:17 AM
ChaitanyaPeddinty
New Contributor
Hi...

I Created a  arc Map Command and Wrote some Code.

I Opened Arc Map Programmatically using C# and Executed that Command from an External Application using  ICommandItem Concepts.

Command is Executing fine.. But My requirement is to pass some parameters to that command from External Application.With that  Inputs taken from External Application, Command Will execute. Is it Possible??.. If Possible.. Suggest me the way.

Thanks in Advance.
0 Kudos
2 Replies
AlexanderGray
Occasional Contributor III
Yes it is possible.  I have done this for zooming to an extent.  I created an extension, defined a custom interface for my extension.  Implemented both IExtension and my custom interfaced on it.  Put the extents I wanted to zoom to as public properties on the extension (doubles.)  In my other project with the command, I reference the assembly with the extension.  Then from the application object, I get a reference to the custom extension running in the other ArcMap, cast it to my custom interface, set the properties (doubles.)  For literal values, that is fine, if you want to pass in objects (a layer for example,) you need to use an object factory to create the object in the ArcMap process space.
0 Kudos
ChaitanyaPeddinty
New Contributor
Yes it is possible.  I have done this for zooming to an extent.  I created an extension, defined a custom interface for my extension.  Implemented both IExtension and my custom interfaced on it.  Put the extents I wanted to zoom to as public properties on the extension (doubles.)  In my other project with the command, I reference the assembly with the extension.  Then from the application object, I get a reference to the custom extension running in the other ArcMap, cast it to my custom interface, set the properties (doubles.)  For literal values, that is fine, if you want to pass in objects (a layer for example,) you need to use an object factory to create the object in the ArcMap process space.



Thank you  Very Much for Ur response...... We Understood the concept, additonal to that we need some samples for reference. Can u please provide the samples (to define custom interface on Extension , and calling Extension from Other Project).......We are Missing
something even we followed the process what you suggested, that's why I am asking.... Please help me on this.
0 Kudos