Hello,
When I insert a master shape on a page, the name of the shape is no longer the same as before.
Example: If I insert a shape with the name MyShape, this shape is then called MyShape.1
For my application, however, it is very important that I can subsequently address a shape with its original name.
Visio itself normally only renames shape names if a shape with the same name already exists. But this is not the case for me.
How can I use Aspose.Diagram to insert a master shape on a page without changing the shape name?
regards
Steve
Samplecode:
Diagram diagram = new Diagram();
diagram.AddMaster("Templates.vssx", "MyShape");
Aspose.Diagram.Master master = diagram.Masters.GetMasterByName("MyShape");
Aspose.Diagram.Page newPage = new Aspose.Diagram.Page();
newPage.Name = "GeneratedByAspose";
diagram.Pages.Add(newPage);
long shapeId = newPage.AddShape(0, 0, "MyShape");
// center the shape
Aspose.Diagram.Shape masterShape = newPage.Shapes.GetShape(shapeId);
masterShape.XForm.PinX.Value = newPage.PageSheet.PageProps.PageWidth.Value / 2;
masterShape.XForm.PinY.Value = newPage.PageSheet.PageProps.PageHeight.Value / 2;
// save file
diagram.Save("Output.vsdx", SaveFileFormat.Vsdx);