Table of Contents

Class CadDimStyleEditor

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

The edits of the dimension style table, as AutoCAD's Dimension Style Manager (DIMSTYLE) makes them: each one undo step through ApplyEdit(string, IReadOnlyList<CadEditRecord>, Action<CadEditScope>), refused where AutoCAD refuses it. A style's variables travel as values by their names (Dimasz, Dimtxt), the names of the library's DxfDimStyleTableRecord; an arrowhead as its name in Names (Closed filled for none), a text style or a linetype as its name, null for none.

public static class CadDimStyleEditor
Inheritance
CadDimStyleEditor
Inherited Members

Remarks

A style changed draws again the dimensions drawn in it, each from its points as the DIM commands make it, but those an owner keeps and those whose kind the commands do not make (ordinate, arc length, jogged), which keep their pictures until AutoCAD next draws them.

Fields

AnnotativeKey

The key of the style's Annotative flag among the values a dialog hands to Apply(CadDocument, string, IDictionary<string, object>) and Add(CadDocument, string, string, IDictionary<string, object>): a bool, not a variable.

Properties

VariableNames

Gets the names of the variables a style has, as the library names them, in ordinal order: Dimadec to Dimzin.

Methods

Add(CadDocument, string, string, IDictionary<string, object>)

Adds a style, as the Manager's New: a copy of another's variables (Start With), under a name no style of the drawing has.

Apply(CadDocument, string, IDictionary<string, object>)

Writes variables into a style, as OK of the Manager's Modify: each that differs, then the dimensions drawn in it drawn again (see the remarks), and the header given them where the style is current. Nothing is written where none differs.

Compare(IDictionary<string, object>, IDictionary<string, object>)

Gets the variables in which two sets of values differ, as the Manager's Compare lists them: each name with the two values as text, in ordinal order of the names.

CountUses(CadDocument, string)

Gets how many dimensions are drawn in a style, or in a style AutoCAD keeps for one kind of them (ISO-25$0), in every space and block.

Current(DxfDatabase)

Gets the name of the current dimension style ($DIMSTYLE), as the table spells it; the first style where the header names none the drawing has.

Delete(CadDocument, string)

Deletes a style, as the Manager's Delete: refused for Standard, the current style and a style dimensions are drawn in, saying how many.

KeysOf(CadStylePart)

Gets the keys of the fields that set a part, in the order of the dialog: the tabs from Lines to Tolerances, the rows of each in order.

Measures(CadStyleSample, IDictionary<string, object>, string)

Measures what a field of the dimension style dialogs sets on the sample, as a callout: DIMEXE from the dimension line to the end of the first extension line, DIMEXO from the origin to the start of it, DIMFXL along it to the line, DIMASZ along the second arrowhead from its tip, DIMDLE the run of the line past the second extension line (for ticks), DIMDLI between the two dimension lines of the Lines sample, DIMTXT the height of the words, DIMGAP the gap between the dimension line and the words, DIMCEN# the half of the centre mark and DIMJOGANG the angle of the jog (an arc). A part the style leaves out (DIMSE1, DIMSE2, DIMSD1, DIMSD2 on, DIMCEN none) is given with the Key of its field as the ghost of where it would be. The points are in the drawing coordinates of the sample, so the lengths are the values times the overall scale; the label has the value as the field shows it.

Override(CadDocument, IReadOnlyCollection<string>, IDictionary<string, object>)

Writes variables as overrides of the dimensions given, as AutoCAD's DIMOVERRIDE writes them into a dimension's extended data (ACAD, DSTYLE), each dimension then drawn again; the style is left as it is. A dimension an owner keeps is refused through the document's edit gate.

PartsOf(string)

Gets the parts of a sample a field of the dimension style dialogs sets, from the table of the fields: the extension and dimension lines, the arrowheads, the words. A field of no part (DIMSCALE, Annotative, DIMUPT) gives none. The key is the name of the variable the dialog shows beside the field, as DIMEXE, letters of either case and spaces left out the same; a field of two variables is keyed by the first (DIMTOL, DIMTIH), the second field of one variable by the variable and a # (DIMCEN# the centre mark's size, DIMGAP# the frame round the text), and the placement of the alternate units as DIMPOST\X.

Read(DxfDimStyleTableRecord)

Reads the variables of a style, or of the dimension style data a dimension or the header gives, by their names.

Rename(CadDocument, string, string)

Renames a style with the dimensions drawn in it, as the Manager's Rename; Standard keeps its name.

Sample(DxfDatabase, IDictionary<string, object>, CadDimSampleKind)

Makes the sample of one tab of the dimension style dialogs, with the parts of its dimensions told apart: a drawing of its own holding the style's variables (the text style copied by its name and font, the arrowheads' blocks made, the linetypes of the dimension and extension lines copied), and in its model space the entities of the sample's dimensions, each its own, drawn by the builders the DIM commands use (see CadDimSampleKind for what each sample holds). The sample is as many times bigger as the style's overall scale (DIMSCALE) says, nought taken for 1. The Overview sample draws what Samples(DxfDatabase, IDictionary<string, object>) draws, item for item.

Samples(DxfDatabase, IDictionary<string, object>)

Makes the sample dimensions of the Manager's preview: a drawing of its own holding the style's variables (the text style copied by its name and font, the arrowheads' blocks made), a part 32 by 20 with a linear dimension across its top, a circle of radius 12 with its radius and an angle of 60 degrees, drawn as the DIM commands draw them.

SetCurrent(CadDocument, string)

Makes a style current ($DIMSTYLE), as Set Current and the style box do, its variables given to the header as AutoCAD gives them, so that the header's dimension variables are the style's.

Styles(DxfDatabase)

Gets the styles the Manager lists: those of the table but the ones AutoCAD keeps for one kind of dimension of another (ISO-25$0), in the order of the table.

Text(object)

Gives a value of a variable as the Manager shows it: a number invariant to 15 figures, a colour as AutoCAD names it, none as an empty text.

Write(DxfDatabase, DxfDimStyleTableRecord, IDictionary<string, object>)

Writes variables into a style of a drawing, each that differs, by their names (VariableNames): a name of an arrowhead, text style or linetype is taken to its record in the drawing, an arrowhead's block made where it is AutoCAD's, and a text style or linetype the drawing has not gives the variable no record. A value is the kind the variable is (a double for Dimtxt, a bool for Dimtix, a string for Dimtxsty).