Table of Contents

CadSheetSubset

from OpenCAD2D.SheetSets import CadSheetSubset

class CadSheetSubset(CadSheetComponent) ยท CadSheetSubset in the .NET reference

A subset of a sheet set, a named group of sheets and of subsets inside it, as the Sheet List tab of the palette shows it, and the base of CadSheetSet, which is the group at the top. The CadSheetSubset.Children are in set order, which is the order of the XML and nothing else.

Properties and fields

Children

.NET

@property
def Children(self) -> System.Collections.Generic.IReadOnlyList[CadSheetComponent]

Gets the subsets and sheets directly in this group, in set order.

Name

.NET

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

Gets or sets the name.

NewSheetLocation

.NET

@property
def NewSheetLocation(self) -> CadFileReference | None
@NewSheetLocation.setter
def NewSheetLocation(self, value: CadFileReference | None) -> None

Gets or sets the folder a new sheet in this group is saved in (NewSheetLocation); null for none.

PromptForTemplate

.NET

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

Gets or sets whether a new sheet asks which template to use (PromptForDwt).

PublishSheets

.NET

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

Gets or sets whether the sheets in this group, and in the groups inside it, are published with the set: AutoCAD's Publish Sheets in Subset, true until it is cleared. The file keeps the opposite, OverrideSheetPublish, and leaves it out for a group that publishes. The palette does not offer it for the sheet set itself.

Sheets

.NET

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

Gets the sheets directly in this group, in set order.

Subsets

.NET

@property
def Subsets(self) -> System.Collections.Generic.IReadOnlyList[CadSheetSubset]

Gets the subsets directly in this group, in set order.

Template

.NET

@property
def Template(self) -> CadDrawingReference | None
@Template.setter
def Template(self, value: CadDrawingReference | None) -> None

Gets or sets the sheet creation template: the layout of a drawing template (a .dwt) that a new sheet in this group is made from (DefDwtLayout). Null for none; the sheet set's own then applies to a subset that has none.

Methods

AddSheet

.NET

def AddSheet(self, number: str, title: str, layout: CadDrawingReference, index: int = ...) -> CadSheetSetSheet

Adds a sheet to this group; it is given an empty list of sheet views, as AutoCAD gives one.

AddSubset

.NET

def AddSubset(self, name: str, description: str | None = ..., index: int = ...) -> CadSheetSubset

Adds a subset to this group.

AllSheets

.NET

def AllSheets(self) -> System.Collections.Generic.IEnumerable[CadSheetSetSheet]

Walks every sheet in this group and the groups inside it, depth first in set order.

ImportLayouts

.NET

def ImportLayouts(
    self,
    drawingFile: str,
    layoutNames: System.Collections.Generic.IReadOnlyList[str],
    prefixTitleWithFileName: bool,
) -> System.Collections.Generic.IReadOnlyList[CadSheetSetSheet]

Makes layouts of a drawing sheets of the set, as Import Layouts as Sheets does: a sheet for each, at the end of this group, with no number and the layout's name as its title (the drawing's file name, a hyphen and the layout's name with prefixTitleWithFileName), every sheet custom property at its default. The drawing is rewritten as a DWG of AutoCAD 2018 with the sheet set mark; the \AcSm fields of each layout are bound to its sheet once the set is saved (CadSheetSetFields.Bind) and the rest of the layout is not touched. A layout that CadSheetSet.CheckLayouts refuses is refused here, and then nothing is changed.

Move

.NET

def Move(self, component: CadSheetComponent, newParent: CadSheetSubset, index: int) -> None

Moves a sheet or a subset to another place in the set: another place in its own group, or another group.

NewSheet

.NET

def NewSheet(
    self,
    number: str,
    title: str,
    template: CadDrawingReference | None = ...,
    fileName: str | None = ...,
    index: int = ...,
) -> CadSheetSetSheet

Makes a new sheet as New Sheet does (D11): a drawing is made from the layout of the sheet creation template with every other layout taken out and nothing left in model space, the layout is named "Number Title" and the drawing is saved as a DWG of AutoCAD 2018 in the folder new sheets of this group go to; the sheet is added to this group and takes every sheet custom property at its default; the drawing gets the sheet set mark (CadSheetSetHint).

NewSubset

.NET

def NewSubset(self, name: str, description: str, createFolder: bool, index: int = ...) -> CadSheetSubset

Adds a subset as New Subset does: the name must not be empty and must not be the name of a subset already in this group (letter case ignored); with createFolder the subset gets a folder of its own, its name inside the folder new sheets of this group go to, made on disk now and set as the subset's CadSheetSubset.NewSheetLocation, so that its sheets are saved there (Create Folder Hierarchy).

Remove

.NET

def Remove(self, component: CadSheetComponent) -> None

Takes a sheet or a subset, with what is in it, out of this group or one inside it.