Hello, I have three shapes that connect to one shape.
Hi Blake,
Great. Here is a link to a zip file with the visual studio solution (Aspose.Diagram.Examples.CShard.sln), stencil and an xml file.
https://drive.google.com/file/d/0B55ng_gJUbDqeVFmMFBhMm82c3c/view?usp=sharing
The application is a console app, When you debug the application the console screen will tell you press any key to load an xml. Press any key and load the xml file I have provided in the zip file. Then you get a pop up asking where you would like to save the Visio Diagram too. Also in order for the application to work properly you will need to put the MasterAdd.vss file in the root folder of your C drive or change line 45 to point to wherever you have put the MasterAdd.vss. Thank you for your help. Please let me know if you have any questions or problems.
Hi Blake,
Hi Blake,
Diagram diagram = new Diagram();
// add masters
Diagram master = new Diagram(@“C:\AD\test546\MasterAdd.vss”);
foreach (Master mast in master.Masters)
diagram.AddMaster(master, mast.Name);
LayoutOptions flowChartOptions = new LayoutOptions();
flowChartOptions.LayoutStyle = LayoutStyle.FlowChart;
flowChartOptions.SpaceShapes = 1f;
flowChartOptions.EnlargePage = true;
flowChartOptions.Direction = LayoutDirection.LeftToRight;
diagram.Layout(flowChartOptions);
int pageNumber = 0;
// place add shapes
long ShapeId1 = diagram.AddShape(2.25, 7.5, “add”, pageNumber);
long ShapeId2 = diagram.AddShape(2.25, 6.5, “add”, pageNumber);
long ShapeId3 = diagram.AddShape(2.25, 5.5, “add”, pageNumber);
// place Or shape
long OrId = diagram.AddShape(5.25, 6.5, “or”, pageNumber);
// get sub shapes of the Or connection
Aspose.Diagram.Shape TopMostOrConn = diagram.Pages[0].Shapes.GetShape(31).Shapes.GetShape(32).Shapes.GetShape(34);
Aspose.Diagram.Shape connector1 = new Aspose.Diagram.Shape();
long connecter1Id = diagram.AddShape(connector1, “connector”, pageNumber);
diagram.Pages[0].ConnectShapesViaConnector(ShapeId1, ConnectionPointPlace.Right, TopMostOrConn.ID, ConnectionPointPlace.Right, connecter1Id);
// save diagram in the VDX format
diagram.Save(@“C:\AD\test546\AsposeOut.vdx”, SaveFileFormat.VDX);
This solution worked for me. Thank you very much!!!