Table of Contents

Class CadStandard

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

A drawing standard a company writes once and checks its drawings against (Check(CadDocument, CadStandard, double, Tolerance)): the layers a drawing may use and how each looks, the text and dimension styles with their fonts, the heights words may have on paper, the least gap between words and lines, how a chain of dimensions lines up, and whether an object may sit on layer 0 or take a colour or linetype of its own. It is read from a JSON file of a versioned schema (Schema, docs/schemas/opencad2d-standard-v1.schema.json) in which every member but the two that name the schema is optional, and a rule whose member is absent is not run. A member the schema does not know is refused, so that a misspelt rule is not skipped without a word.

public sealed class CadStandard
Inheritance
CadStandard
Inherited Members

Fields

Version

The version of the schema this reads and Schema describes.

Properties

Name

Gets the name the standard gives itself, or an empty text.

Schema

Gets the JSON Schema (draft 2020-12) of a standard file: the file docs/schemas/opencad2d-standard-v1.schema.json of the repository, built into this assembly.

Methods

Parse(string)

Reads a standard from its JSON text.

Runs(string)

Gets whether a rule is run for this standard.

WeightOf(string)

Gets the weight of a rule in the total score: 1 unless the standard says otherwise.