I made a custom "Find" tool (winform) which is called after specific button pressed in an ArcMap toolbar. In this new "Find" form I need to use identify for one or more selected items in DataGridRow. So far I failed to find a way to call default "Identify" tool from ArcMap. I could make my own tool, but that seams like a waste of time, as I don't need any custom functionality in it.
Is there a way to call ArcMap "Identify" form (with feature properties etc.) from my custom winform tool passing one or more features?
I'm relatevly new to ArcMap as well as C#.
1 Answer 1
You could modify the below snippet from ESRI Website
public void FindCommandAndExecute(ESRI.ArcGIS.Framework.IApplication application, System.String commandName)
{
ESRI.ArcGIS.Framework.ICommandBars commandBars = application.Document.CommandBars;
ESRI.ArcGIS.esriSystem.UID uid = new ESRI.ArcGIS.esriSystem.UIDClass();
uid.Value = commandName; // Example: "esriFramework.HelpContentsCommand" or "{D74B2F25-AC90-11D2-87F8-0000F8751720}"
ESRI.ArcGIS.Framework.ICommandItem commandItem = commandBars.Find(uid, false, false);
if (commandItem != null)
commandItem.Execute();
}
The identify tool's UID in 9.3 is {CF605583-AEA3-41D8-9464-DDD1905243D9}
or esriControls.ControlsMapIdentifyTool
I am not sure if it is same in version 10
Edit
I believe you are trying to pop up a custom attribute form with the attributes of the user selected feature. I am assuming a case where where the "STREET_NAME" field value needs to get populated in a textbox. For this,
Find the ObjectId of the selected feature. Refer IFeatureSelection, IFeatureCursor etc.. //get the field values
IFeature pFeature = featureClass.GetFeature(objectid);
string streetName = pFeature.Value(pFeature.Fields.FindField("STREET_NAME"));
txtStreetName.Text = streetName;
If you are looking at creating dynamic userforms, you will need to loop all fields and field values.
-
It activates "Identify" command the same way as clicking on button, but so far it seams that i cant really use it in my situation, because I need it to open "identify" form(like normaly you would click on identify command, and then on desired feature/s and it opens the form showing theyr properties). My apollagies, the question might have not been exactly correct. Slightly edited question!Sunder– Sunder2012年08月01日 10:27:56 +00:00Commented Aug 1, 2012 at 10:27
-
From your given link i found something very similar to what I need - link. Unfortunatelly its not exactly what i wanned to get. From that sample I managed to get this(wrong), but i waned to get this(correct)Sunder– Sunder2012年08月01日 12:20:46 +00:00Commented Aug 1, 2012 at 12:20
Explore related questions
See similar questions with these tags.