Class CadPlotSettings
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
How a space is plotted, as AutoCAD's Plot dialog sets it: the plotter, the sheet and its turn, what part of the space, at what scale and where on the sheet, the plot style table and the lineweights. A drawing keeps it in the plot settings of each layout (the part AcDbPlotSettings of its LAYOUT, model space's in the layout Model): Read(CadDocument, CadSpace) takes them from there and ApplyTo(CadDocument, CadSpace) writes them back, as Apply to Layout and Save changes to layout do.
public sealed class CadPlotSettings
- Inheritance
-
CadPlotSettings
- Inherited Members
Remarks
A plan of model space plotted on ISO A3 on its side at 1:20, the window from (120, 60) to (7 620, 5 360) centred, is 375 by 265 on a printable area of 410 by 287: the plot is moved 17.5 right and 11 up of the printable area's corner. Compute(CadDocument, CadSpace, CadPlotSettings, DisplayBox) works the sheet out.
Fields
- JpgDevice
The name of the presenter's raster device that writes a JPEG at a quality of 90: "OpenCAD2D JPG".
- PdfDevice
The name of the presenter's own plotter, which writes a PDF: "OpenCAD2D PDF".
- PngDevice
The name of the presenter's raster device that writes a PNG, lossless: "OpenCAD2D PNG".
Properties
- Area
Gets or sets what part of the space is plotted; what the view shows by default.
- Centered
Gets or sets whether the plot is centred on the printable area; on by default. A plot of a layout's sheet is never centred.
- DeviceName
Gets or sets the name of the plotter; PdfDevice by default, the one the presenter plots with.
- DrawingUnits
Gets or sets the drawing units the PaperUnits stand for: 20 for 1:20; 1 by default.
- EffectiveStyleSheet
Gets the file name of the plot style table the plot reads: StyleSheet, or empty where PlotWithPlotStyles is off.
- EffectiveStyleTable
Gets the plot style table the colours are plotted by: StyleTable, or none where PlotWithPlotStyles is off.
- FitToPaper
Gets or sets whether the plot is scaled to fill the printable area; on by default.
- IsPrinter
Gets whether the plotter is a printer of Windows, chosen by UsePrinter(string): neither PdfDevice nor a raster device. Its sheets are the printer's own, and a plot goes to its paper.
- IsRaster
Gets whether the plotter is one of the raster devices, OpenCAD2D PNG or JPG, whose sheet is an image sized in pixels.
- Landscape
Gets or sets whether the sheet lies on its side, wider than it is high; on by default.
- OffsetX
Gets or sets how far right of the printable area's corner the plot is moved, in millimetres, where it is not centred.
- OffsetY
Gets or sets how far up of the printable area's corner the plot is moved, in millimetres.
- Paper
Gets or sets the sheet; ISO A3 by default.
- PaperUnits
Gets or sets the millimetres of the paper of the scale; 1 by default.
- PdfHyperlinks
Gets or sets whether each hyperlink of an object plotted becomes a link of the PDF over the object's box, as EXPORTPDF's Include hyperlinks; only the PDF writer reads it. Off by default.
- PdfShx
Gets or sets whether the text of an SHX font is also written to a PDF as text no eye can see, over its strokes, so that a reader's search finds it: AutoCAD's PDFSHX. Only the PDF writer reads it; the commands set it from PDFSHX, and a drawing keeps it nowhere. Off by default.
- PlotLineweights
Gets or sets whether the lines plot at their lineweights; off, every line is the thinnest the plotter draws. On by default.
- PlotStamp
Gets or sets the plot stamp the plot carries, null for none. The commands set a copy of the session's stamp (PlotStamp) where it is on; only the PDF writer reads it, and a drawing keeps it nowhere. Null by default.
- PlotTransparency
Gets or sets whether the transparency of objects is plotted. The presenter's display lists carry no transparency, so a plot is the same either way; it is kept for the dialog and is not written to the drawing, which AutoCAD keeps it in no group of the plot settings a DXF holds.
- PlotWithPlotStyles
Gets or sets whether the plot style table is used; off, colours plot as with None. On by default.
- SavedPlotter
Gets the plotter the layout or page setup named when these settings were read (group 2), such as
Microsoft Print to PDFor AutoCAD'sDWG To PDF.pc3; empty where it named none, or these settings were not read from a drawing, or a plotter has been chosen since (UseDevice(string), UsePrinter(string)). The Plot dialog chooses it again when it is a printer this computer has.
- Scale
Gets the scale as millimetres of paper per drawing unit, where the plot is not fitted: 0.05 for 1:20.
- ScaleLineweights
Gets or sets whether the lineweights are scaled with the plot: a line of 0.5 plotted at 1:2 is 0.25 wide, at 2:1 it is 1 wide.
- StyleSheet
Gets or sets the plot style table by the name of its file, as AutoCAD's
CurrentStyleSheet(group 7 of the plot settings):monochrome.ctbby default,acad.ctb,mine.stb; empty for none. A plot reads the file from the document's PlotStyleFolder (CadPlotStyleResolver). The name is trimmed and kept as given, in the case the drawing spells it, whether or not a file of it exists.
- StyleTable
Gets or sets the plot style table as one of the three the presenter made before tables were files: a name with
monochromein it is Monochrome, one withgrayscaleis Grayscale, any other and none are None. Setting it sets StyleSheet tomonochrome.ctb,grayscale.ctbor none. Monochrome by default.
- UpsideDown
Gets or sets whether the plot is turned half round on the sheet.
- ViewName
Gets or sets the name of the named view plotted where Area is View, as it is written in the page setup (group 6 of the plot settings); empty by default. The name is trimmed and kept as given; ViewNames(CadDocument, CadSpace) lists the views a drawing offers.
Methods
- ApplyTo(CadDocument, CadSpace)
Writes the settings into the plot settings of a space's LAYOUT, as Apply to Layout does, one undo step named PLOT: the plotter's name (group 2), the sheet's name, size and margins in millimetres (4, 40 to 45, 72), its turn (73) as AutoCAD reckons it from the sheet as named, the offset (46, 47), what is plotted (74) and the window (48, 49, 140, 141), the scale (142, 143, and 75 with 147 and flag 16 where it is one of AutoCAD's standard scales, scaled to fit as 75 of 0), centring (flag 4), the table (7) by the name of its file (StyleSheet), and the flags of plot styles (32), lineweights (128) and their scaling (64). Plot transparency is not written. A layout's limits follow its sheet, as DxfLayout makes them.
- CheckPageSetupName(string)
Says why a name cannot name a page setup, as AutoCAD refuses one: empty, longer than 255 letters, or with a
< > / \ " : ; ? * | , = `in it.
- Clone()
Makes a copy that changes apart from this one.
- CurrentPageSetupName(CadDocument, CadSpace)
Gets the name of the page setup a space is set to, as the Page Setup Manager shows it as the current one: the name its LAYOUT keeps (group 1) where the drawing has a page setup of it, written by SetCurrentPageSetup(CadDocument, CadSpace, string).
- DeletePageSetup(CadDocument, string)
Takes a page setup out of the drawing, as Delete on the Page Setup Manager's list does, one undo step named PAGESETUP. A layout that was set to it keeps its settings and is set to no page setup.
- ImportPageSetups(CadDocument, DxfDatabase, IEnumerable<string>)
Copies page setups of another drawing into this one, as Import of the Page Setup Manager does, one undo step named PAGESETUP. A page setup whose name the drawing has already is added as
Name (2),Name (3)and on, so that none is lost.
- IsRasterDevice(string)
Gets whether a plotter's name is one of the raster devices, either case.
- PageSetupIsModel(DxfDatabase, string)
Gets whether a page setup of a drawing was made for model space (flag 1024 of its group 70, AutoCAD's
ModelType), the Model that Import Page Setups lists in its Location column; Layout otherwise.
- PageSetupNames(DxfDatabase)
Gets the page setups of another drawing by name, as Import in the Page Setup Manager lists them: the PLOTSETTINGS of its dictionary ACAD_PLOTSETTINGS, in ordinal order of their names, letters of either case the same.
- PageSetupNames(CadDocument)
Gets the page setups of a drawing by name, as the Name list of the Plot dialog's Page setup offers them: the PLOTSETTINGS of its dictionary ACAD_PLOTSETTINGS, in ordinal order of their names, letters of either case the same.
- Read(CadDocument, CadSpace)
Reads how a space is plotted from the drawing, as AutoCAD's Plot dialog opens on a layout's page setup: the plot settings of the space's LAYOUT, model space's from the layout Model. The sheet is the standard one of the name the layout gives and its margins, else one made of the layout's size and margins, ISO A3 where it gives none; a named view is kept by its name (ViewName), a layout's sheet of model space as its extents; the plot style table is kept by the name of its file (StyleSheet),
monochrome.ctbreading as Monochrome andgrayscale.ctbas Grayscale through StyleTable. A space whose settings cannot be read is given the defaults, a layout plotting its sheet at 1:1.
- ReadPageSetup(DxfDatabase, string, bool)
Reads a page setup of a drawing opened without a document, as Import Page Setups shows the details of the one chosen: the settings read as ReadPageSetup(CadDocument, CadSpace, string) reads them.
- ReadPageSetup(CadDocument, CadSpace, string)
Reads a page setup of the drawing by name, as choosing it in the Page setup list of the Plot dialog applies it to the space plotted: the settings read as Read(CadDocument, CadSpace) reads a layout's.
- RenamePageSetup(CadDocument, string, string)
Gives a page setup of the drawing another name, as Rename on the Page Setup Manager's list does, one undo step named PAGESETUP. A layout set to the page setup is set to it under its new name. A change of letters alone (
SmalltoSMALL) is a rename; another page setup's name, in either case, is not allowed.
- SaveAsPageSetup(CadDocument, string)
Writes the settings as a named page setup of the drawing, one undo step named PAGESETUP, as the Plot dialog's Add… and the Page Setup Manager's New… and Modify… do: the PLOTSETTINGS of the name added to ACAD_PLOTSETTINGS (the dictionary made where the drawing has none), or replaced where the name, letters of either case the same, is taken. What is written is as ApplyTo(CadDocument, CadSpace) writes it into a layout.
- SetCurrentPageSetup(CadDocument, CadSpace, string)
Sets a space to a page setup of the drawing, as Set Current of the Page Setup Manager does, one undo step named PAGESETUP: every setting of the page setup copied into the space's LAYOUT, its name with them, as AutoCAD's
CopyFromcopies them.
- UseDevice(string)
Chooses the plotter, as the Name list of the Plot dialog does. A raster device moving from the PDF one starts on 1920 by 1080 pixels, fitted, centred, with no offset and no plot style table, colours as displayed on white, colour 7 black; the PDF one moving from a raster device goes back to ISO A3 and the monochrome table. Moving between PNG and JPG keeps everything.
- UsePrinter(string)
Chooses a printer of Windows as the plotter, as the Name list of the Plot dialog does. Moving to it from a raster device gives back ISO A3 and the monochrome table, as moving to the PDF plotter does; the sheet is then one the printer lists, which the caller sets.
- ViewNames(CadDocument, CadSpace)
Gets the named views a space can plot, as the View list of the Plot dialog offers them: the views of model space for model space, those of paper space for a layout, in ordinal order of their names, letters of either case the same; empty where there are none, which is when the dialog greys View.