Table of Contents

Method CloseAndSave

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

CloseAndSave(CadDocument)

Saves a drawing to its file, as Ctrl+S does, then closes it. A drawing that cannot be closed is not saved.

public void CloseAndSave(CadDocument document)

Parameters

document CadDocument

The drawing, open, with a file.

Exceptions

ArgumentNullException

Thrown when the drawing is null.

ArgumentException

Thrown when the drawing is not open.

InvalidOperationException

Thrown, and nothing changes, where the drawing has no file yet, where a command runs in it, or with no window; also when it cannot be written (the message says why), and it stays open.