Table of Contents

Method RenameAndRenumber

Namespace
OpenCAD2D.SheetSets
Assembly
OpenCAD2D.Core.dll

RenameAndRenumber(string, string, string, string)

Renames and renumbers the sheet as Rename & Renumber Sheet does (B18). A new number and title are only written into the set. A new layout name renames the layout in the drawing, and a new file name renames the drawing in its folder, so that the drawing is read, given the sheet set mark, saved as a DWG of AutoCAD 2018 under the new name and the old file deleted; every sheet of the set that is a layout of that drawing follows the file. The drawing is only touched when its layout name or its file name changes. A drawing that is open in the app must be saved and closed by the caller first, and opened again after.

public void RenameAndRenumber(string number, string title, string layoutName = null, string fileName = null)

Parameters

number string

The new number; empty for none.

title string

The new title.

layoutName string

The new layout name, or null to keep the layout's name.

fileName string

The new file name, with or without .dwg, or null to keep the file's name; the folder stays.

Exceptions

ArgumentNullException

Thrown when the number or the title is null.

ArgumentException

Thrown when the layout name is not one a layout can have (empty, a character it cannot hold, a # or Model), or the file name holds a character a file cannot.

InvalidOperationException

Thrown outside Change(Action<CadSheetSet>), where a layout or file is to be renamed and the sheet is missing, or where the drawing has a layout of the new name.

IOException

Thrown when a file of the new name is there already.

NotSupportedException

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