//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; Drawing.IShapes shapes = worksheet.Shapes; Drawing.IShape pentagon = shapes.AddShape(Drawing.AutoShapeType.RegularPentagon, 89.4, 57.0, 153.6, 90.6); Drawing.IShape pie = shapes.AddShape(Drawing.AutoShapeType.Pie, 344.4, 156.8, 50.4, 60.0); Drawing.IShapeRange shpRange = shapes.Range[new[] { pentagon.Name, pie.Name }]; // Group the shape range Drawing.IShape grouped = shpRange.Group(); grouped.Line.Visible = true; grouped.Line.Color.RGB = System.Drawing.Color.Orange; grouped.Fill.Color.RGB = System.Drawing.Color.OrangeRed; // Save to an excel file workbook.Save("ShapeGroup.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim shapes As IShapes = worksheet.Shapes Dim pentagon As IShape = shapes.AddShape(AutoShapeType.RegularPentagon, 89.4, 57.0, 153.6, 90.6) Dim pie As IShape = shapes.AddShape(AutoShapeType.Pie, 344.4, 156.8, 50.4, 60.0) Dim shpRange As IShapeRange = shapes.Range({pentagon.Name, pie.Name}) ' Group the shape range Dim grouped As IShape = shpRange.Group() With grouped.Line .Visible = True .Color.RGB = System.Drawing.Color.Orange .Color.RGB = System.Drawing.Color.OrangeRed End With ' save to an excel file workbook.Save("ShapeGroup.xlsx")