AddItem("esriControls.ControlsZoomToSelectedCommand"); //ICommand Cmd = new ControlsZoomToSelectedCommandClass();
缩放到被选择的部分: ICommand Cmd = new ControlsZoomToSelectedCommandClass();
IGeometry pGeometry = null;
string m = ArcGISPub.ArcGISToolPub.getMatch();
if (FBFExtent) //按发包方范围
{
string ZJQYDM = 承包方编码.Substring(0, 14); IFeatureSelection pFeatureSelection = ArcGISPub.ArcGISClassPub.getFeatureSelect(ZJQYFeatureLayer, "ZJQYDM like '" + m + ZJQYDM + m + "'");
pGeometry = ArcGISPub.ArcGISClassPub.GetFeatureLayerSelectGeometry(ZJQYFeatureLayer);
ArcGISPub.ArcGISToolPub.RunCommand("esriControls.ControlsZoomToSelectedCommand", m_application);//ControlsZoomToSelectedCommand esriControls.ControlsZoomToSelectedCommand,{06DD3F57-CF78-41BA-83F4-D13A8679914F} pFeatureSelection.Clear(); }
else
{ IFeatureSelection pFeatureSelection = ArcGISPub.ArcGISClassPub.getFeatureSelect(DKFeatureLayer, "承包方编码 like '" + m + 承包方编码 + m + "'");
int num = pFeatureSelection.SelectionSet.Count;
if (num > 0)
{
pGeometry = ArcGISPub.ArcGISClassPub.GetFeatureLayerSelectGeometry(DKFeatureLayer);
ArcGISPub.ArcGISToolPub.RunCommand("esriControls.ControlsZoomToSelectedCommand", m_application);//ControlsZoomToSelectedCommand esriControls.ControlsZoomToSelectedCommand,{06DD3F57-CF78-41BA-83F4-D13A8679914F}
m_hookHelper.ActiveView.Refresh();
pFeatureSelection.Clear();
} } IEnvelope pEnvelope = pGeometry.Envelope;
return pGeometry.Envelope; }