How can set the default to use metric as default?

How can I set the implicit system used in a diagram to be metric ?

None of the solution works, DrawRectangle method always interprets the parameters as inches.

Diagram diagram = new Diagram();
//Solution 1
diagram.Metric = BOOL.True;

//Solution 2
Page srcPage = diagram.Pages[0];
srcPage.PageSheet.PageProps.PageScale.Value = 0.03937007874015748;
srcPage.PageSheet.PageProps.PageScale.Ufe.Unit = MeasureConst.MM;
srcPage.PageSheet.PageProps.DrawingScale.Value = 0.03937007874015748;
srcPage.PageSheet.PageProps.DrawingScale.Ufe.Unit = MeasureConst.MM;

diagram.Pages[0].DrawRectangle(1, 1, 2, 1);

How to retrieve Shape Width, Height, XForm.PinX etc values in metric(mm) ? Currently they are only inches.

@zkormos
Thank you for your inquiry.
In Visio, after setting the default unit to millimeters in page setup manually, the units within shapes remain in inches, and only the page scale in the page settings changes.
You can try to convert the obtained results into different units.
mm = inches/0.039370078740157478
Thanks.

I would not like to use inches at all, I would like to use only mm. Is there any way to set the system units in mm ?

@zkormos
After running this sample code,the displayed unit should be “mm” in the user interface.

And visio store measurements in inches regardless of the displayed unit for compatibility reasons.
I’m sorry, but we can only follow Visio’s operations, which store measurements in inches.

Page srcPage = diagram.Pages[0];
srcPage.PageSheet.PageProps.PageScale.Value = 0.03937007874015748;
srcPage.PageSheet.PageProps.PageScale.Ufe.Unit = MeasureConst.MM;
srcPage.PageSheet.PageProps.DrawingScale.Value = 0.03937007874015748;
srcPage.PageSheet.PageProps.DrawingScale.Ufe.Unit = MeasureConst.MM;