CadUnitScale
from OpenCAD2D import CadUnitScale
class CadUnitScale(System.Object) ยท CadUnitScale in the .NET reference
The factor that takes the lengths of a drawing to millimetres, as the export for AI pipelines (CadFlatten, CadDrawingJson, CadDrawingGraph) reads them: the drawing's INSUNITS for model space, the plot paper units of a layout for its paper space. A drawing in inches has 25.4; one of metres, 1000; one of no unit (INSUNITS 0) is left as it is, factor 1, and says so.
Methods
Millimetres
@staticmethod
def Millimetres(units: DxfUnits) -> float
Gets the millimetres in a unit of INSUNITS, as the DXF reference lists them and the reader takes them.
Of
@staticmethod
def Of(database: DxfDatabase) -> tuple[float, bool]
Gets the factor that takes the lengths of model space to millimetres: the millimetres in the drawing's INSUNITS.
OfPaper
@staticmethod
def OfPaper(layout: DxfLayout) -> float
Gets the factor that takes the lengths of a layout's paper space to millimetres: the plot paper units of the layout, 25.4 for inches; 1 for millimetres, and for a layout in pixels or with no plot settings, whose paper has no length.