Table of Contents

Method NewSheet

Namespace
OpenCAD2D.SheetSets
Assembly
OpenCAD2D.Core.dll

NewSheet(string, string, CadDrawingReference, string, int)

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).

public CadSheetSetSheet NewSheet(string number, string title, CadDrawingReference template = null, string fileName = null, int index = -1)

Parameters

number string

The sheet number, free text; empty for none.

title string

The sheet title, which must not be empty.

template CadDrawingReference

The layout of a drawing template to make it from, or null for this group's.

fileName string

The drawing's file name, with or without .dwg; null for "Number Title".

index int

The place among the subsets and sheets of this group; -1 for the end.

Returns

CadSheetSetSheet

The new sheet.

Remarks

The template is the one given, else this group's, else that of the group it is in, up to the sheet set. The folder is this group's NewSheetLocation, else that of the group it is in, up to the sheet set, else the folder of the .dst; it is made where it is not there. The \AcSm fields of the new layout are bound to the sheet once the set is saved (Bind(CadDocument, string, CadSheetSetFile, CadSheetSetSheet)), and the drawing saved again.

Exceptions

ArgumentNullException

Thrown when the number or the title is null.

ArgumentException

Thrown when the title is empty, or the file name holds a character a file cannot.

ArgumentOutOfRangeException

Thrown when the place is not -1 or from 0 to the count of children.

InvalidOperationException

Thrown outside Change(Action<CadSheetSet>), or where there is no template to make it from.

FileNotFoundException

Thrown when the template's file, or its layout, is not there.

IOException

Thrown when the drawing's file is there already.