Free Support Forum - aspose.com

I need to use vsdx files as an input for my own diagramming application

Basically I need to convert my client’s visio diagrams into my own diagrams (XML data).
My diagramming app operates with 100+ simple shapes, number of containers and basic connectors.
So here is what I need to do:
1 try to map the shapes found in vsdx file to the own shapes (type, properties, relationship)
2 if (1) failed I need to create an image file from the shape and use it as a feed for my Image shape

Please let me know if Aspose Is a good match for such task? If yes, maybe you have more elaborate examples for me?

@mtalis

Would you kindly provide us with sample source and expected output files. We will test the scenario in our environment and share our feedback with you accordingly.

I don’t have code yet. I am just looking for a solution that allows conversion from vsdx into my own diagram format. Basically I need to parse vsdx and get shapes with the most of their properties and base on the shape unique identities map them to my own shapes. So my questions are:

  1. How to get Visio unique shape identity and find the actual shape type that can be mapped into my shape. Example: in my BPMN library I have “Start Event” shape. How can I find that a shape found in vsdx can be mapped to my “Start Event”?
  2. If I was not able to map some shapes from vsdx file to my shapes, I need to convert these shapes to images, as I have ability to display images.

@mtalis

You may retrieve, read and copy Shape Properties using the API and use it for the purpose of functionality you want to implement. In case none of the offered property helps, you can also convert Shapes into Images using Aspose.Diagram. In case shared information does not help, please share a source and desired output Diagram file so that scenario can be investigated and addressed further.

Code to convert shape into image:

var diagram = new Aspose.Diagram.Diagram(Path.Combine(dataDir, "Test.vsdx"));
Aspose.Diagram.Saving.ImageSaveOptions options = new Aspose.Diagram.Saving.ImageSaveOptions(Aspose.Diagram.SaveFileFormat.PNG);
foreach (Aspose.Diagram.Shape shape in diagram.Pages[0].Shapes)
{
  shape.ToImage(Path.Combine(dataDir, $"shape{shape.ID}.{options.SaveFormat}"), options);
}

Sounds good, thank you.