Select to view content in your preferred language

Zoom to Selected Features

731
1
08-30-2010 05:58 AM
BBulla
by
Regular Contributor
Hi,

I'm using this code to try to zoom to selected features, but it isn't working.  Regardless of what I enter as the uid, cmdItem is always NULL.  I'm using the info on this page (http://edndoc.esri.com/arcobjects/9.1/default.asp?URL=/arcobjects/9.1/ArcGISDevHelp/TechnicalDocumen...) to set my uid.

ESRI.ArcGIS.Framework.ICommandBars cmdBar = GlobalVars.m_application.Document.CommandBars;
UID uid = new UIDClass();
uid.Value = "{06DD3F57-CF78-41BA-83F4-D13A8679914F}";
ESRI.ArcGIS.Framework.ICommandItem cmdItem = cmdBar.Find(uid, false, false);
if (cmdItem != null)
       cmdItem.Execute();

//Update the selected features on the map
ISelectionEvents selEvents = (ISelectionEvents)map;
selEvents.SelectionChanged();

//Refresh the map
pMxDoc.ActiveView.Refresh();

0 Kudos
1 Reply
BBulla
by
Regular Contributor
{AB073B49-DE5E-11D1-AA80-00C04FA37860} seems to work.  Does anyone know if a site with the proper UID for all commands??

Thanks,
0 Kudos