Hello everyone,
I am using the Aspose.Diagrams trial full license to read Shape Data property tables from .VSD files. I have many .VSD files containing Shapes with “Shape Data” tables that have a “Label” and a “Value” that I need to read, example screenshot here:
image.png (10.3 KB)
And here is an example .VSD file I am trying to read from: Box
However, the following code will often return an Empty String for the “property.Label.Value” call, even though I can see in the .VSD file that the Shape Data table has a Label with a non-empty string (e.g. “Description”). I need to be able to read this Label value, so this code returning Empty Strings for the Label is confusing to me. Is there something I might be missing in reading the Label from the property table?
foreach (FileInfo file in _ddcVisioFilesToRead)
{
Diagram diagram = new Diagram(file.FullName);
Console.WriteLine("Processing file: " + file.Name);
foreach (Page page in diagram.Pages)
{
foreach (Aspose.Diagram.Shape shape in page.Shapes)
{
Console.WriteLine("Processing shape: " + shape.Name + " in Page: " + page.Name);
foreach (Prop property in shape.Props)
{
//TODO: Property Label is often returning empty string, when the shape does actually have a Label string.
if (property.Label.Value == "Description")
{
Console.WriteLine(property.Label.Value + ": " + property.Value.Val);
}
else if (property.Label.Value == "Input" || property.Label.Value == "Output")
{
Console.WriteLine(property.Label.Value + ": " + property.Value.Val);
}
}
}
}
}
For the example Shape Data table, I am able to read the “property.Value.Val” of “BV-37” in Visual Studio:
image.png (1.5 KB)
But for the same property, the “property.Label.Value” is empty in Visual Studio (while the Visio screenshot shows the Label as “Output”):
image.png (1.5 KB)
What is also strange is that I wrote some code using the Microsoft.Office.Interop.Visio library to manually open the file in Visio Studio and read Shape Data properties, and I am able to read the Label Value with no issue.