Solved! Go to Solution.
C# Flash Code
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004900000075000000
ComboBox ListBox Where Clause example calling Flash Geometry
private void btnZoom_Click(object sender, EventArgs e)
{
try
{
string strWhere;
Boolean boStatus = ckbQuery.Checked;
IMxDocument IMxDoc = (IMxDocument)ArcMap.Application.Document;
ILayer iLayer1;
//HARD CODED
//Build where Clause
if (rdName.Checked)
{
strWhere = "Allot_NAME = '" + listName.SelectedItem.ToString() + "' AND " + "ADM_OFC_CD = '" + cmbOffice.Text + "'";
}
else
{
strWhere = "ST_ALLOT = 'ID" + listNumber.SelectedItem.ToString() + "'";
}
//Hard Coded
if (iLayer != null)
{
iLayer1 = cUtils.ExistsFeatureReturnLayer((IMap)IMxDoc.FocusMap, iLayer);
if (iLayer1 != null)
{
cUtils.SelectFeatureQuery(iLayer1, strWhere, boStatus); }
else
{
cUtils.AddLayerToActiveView(IMxDoc.ActiveView, iLayer);
IMxDoc.ActiveView.Refresh();
cUtils.SelectFeatureQuery(iLayer, strWhere, boStatus);
}
}
}
catch
{
}
}
public void SelectFeatureQuery(ILayer iLayer, string sQuery, Boolean bDef)
{
IFeatureLayer iFeatureLayer = iLayer as IFeatureLayer;
IFeatureLayerDefinition iFLD = iFeatureLayer as IFeatureLayerDefinition;
IFeatureSelection iFeatureSelection = iFeatureLayer as IFeatureSelection;
IQueryFilter iQF = new QueryFilter();
ISelectionSet iSelSet;
try
{
UID uUID = new UID();
uUID.Value = "esriArcMapUI.ClearSelectionCommand";
ArcMap.Application.Document.CommandBars.Find(uUID).Execute();
if (bDef)
{
iFLD.DefinitionExpression = sQuery;
}
else
{
iFLD.DefinitionExpression = "";
}
iQF.WhereClause = sQuery;
iFeatureSelection.SelectFeatures(iQF, esriSelectionResultEnum.esriSelectionResultNew, false);
iFeatureSelection.SelectionChanged();
iSelSet = iFeatureSelection.SelectionSet;
if (iFeatureSelection.SelectionSet.Count == 0)
{
MessageBox.Show("Feature Not Found!", "Query Results");
}
else
{
uUID.Value = "esriArcMapUI.ZoomToSelectedCommand";
ArcMap.Application.Document.CommandBars.Find(uUID).Execute();
//example passing flash parameters delete
Application.DoEvents();
FeatureClassUtils fc = new FeatureClassUtils();
IFeature feature = iFeatureLayer.FeatureClass.GetFeature(iSelSet.IDs.Next());
IGeometry ig = feature.Shape;
IRgbColor iColor = new RgbColor();
iColor.RGB = 233;
IMxDocument iMxDoc = ArcMap.Document;
fc.FlashGeometry(ig, iColor, iMxDoc.ActiveView.ScreenDisplay, 1000);
}
}
catch
{
}
}
Please see the work flow in the sample available at http://support.esri.com/en/knowledgebase/techarticles/detail/20500
C# Flash Code
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004900000075000000
ComboBox ListBox Where Clause example calling Flash Geometry
private void btnZoom_Click(object sender, EventArgs e)
{
try
{
string strWhere;
Boolean boStatus = ckbQuery.Checked;
IMxDocument IMxDoc = (IMxDocument)ArcMap.Application.Document;
ILayer iLayer1;
//HARD CODED
//Build where Clause
if (rdName.Checked)
{
strWhere = "Allot_NAME = '" + listName.SelectedItem.ToString() + "' AND " + "ADM_OFC_CD = '" + cmbOffice.Text + "'";
}
else
{
strWhere = "ST_ALLOT = 'ID" + listNumber.SelectedItem.ToString() + "'";
}
//Hard Coded
if (iLayer != null)
{
iLayer1 = cUtils.ExistsFeatureReturnLayer((IMap)IMxDoc.FocusMap, iLayer);
if (iLayer1 != null)
{
cUtils.SelectFeatureQuery(iLayer1, strWhere, boStatus); }
else
{
cUtils.AddLayerToActiveView(IMxDoc.ActiveView, iLayer);
IMxDoc.ActiveView.Refresh();
cUtils.SelectFeatureQuery(iLayer, strWhere, boStatus);
}
}
}
catch
{
}
}
public void SelectFeatureQuery(ILayer iLayer, string sQuery, Boolean bDef)
{
IFeatureLayer iFeatureLayer = iLayer as IFeatureLayer;
IFeatureLayerDefinition iFLD = iFeatureLayer as IFeatureLayerDefinition;
IFeatureSelection iFeatureSelection = iFeatureLayer as IFeatureSelection;
IQueryFilter iQF = new QueryFilter();
ISelectionSet iSelSet;
try
{
UID uUID = new UID();
uUID.Value = "esriArcMapUI.ClearSelectionCommand";
ArcMap.Application.Document.CommandBars.Find(uUID).Execute();
if (bDef)
{
iFLD.DefinitionExpression = sQuery;
}
else
{
iFLD.DefinitionExpression = "";
}
iQF.WhereClause = sQuery;
iFeatureSelection.SelectFeatures(iQF, esriSelectionResultEnum.esriSelectionResultNew, false);
iFeatureSelection.SelectionChanged();
iSelSet = iFeatureSelection.SelectionSet;
if (iFeatureSelection.SelectionSet.Count == 0)
{
MessageBox.Show("Feature Not Found!", "Query Results");
}
else
{
uUID.Value = "esriArcMapUI.ZoomToSelectedCommand";
ArcMap.Application.Document.CommandBars.Find(uUID).Execute();
//example passing flash parameters delete
Application.DoEvents();
FeatureClassUtils fc = new FeatureClassUtils();
IFeature feature = iFeatureLayer.FeatureClass.GetFeature(iSelSet.IDs.Next());
IGeometry ig = feature.Shape;
IRgbColor iColor = new RgbColor();
iColor.RGB = 233;
IMxDocument iMxDoc = ArcMap.Document;
fc.FlashGeometry(ig, iColor, iMxDoc.ActiveView.ScreenDisplay, 1000);
}
}
catch
{
}
}