// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (DiagramDocument doc = Document.Load<DiagramDocument>(Utilities.MapSourceFilePath(FilePath)))
{
// Remove shape by index
doc.Pages[0].Shapes.RemoveAt(0);
// Remove shape by reference
doc.Pages[0].Shapes.Remove(doc.Pages[0].Shapes[0]);
doc.Save();
}