CadPlotStyle
from OpenCAD2D import CadPlotStyle
class CadPlotStyle(System.Object) ยท CadPlotStyle in the .NET reference
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 CadPlotStyle.ObjectLinetype, its screening 100.
Constructors
__init__
def __init__(self, name: str) -> None
Makes a style that changes nothing: every property is the object's own.
Properties and fields
ObjectLinetype
ObjectLinetype: ClassVar[int]
The linetype value that means the object's own (the editor's "Use object linetype"): 31.
Adaptive
@property
def Adaptive(self) -> bool
@Adaptive.setter
def Adaptive(self, value: bool) -> None
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
@property
def ColorKind(self) -> int
@ColorKind.setter
def ColorKind(self, value: int) -> None
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
@property
def Description(self) -> str
@Description.setter
def Description(self, value: str | None) -> None
Gets or sets the description, one line; empty for none.
Dither
@property
def Dither(self) -> bool
@Dither.setter
def Dither(self, value: bool) -> None
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
@property
def EffectiveScreening(self) -> int
Gets the screening a plot applies: CadPlotStyle.Screening, 100 where it is above 100.
Fill
@property
def Fill(self) -> CadPlotFill
@Fill.setter
def Fill(self, value: CadPlotFill) -> None
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
@property
def Grayscale(self) -> bool
@Grayscale.setter
def Grayscale(self, value: bool) -> None
Gets or sets whether the colour is plotted as the grey of its brightness (the editor's Convert to grayscale); off by default.
LineEnd
@property
def LineEnd(self) -> CadPlotLineEnd
@LineEnd.setter
def LineEnd(self, value: CadPlotLineEnd) -> None
Gets or sets the shape of a line's end; the object's own by default.
LineJoin
@property
def LineJoin(self) -> CadPlotLineJoin
@LineJoin.setter
def LineJoin(self, value: CadPlotLineJoin) -> None
Gets or sets the shape of a corner of a line; the object's own by default.
LinePatternSize
@property
def LinePatternSize(self) -> float
@LinePatternSize.setter
def LinePatternSize(self, value: float) -> None
Gets or sets the length the pattern of CadPlotStyle.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
@property
def LineWeightIndex(self) -> int
@LineWeightIndex.setter
def LineWeightIndex(self, value: int) -> None
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). CadPlotStyleSheet.LineWeightOf gives its millimetres.
Linetype
@property
def Linetype(self) -> int
@Linetype.setter
def Linetype(self, value: int) -> None
Gets or sets the linetype the style plots in, 0 to 30 as CadPlotStyle.LinetypeNames lists them, or CadPlotStyle.ObjectLinetype (31) for the object's own; 31 by default.
LinetypeNames
LinetypeNames: ClassVar[System.Collections.Generic.IReadOnlyList[str]]
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
@property
def LocalizedName(self) -> str
@LocalizedName.setter
def LocalizedName(self, value: str | None) -> None
Gets or sets the name the editor shows: the same as CadPlotStyle.Name unless a file says another.
Name
@property
def Name(self) -> str
@Name.setter
def Name(self, value: str) -> None
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
@property
def PhysicalPen(self) -> int
@PhysicalPen.setter
def PhysicalPen(self, value: int) -> None
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
@property
def Rgb(self) -> int
@Rgb.setter
def Rgb(self, value: int) -> None
Gets or sets the colour the style plots in, 0xRRGGBB, where CadPlotStyle.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
@property
def Screening(self) -> int
@Screening.setter
def Screening(self, value: int) -> None
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 (CadPlotStyle.EffectiveScreening).
UsesObjectColor
@property
def UsesObjectColor(self) -> bool
Gets whether the style plots in the object's own colour (the editor's "Use object color").
VirtualPen
@property
def VirtualPen(self) -> int
@VirtualPen.setter
def VirtualPen(self, value: int) -> None
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
def Clone(self) -> CadPlotStyle
Makes a copy that changes apart from this one.
ToString
def ToString(self) -> str
UseObjectColor
def UseObjectColor(self) -> None
Sets the style to plot in the object's own colour.