Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aspose-com-gists/7d9b18af1d8bec47eaa1bc0e004f06b8 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/7d9b18af1d8bec47eaa1bc0e004f06b8 to your computer and use it in GitHub Desktop.
Read Visio Shape Data in C#
using Aspose.Diagram;
// Load the Visio file
var visio_file = new Diagram("Drawing1.vsdx");
// Access the first page
Page page = visio_file.Pages[0];
// Iterate through shapes
foreach (Shape shape in page.Shapes)
{
if (shape.Name == "Process")
{
foreach (Prop prop in shape.Props)
{
Console.WriteLine("Label : ", prop.Label.Value);
Console.WriteLine("Value : ", prop.Value.Val);
}
}
}
using Aspose.Diagram;
// Load the Visio file
var visio_file = new Diagram("Drawing1.vsdx");
// Access the first page
Page page = visio_file.Pages[0];
// Iterate through shapes
foreach (Shape shape in page.Shapes)
{
foreach (Prop prop in shape.InheritProps)
{
Console.WriteLine("Label : ", prop.Label.Value);
Console.WriteLine("Value : ", prop.Value.Val);
}
}
using Aspose.Diagram;
// Load the Visio file
var visio_file = new Diagram("Drawing1.vsdx");
// Access the first page
Page page = visio_file.Pages[0];
// Iterate through shapes
foreach (Shape shape in page.Shapes)
{
Console.WriteLine("Shape ID : ", shape.ID);
Console.WriteLine("Name : ", shape.Name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment