Table of Contents

Method SaveAsTemplate

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

SaveAsTemplate(string, string, bool, IProgress<double>)

Saves the drawing as a drawing template, as AutoCAD 2021's Save Drawing As does with the type AutoCAD Drawing Template (*.dwt) and its Template Options: a DWG of AutoCAD 2018 with the extension .dwt (given where the name ends otherwise), the description kept in the file's template section and MEASUREMENT set as chosen. The drawing is then known by the template's file, as AutoCAD's is, and Save() writes it again with the same description.

public void SaveAsTemplate(string path, string description, bool metric, IProgress<double> progress)

Parameters

path string

The path of the file.

description string

The description of the template; null or empty for none.

metric bool

Whether the template is metric (MEASUREMENT 1) or English (MEASUREMENT 0).

progress IProgress<double>

What is told how far it has got, on this thread; null for nothing.

Exceptions

ArgumentNullException

Thrown when the path is null.

InvalidOperationException

Thrown when a group of edits is open.