Method Merge
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
Merge(CadDocument, IReadOnlyCollection<string>, string)
Merges layers into another, as AutoCAD's LAYMRG does: every object on the layers merged, in model space, in the layouts, in every block (those of the blocks' definitions too) and the attributes of the block references, is put on the target layer, and the layers merged are deleted. A drawing with a line on layer WALL and another on layer DOOR, DOOR merged into WALL, has both lines on WALL afterwards and no layer DOOR. One undo step.
public static CadEditResult Merge(CadDocument document, IReadOnlyCollection<string> names, string target)
Parameters
documentCadDocumentThe document.
namesIReadOnlyCollection<string>The names of the layers to merge.
targetstringThe name of the layer they go into.
Returns
- CadEditResult
What came of it; refused, nothing changed, where a layer is not in the drawing, is the target itself, 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 moved. 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, the names or the target is null.