Table of Contents

Method DeleteWithObjects

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

DeleteWithObjects(CadDocument, IReadOnlyCollection<string>)

Deletes layers with everything on them, as AutoCAD's LAYDEL does: every object on the layers, in model space, in the layouts and in every block (the blocks' definitions too), and the attributes of the block references, is erased, then the layers. A drawing with 12 lines on layer TMP and a block whose definition holds 4 more has none of the 16 after TMP is deleted. One undo step.

public static CadEditResult DeleteWithObjects(CadDocument document, IReadOnlyCollection<string> names)

Parameters

document CadDocument

The document.

names IReadOnlyCollection<string>

The names of the layers to delete.

Returns

CadEditResult

What came of it; refused, nothing changed, where a layer is not in the drawing, is layer 0 or Defpoints, the current layer or a layer of an external reference, or no layer is given. Failed, the drawing taken back, where a layer cannot be deleted after its objects are erased. A layer a viewport of a layout freezes is thawed there in the same step, which one undo takes back.

Exceptions

ArgumentNullException

Thrown when the document or the names are null.