Table of Contents

Method DeleteUnusedTables

Namespace
VectorDraw.Professional.vdObjects
Assembly
VectorDraw.Professional.dll

DeleteUnusedTables(vdLayers, vdBlocks, vdDimstyles, vdLineTypes, vdTextstyles, vdImages, vdHatchPatterns)

This method should be used in order to delete multiple primaries objects. It is much faster than setting Deleted = true to the primary directly.

public void DeleteUnusedTables(vdLayers layers, vdBlocks blocks, vdDimstyles dimstyles, vdLineTypes linetypes, vdTextstyles textstyles, vdImages images, vdHatchPatterns hatchpatterns)

Parameters

layers vdLayers

A vdLayers collection that contains the layers to be deleted or null if layers are not needed to be checked.

blocks vdBlocks

A vdBlocks collection that contains the blocks to be deleted or null if blocks are not needed to be checked.

dimstyles vdDimstyles

A vdDimstyles collection that contains the dimstyles to be deleted or null if dimstyles are not needed to be checked.

linetypes vdLineTypes

A vdLineTypes collection that contains the linetypes to be deleted or null if linetypes are not needed to be checked.

textstyles vdTextstyles

A vdTextstyles collection that contains the textstyles to be deleted or null if textstyles are not needed to be checked.

images vdImages

A vdImages collection that contains the images to be deleted or null if Image definitions are not needed to be checked.

hatchpatterns vdHatchPatterns

A vdHatchPatterns collection that contains the hatchpatterns to be deleted or null if hatch patterns are not needed to be checked.

Examples

Delete all layers with their entities that start with name VULCAN

vdDocument doc = vdFramedControl.BaseControl.ActiveDocument;
doc.UndoHistory.StoreUndoGroup(true);
vdLayers layers = new vdLayers();
foreach (vdLayer layer in doc.Layers)
{
    if (!layer.Name.StartsWith("VULCAN")) continue;
    foreach (vdFigure fig in layer.GetReferenceObjects()) fig.Deleted = true;
    layers.AddItem(layer);
}
doc.DeleteUnusedTables(layers, null, null, null, null, null, null);
doc.UndoHistory.StoreUndoGroup(false);