Table of Contents

CadPublishList

from OpenCAD2D import CadPublishList

class CadPublishList(System.Object) ยท CadPublishList in the .NET reference

The sheet list of the Publish dialog and of -PUBLISH, with the options that go with it: the Model and the layouts of the drawing open and of drawings added from files, in the order they are to be published, each with the page setup it is plotted by. The list is read from and written to a sheet list file (CadPublishList.Load, CadPublishList.Save), and CadPublishList.Plan says what a publish does with each sheet. Nothing here draws or writes a plot: a window's writers carry the plan out, with the PDF writer and the printers it has.

Constructors

__init__

.NET

def __init__(self, current: CadDocument) -> None

Makes an empty list for the drawing open.

Properties and fields

Current

.NET

@property
def Current(self) -> CadDocument | None

Gets the drawing open, whose sheets are plotted with the edits not saved yet; null for none.

Options

.NET

@property
def Options(self) -> CadPublishOptions
@Options.setter
def Options(self, value: CadPublishOptions) -> None

Gets or sets where the sheets go and how, the options that the list file keeps and the dialog sets.

PdfShx

.NET

@property
def PdfShx(self) -> bool
@PdfShx.setter
def PdfShx(self, value: bool) -> None

Gets or sets whether the text of SHX fonts is written as words too, as PDFSHX 1 does.

PlotStamp

.NET

@property
def PlotStamp(self) -> CadPlotStamp | None
@PlotStamp.setter
def PlotStamp(self, value: CadPlotStamp | None) -> None

Gets or sets the plot stamp every sheet is given, as AutoCAD's Include plot stamp; null for none.

SheetSetName

.NET

@property
def SheetSetName(self) -> str | None
@SheetSetName.setter
def SheetSetName(self, value: str | None) -> None

Gets or sets the name of the sheet set the sheets are of, as the list a sheet set builds says; null for a list that is of no sheet set. A list file saved from a sheet set's list says IsSheetSet=TRUE and SheetSet Name= this.

Sheets

.NET

@property
def Sheets(self) -> System.Collections.Generic.IReadOnlyList[CadPublishSheet]

Gets the sheets, in the order they are published.

Methods

AddCurrentDrawing

.NET

def AddCurrentDrawing(self) -> System.Collections.Generic.IReadOnlyList[CadPublishSheet]

Adds the Model and the layouts of the drawing open, as the Publish dialog lists them when it opens: Model first and the layouts in the order of their tabs, each as the drawing's name and the space's joined by a hyphen (plan-level2-Model, plan-level2-Layout1), by CadPublishOptions.IncludeModel and CadPublishOptions.IncludeLayouts. A sheet the list has already is not added again.

AddDrawing

.NET

def AddDrawing(self, path: str) -> tuple[System.Collections.Generic.IReadOnlyList[CadPublishSheet], str]

Adds the sheets of a drawing file, as Add Sheets does: the drawing read with the readers of the presenter (a DWG or a DXF), its Model and layouts listed by CadPublishOptions.IncludeModel and CadPublishOptions.IncludeLayouts. The drawing that is open is used as it stands, not read again.

AddLayout

.NET

def AddLayout(self, path: str, layoutName: str, name: str) -> CadPublishSheet

Adds one layout (or the Model) of a drawing file under a name of the caller's, as a sheet set's sheet is listed. The sheet is added whatever happens to the drawing: where the file is not there, cannot be read or has no such layout, its CadPublishSheet.Status says so and CadPublishList.Plan passes it over. The drawing that is open is used as it stands, any other is read from its file, once for all its sheets.

ImportablePageSetups

.NET

def ImportablePageSetups(self, file: str) -> tuple[System.Collections.Generic.IReadOnlyList[str], str]

Gets the page setups of another drawing, as Import Page Setups for Publishing lists them; the drawing is kept so that a sheet set to one of them (CadPublishList.SetPageSetup) plots by it.

Load

.NET

def Load(self, path: str, append: bool) -> System.Collections.Generic.IReadOnlyList[str]

Loads the sheets and the options of a sheet list file (.dsd), as Load List does. A sheet whose drawing is not there, or has no such layout or page setup, stays in the list with that as its status. Paths of a relative kind are taken from the folder of the list. A list that names DWF or DWFx is set to PDF, which says so in the notes.

MoveDown

.NET

def MoveDown(self, sheet: CadPublishSheet) -> bool

Moves a sheet one place later.

MoveUp

.NET

def MoveUp(self, sheet: CadPublishSheet) -> bool

Moves a sheet one place earlier, so that it is published sooner.

MultiSheetFile

.NET

def MultiSheetFile(self) -> str

Gets the multi-sheet PDF: CadPublishOptions.FileName in the output folder, .pdf added; with no name the name of the first drawing listed, so that sheets of plan-level2.dxf make plan-level2.pdf.

OutputFolder

.NET

def OutputFolder(self) -> str

Gets the folder the PDFs are written to: CadPublishOptions.OutputFolder, else the folder of the first sheet whose drawing has a file, else Documents.

PageSetupNames

.NET

def PageSetupNames(self, sheet: CadPublishSheet) -> System.Collections.Generic.IReadOnlyList[str]

Gets the page setups of the drawing a sheet is of, by name, for the sheet's Page Setup list.

Plan

.NET

def Plan(
    self,
    printers: System.Collections.Generic.IEnumerable[str],
) -> System.Collections.Generic.IReadOnlyList[CadPublishStep]

Says what a publish does with each sheet, in the order of the list. A sheet not loaded, or whose plot area is empty, is passed over (CadPublishStep.Skipped). With CadPublishTo.Pdf every other sheet is plotted by its page setup to a PDF: one file for all (CadPublishList.MultiSheetFile), or a file each (CadPublishList.SheetFile). With CadPublishTo.PlotterNamedInPageSetup a sheet whose page setup names a printer in printers is printed there, and any other is written as a PDF of its own. The list's plot stamp and SHX text go on every sheet.

Remove

.NET

def Remove(self, sheet: CadPublishSheet) -> bool

Removes a sheet from the list.

RemoveAll

.NET

def RemoveAll(self) -> None

Removes every sheet from the list.

Rename

.NET

def Rename(self, sheet: CadPublishSheet, name: str) -> str

Renames a sheet, as AutoCAD's Rename Sheet: the name has none of < > / \ " : ? * | and no other sheet has it, letters of either case the same.

Save

.NET

def Save(self, path: str) -> None

Saves the sheets and the options to a sheet list file (.dsd), as Save List does, replacing a file of the name. Where the list was loaded from a file, what that file held besides is written back as it was.

SetPageSetup

.NET

def SetPageSetup(self, sheet: CadPublishSheet, name: str, file: str = ...) -> str

Sets the page setup a sheet is plotted with, as the sheet's Page Setup list: none for the layout's own, the name of a page setup of the sheet's drawing, or a page setup of another drawing.

SettingsOf

.NET

def SettingsOf(self, sheet: CadPublishSheet) -> CadPlotSettings

Gets how a sheet is plotted by the page setup it is set to: the layout's own, a page setup of its drawing, or one imported from another drawing, read as the Plot dialog reads a page setup. The plotter is left as the setup names it.

SheetFile

.NET

def SheetFile(self, sheet: CadPublishSheet) -> str

Gets the PDF of one sheet where each sheet has a file: its name in the output folder, plan-level2-Layout1.pdf.