Unable to load visio file in aspose constructor

I am unable to load the following visio file in the aspose diagram.

Its throwing NullReferenceException.

Use this file as a constructor parameter of Diagram Class. It should throw you an error. I tried with latest stable version.20.10.0.0

Let me know if you need any other information.

AWS n-tier Design Pattern.zip (102.5 KB)

@kishangajjar

We loaded your file using following code snippet with Aspose.Diagarm for .NET 20.10 and were unable to notice any issue:

var d = new Aspose.Diagram.Diagram(dataDir + "AWS n-tier Design Pattern.vsdx");

Would you kindly share in which environment you are using the API e.g. OS Name and Version, etc. Please share a sample console application with us which is able to replicate the issue so that we can test again and address the issue accordingly.

ok, i checked again so actually in my case it was throwing error for different reason.
The reason is if you take a Shape and check the PinX or PinY value for the location then somehow the values are really too long. actually its going in exponentials.

If we have the same file in VDX format then in that case we are getting the value correct like 1.5 or 2.5 like this.

Can you give it a try with same file to see what value it is showing and why ?

@kishangajjar

Would you kindly share a sample code snippet as well. We will test the scenario accordingly and share our feedback with you.

I have attached a sample code for your reference. Also you can find the visio files in vdx and vsdx format. Its the same file but in 2 different formats.
If we open these 2 file in visio it works perfect.

Refer the vsdx-incorrect.png image to see the weird PinX and PinY values in some shapes.
for the same file in vdx format (Refer the vdx-correct.png) see the right PinX and PinY values.

Let me know if you have any questions on this.

AsposeVSDXSample.zip (84.9 KB)
vdx-correct.PNG (6.9 KB)
vsdx-incorrect.PNG (11.7 KB)
samplevisiofiles.zip (78.0 KB)

@kishangajjar

We have logged an investigation ticket as DIAGRAMNET-51960 in our issue tracking to further analyze this case. We will look into details of the ticket and let you know as soon as it is resolved. Please be patient and spare us some time.

We apologize for the inconvenience.

@kishangajjar

We have investigated the earlier logged ticket. The PinX and PinY in .vsdx file will be stored in its master shape when it is a default value. Please try to add this code:

if (Math.Abs(shape.XForm.PinX.Value-double.MinValue)< 0.000001) {
if (shape.MasterShape != null) {
pinx = shape.MasterShape.XForm.PinX.Value;
}
}