Table of Contents

Method ImportLayouts

Namespace
OpenCAD2D.SheetSets
Assembly
OpenCAD2D.Core.dll

ImportLayouts(string, IReadOnlyList<string>, bool)

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 (Bind(CadDocument, string, CadSheetSetFile, CadSheetSetSheet)) and the rest of the layout is not touched. A layout that CheckLayouts(string) refuses is refused here, and then nothing is changed.

public IReadOnlyList<CadSheetSetSheet> ImportLayouts(string drawingFile, IReadOnlyList<string> layoutNames, bool prefixTitleWithFileName)

Parameters

drawingFile string

The path of the drawing, a DWG.

layoutNames IReadOnlyList<string>

The names of the layouts, in the order of their sheets.

prefixTitleWithFileName bool

Whether the title carries the file name.

Returns

IReadOnlyList<CadSheetSetSheet>

The new sheets, in the order of the layouts.

Exceptions

ArgumentNullException

Thrown when the drawing or the layouts are null.

ArgumentException

Thrown when there is no layout, or the same layout is named twice.

FileNotFoundException

Thrown when the drawing is not there.

InvalidOperationException

Thrown outside Change(Action<CadSheetSet>), or where a layout is refused (the message says why).

NotSupportedException

Thrown when the DWG writer would leave something of the drawing out; the drawing is not replaced.