Free Support Forum - aspose.com

MeasureConst inconsistencies

Hello,

You have this units in your Aspose.Diagram.MeasureConst enum:

DL - Default length units.
DP - Default page units.
DT - Default type units.

My quetion is how do I know what exactly unit is “default”? I mean what exactly is DL, DP, DT? How do I convert them to mm or inches for example?

Regards,
Alex

@AlexBilakovskyi

The default measurement unit in Aspose.Diagram API is Inch. This enum returns the values in inches. However, could you please share a sample use case that how you want to use them and how they are different/inconsistent in your case? We will further proceed to assist you accordingly.

@asad.ali

Thanks a lot for your answer! Everything became consistent now. Thank you again :grinning:

@asad.ali

Oh, no, I have a question… After your answer I came up with idea to create a converter, so I can transform document measurement to pixels (or any other unit). Right now I have another problem: most of the shape’s units are “undefined”. Formula how to convert them in UnirFormulaErr object is not given at all. That’s my first question - how to deal with undefined unit? Maybe you already have a converter somewhere in documentation, but unfortunately I haven’t found it?

I also have a second question - PageWidth and PageHeight is given in MM, but their value is not correct for my document. Width and height values are more likely to be measured in inches for my document, but shown as MM. My program.cs class and .vsdx diagram are inside zip archive. (project was too big to upload, please create empty project and replace program.cs file with mine). Attached png file contains console output.

P.S. I use the latest 21.3.1 version of Aspose.Diagram

Files.zip (28.0 KB)
aspose.diagram.measurement.png (14.3 KB)

@AlexBilakovskyi

We have replicated the similar behavior of the API at our end during testing the scenario. An investigation ticket has been logged in our issue tracking system as DIAGRAMNET-52013 for the sake of correction. We will look into its details and let you know as soon as it is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.