Table of Contents

Method FormatMeasurement

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

FormatMeasurement(double, string)

Gets the text the dimension writes for a measurement, as AutoCAD's FormatMeasurement: the measurement in the units and to the places of the variables it reads, put into a text as its own text is. A length is multiplied by Dimlfac (a negative one taken as its size in paper space and as 1 elsewhere, as AutoCAD takes it), rounded by Dimrnd and written in Dimlunit: 1 scientific, 2 decimal, 3 engineering, 4 architectural, 5 fractional, 6 as the Windows desktop writes it under the culture of the thread; to Dimdec places, or in architectural and fractional units to a fraction of 2 to the power of them, stacked as Dimfrac says in AutoCAD's codes of an MTEXT; its zeros left out as Dimzin says, Dimdsep its decimal separator, Dimpost about it; and where Dimalt is on, its alternate units after it in brackets, or in the place of a [] of the text. An angle, of a DxfLineAngularDimension2 or a DxfPoint3AngularDimension, is given in radians and written in Dimaunit (0 decimal degrees, 1 degrees, minutes and seconds, 2 grads, 3 radians) to Dimadec places (those of Dimdec at -1), its zeros left out as Dimazin says. In the style ISO-25, two places, a comma and trailing zeros left out, 1234.5 is 1234,5 and 60 is 60; in architectural units to a sixteenth, not stacked, 15.5 is 1'-3 1/2"; to two decimal places 2.675 is 2.68, a number being rounded as its 15 significant figures (a .NET decimal), half away from nought; pi / 4 of an angular dimension is 45°. Tolerances, limits, the arc symbol and the R or diameter sign before a radius are not part of it.

public string FormatMeasurement(double measurement, string dimensionText)

Parameters

measurement double

The measurement: a length in drawing units, or an angle in radians; Measurement for the one the dimension shows.

dimensionText string

The text to put it in, as DimensionText: empty or null for the measurement alone, <> TYP for it and TYP after it, <> (=[]) with the alternate measurement in the brackets' place, a single space for no text.

Returns

string

The text: 60, or 60 TYP.

Exceptions

ArgumentOutOfRangeException

Thrown when the measurement is not a finite number.