public Result Execute(
ExternalCommandData commandData,
ref string message,
ElementSet elements)
{
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Document doc = uidoc.Document;
// At the moment we convert to DirectShapes
// "in place" - that lets us preserve GStyles
// referenced by element shape without doing
// anything special.
return Flatten( doc, uidoc.ActiveView.Id );
}