Class CadPlotStyle
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
One plot style of a plot style table: what an object of one colour (a colour-dependent .ctb) or of one name (a named .stb) is plotted as in place of its own colour, lineweight, linetype and the shape of its line ends and corners, as AutoCAD 2021's Plot Style Table Editor lists its properties. A style that changes nothing is "Use object ...": its colour is the object's, its lineweight 0, its linetype ObjectLinetype, its screening 100.
public sealed class CadPlotStyle
- Inheritance
-
CadPlotStyle
- Inherited Members
Remarks
A style a plot reads is applied to colour, grayscale, screening, lineweight, linetype and the line end and join (CadPlotStyleResolver). Dithering, the pen numbers, adaptive adjustment and the fill style are kept in the file and shown in the editor; a PDF or an image has no pens to dither or number, and a filled area is plotted solid.
The colour is kept as the file keeps it, two whole numbers (color and mode_color) whose top byte says
what kind of colour it is, so that a table read and written again is the same text: Rgb and
UsesObjectColor are the way in.
Constructors
- CadPlotStyle(string)
Makes a style that changes nothing: every property is the object's own.
Fields
- ObjectLinetype
The linetype value that means the object's own (the editor's "Use object linetype"): 31.
Properties
- Adaptive
Gets or sets whether the pattern of the linetype is adjusted to finish whole at the end of a line (Adaptive adjustment); on by default. Kept and not used by the presenter, which plots a pattern as it is.
- ColorKind
Gets or sets the kind byte of a colour of its own, as the file keeps it in the top byte of
mode_color: 0xC2 (an RGB colour, a colour-dependent table's), 0xC3 (a colour of AutoCAD's index, a named table's). A style made in the editor of a table takes the kind of the table.
- Description
Gets or sets the description, one line; empty for none.
- Dither
Gets or sets whether the colours are dithered on a plotter that can (the editor's Enable dithering); on by default. A PDF or an image has no dots to dither with, so a plot is the same either way.
- EffectiveScreening
Gets the screening a plot applies: Screening, 100 where it is above 100.
- Fill
Gets or sets how a filled area is plotted; the object's own by default. Kept and shown, a filled area is plotted solid.
- Grayscale
Gets or sets whether the colour is plotted as the grey of its brightness (the editor's Convert to grayscale); off by default.
- LineEnd
Gets or sets the shape of a line's end; the object's own by default.
- LineJoin
Gets or sets the shape of a corner of a line; the object's own by default.
- LinePatternSize
Gets or sets the length the pattern of Linetype is built from, in inches as the file keeps it; 0.5 by default. One unit of the presenter's patterns is a quarter of it, 3.175 mm at the default.
- LineWeightIndex
Gets or sets which entry of the table's lineweight list the style plots at, as the file keeps it: 0 for "Use object lineweight" (the table's entry 0, which is 0). LineWeightOf(CadPlotStyle) gives its millimetres.
- Linetype
Gets or sets the linetype the style plots in, 0 to 30 as LinetypeNames lists them, or ObjectLinetype (31) for the object's own; 31 by default.
- LinetypeNames
The names of the 32 linetypes a style can plot in, by the value the file keeps: 0 is Solid, 1 to 30 the dashed and dotted ones the Linetype list shows, 31 "Use object linetype".
- LocalizedName
Gets or sets the name the editor shows: the same as Name unless a file says another.
- Name
Gets or sets the name: Color_1 for colour 1 of a colour-dependent table, the name a drawing gives its objects in a named one.
- PhysicalPen
Gets or sets the number of the physical pen, 1 to 32; 0 for automatic. A PDF or an image has no pens, so the number is kept and not used.
- Rgb
Gets or sets the colour the style plots in, 0xRRGGBB, where UsesObjectColor is false; read as black for a style of the object's colour. Setting it chooses a colour of its own, of the kind the style had.
- Screening
Gets or sets the screening, how much of the colour is plotted, 0 to 100 per cent; 100 by default. A colour at 50 is plotted half way to white on the white sheet: pure red #FF0000 at 50 is #FF8080. A table of AutoCAD's may keep 255, its "no screening", which is read as 100 where the plot is made (EffectiveScreening).
- UsesObjectColor
Gets whether the style plots in the object's own colour (the editor's "Use object color").
- VirtualPen
Gets or sets the number of the virtual pen, 1 to 255; 0 for automatic. A PDF or an image has no pens, so the number is kept and not used.
Methods
- Clone()
Makes a copy that changes apart from this one.
- UseObjectColor()
Sets the style to plot in the object's own colour.