cart: empty [ Login ]

Question regarding rounding of dimension texts

1 
ThorstenK83
7/31/2019 6:19 AM
Hello, hope you can help me with my question, I did not find the solution in the doc. I draw a dimension line from start Point3Dto to end Point3D. Let's say start is (3.2,0,0) and end is (10,0,0), then the dimension line length is 6.8. Is there any possibility to round the dimension text, so that there would be written "7" instead of "6.8" on the dimension line? I lookaed at DxfDimension.DimensionStyleOverrides, did I miss a property where this can be controlled? Thanks in advance for your help! Best regards, Thorsten
ThorstenK83
7/31/2019 6:52 AM
Hello again, I could help myself. Found the Measurement property in the DxfDimension class. If anyone is interested, here ist the code: var roundedMeasurement = Math.Round(Math.Abs(end.X - start.X)); var line = new DxfDimension.Linear(model.CurrentDimensionStyle) { Measurement = roundedMeasurement, ... }; Best regards, Thorsten
Wout
7/31/2019 11:29 AM
Normally you'd use property DecimalPlaces of the dimension style, and set it to 0 (it's 4 by default). - Wout
ThorstenK83
7/31/2019 11:53 AM
Does the property DecimalPlaces = 0 only a cutting of the decimal places or does this also mean a rounding like Math.Round?
Wout
7/31/2019 11:54 AM
I think it rounds, I don't remember to be honest. - Wout
1