Learn how to Read Visio Shape Data in C#
Created
June 14, 2025 00:11
-
-
Save aspose-com-gists/7d9b18af1d8bec47eaa1bc0e004f06b8 to your computer and use it in GitHub Desktop.
Read Visio Shape Data in C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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