Table of Contents

CadStandards

from OpenCAD2D import CadStandards

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

Checks a drawing against a company standard (CadStandard) and scores it, for a program that lays a drawing out and wants a number to climb. The rules read the same display lists the canvas draws, so what is measured is what is on the screen and on the paper: the height of a word is the height it is drawn at, times the scale of the viewport that shows it. A drawing of 10 000 objects is checked in well under a second after its display lists are made.

The rules, in the order the result lists them: layer-name (an object on a layer the standard does not allow), layer-properties (an allowed layer whose colour, linetype or lineweight differs from the standard's), layer-zero (an object on layer 0), by-layer-color, by-layer-linetype, by-layer-lineweight (an object with a look of its own), text-style and dim-style (an object in a style the standard does not allow), text-font and dim-font (an allowed style in another font), text-height (a word on paper at a height the standard does not list), gap-word-line and gap-word-word (a word nearer a line or another word than the standard allows) and dim-chain (dimensions of one chain whose dimension lines do not line up).

Properties and fields

RuleIds

.NET

RuleIds: ClassVar[System.Collections.Generic.IReadOnlyList[str]]

Gets the ids of the rules, in the order a result lists them.

Methods

Check

.NET

@staticmethod
def Check(
    document: CadDocument,
    standard: CadStandard,
    modelScale: float,
    tolerance: Tolerance,
) -> CadStandardResult

Checks every space of a drawing against a standard. A rule scores 1 minus the share of the things it looked at that offend (see CadRuleScore); the total is the weighted mean of the rules the standard runs. Words are measured on paper: in a layout by the layout's own units, in model space through each viewport that shows them at the viewport's scale (annotative objects at the annotation scale the viewport draws them at); where no layout has a viewport, or a scale is given, model space is measured at that scale, a drawing of millimetres plotted 1:1 where none is given. A word seen through two viewports of two scales is checked at both and reported at the worse.