示例#1
0
 virtual public bool OnCommand(string MenuId)
 {
     switch (MenuId)
     {
     case "MenuId.Explode":
         if (Frame.ActiveAction is SelectObjectsAction)
         {
             using (Frame.Project.Undo.UndoFrame)
             {
                 IGeoObjectOwner addTo = dimension.Owner;
                 if (addTo == null)
                 {
                     addTo = Frame.ActiveView.Model;
                 }
                 GeoObjectList toSelect = dimension.Decompose();
                 addTo.Remove(dimension);
                 for (int i = 0; i < toSelect.Count; ++i)
                 {
                     addTo.Add(toSelect[i]);
                 }
                 SelectObjectsAction soa = Frame.ActiveAction as SelectObjectsAction;
                 soa.SetSelectedObjects(toSelect);     // alle Teilobjekte markieren
             }
         }
         return(true);
     }
     return(false);
 }