Hello,
I am writing a macro creating linear dimensions for shapes.
Everything works apart from changing default precision from 2 to 0.
Help gives this example:
Sub Test()Dim shp1 As Shape, shp2 As ShapeSet shp1 = ActiveLayer.CreateRectangle2(0, 0, 5, 2.5)Set shp2 = ActiveLayer.CreateLinearDimension(cdrDimensionHorizontal, shp1.SnapPoints(1), shp1.SnapPoints(3))shp2.Dimension.Linear.Style = cdrDimensionStyleDecimalshp2.Dimension.Precision = 3End Sub
It does not work, I get this (i.e. default precision of 2 decimal places):
What am I doing wrong? I would be grateful for any help.
I faced the same problem with CorelDRAW X8 and wrote the following work-around:
Public Sub ForceDimensionPrecision(ByVal s As Shape, ByVal precision As Integer) s.Style.GetProperty("dimension").SetProperty "precision", precisionEnd Sub
Hope this will be helpful to others.
It works. Thnx!