CadPlotStyleResolver
from OpenCAD2D import CadPlotStyleResolver
class CadPlotStyleResolver(System.Object) ยท CadPlotStyleResolver in the .NET reference
Looks up the plot style of the items of a plot, as AutoCAD plots with a plot style table: with a colour-dependent table (.ctb) the style of the item's colour of AutoCAD's index; with a named one (.stb) the style named by the item's entity or, ByLayer, by its layer, Normal where none is named. It is made once for a plot (CadPlotStyleResolver.Create) and read for each item (CadPlotStyleResolver.PenFor).
Properties and fields
IsNamed
@property
def IsNamed(self) -> bool
Gets whether the table is a named one: styles are found by the name an item's entity or layer gives.
Sheet
@property
def Sheet(self) -> CadPlotStyleSheet | None
Gets the table the plot reads; null where there is none, or it was not found and the colours go through the three legacy tables' rules.
Methods
Create
@staticmethod
def Create(document: CadDocument, settings: CadPlotSettings) -> CadPlotStyleResolver
Makes the resolver of a plot: the table the settings name (CadPlotSettings.EffectiveStyleSheet), read from the document's CadDocument.PlotStyleFolder.
@staticmethod
def Create(document: CadDocument, styleSheet: str) -> CadPlotStyleResolver
Makes the resolver of a table of a document's folder, by its file name.
PenFor
def PenFor(self, item: DisplayItem2) -> CadPlotPen
Gets the pen of an item: its colour, and what its style sets.
def PenFor(self, rgb: int, layer: str, handle: str) -> CadPlotPen
Gets the pen of an object of a colour, a layer and an entity.
PlottedColor
def PlottedColor(self, rgb: int) -> int
Gets the colour an object of a colour plots in where it has no plot style of its own to name: through the style of the colour in a colour-dependent table, Normal's in a named one.
StyleNameOf
def StyleNameOf(self, layer: str, handle: str) -> str
Gets the name of the plot style an entity on a layer has in a drawing of named plot styles: its own where it names one, else its layer's, else Normal.