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
layersvdLayersA vdLayers collection that contains the layers to be deleted or null if layers are not needed to be checked.
blocksvdBlocksA vdBlocks collection that contains the blocks to be deleted or null if blocks are not needed to be checked.
dimstylesvdDimstylesA vdDimstyles collection that contains the dimstyles to be deleted or null if dimstyles are not needed to be checked.
linetypesvdLineTypesA vdLineTypes collection that contains the linetypes to be deleted or null if linetypes are not needed to be checked.
textstylesvdTextstylesA vdTextstyles collection that contains the textstyles to be deleted or null if textstyles are not needed to be checked.
imagesvdImagesA vdImages collection that contains the images to be deleted or null if Image definitions are not needed to be checked.
hatchpatternsvdHatchPatternsA 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);