Table of Contents

CadMeasure

from OpenCAD2D import CadMeasure

class CadMeasure(System.Object) ยท CadMeasure in the .NET reference

What a thing would take on the page, found before it is added, for a program that lays a drawing out and wants to try a place: the box of everything it draws and the frame of each word (CadMeasurement). The thing is drawn by the code that draws it once it is in the drawing, and measured by the code that measures it there (CadSpatial.Bounds), so the box is the same to the last digit: a TEXT or an MTEXT is drawn by the document's own builder in its own text styles and fonts, a TrueType word measured by the font's letters; a dimension's picture is made as DIM makes it, in a scratch drawing that holds the dimension style and text styles the document has. Nothing is added to the drawing, no handle taken, no undo step made, and no display list made stale, so a program may measure a thousand places between two edits.

Methods

Leader

.NET

@staticmethod
def Leader(
    document: CadDocument,
    style: str,
    arrow: GeoPoint2,
    landing: GeoPoint2,
    words: str,
    scale: float | None,
) -> CadMeasurement

Measures a multileader of words as MLEADER would make it, its arrow at one point and its landing at another, in a multileader style of the document: the leader line, its arrowhead, the landing and the words, laid out as the command lays them and measured in the style's text style. An arrow at (0, 0) and a landing at (30, 20) in a style of text 2.5 high and a landing of 0.36 gives a box from (0, 0) to a little past (30.45, 20) by the width of the words.

@staticmethod
def Leader(
    document: CadDocument,
    style: str,
    arrow: GeoPoint2,
    landing: GeoPoint2,
    words: str,
    scale: float | None,
    tolerance: Tolerance,
) -> CadMeasurement

Measures a multileader as CadMeasure.Leader does, the landing refused where it is within the tolerance of the arrow: a landing 1E-12 away from the arrow draws no leader line, as one exactly at it does not.

Of

.NET

@staticmethod
def Of(document: CadDocument, entity: DxfEntity) -> CadMeasurement

Measures an entity as it would be once added to a space of the document: a copy of it is drawn and the box and the frames of the words found; the entity itself is not changed and the document is not. A TEXT 5 high reading "Plate" has the box its letters take; an MTEXT 40 wide wrapping at 20 has the box of its lines; a dimension has the box of its lines, arrows and words. The text style and the dimension style the entity names are the document's: an entity that names one the document has not is refused, as a commit refuses it.