Method Purge
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
Purge(IReadOnlyList<DxfDBObject>)
Keeps of objects those nothing uses, as AutoCAD's Purge leaves in its collection the ids that can be erased:
each object no hard reference names, as CountHardReferences(IReadOnlyList<DxfDBObject>, int[]) counts them, and that AutoCAD does not keep
itself. AutoCAD keeps layer 0 and Defpoints, the linetypes ByBlock, ByLayer and Continuous, the text style Standard
and every style of a file of shapes (70 of 1), the dimension style, multiline style, multileader style and table
style Standard, the materials Global, ByLayer and ByBlock, the plot style Normal, every visual style, the variables of
a dictionary of variables (DICTIONARYVAR) and those of images and of wipeouts, the blocks of the layouts, the external
references and every record one brought (a name with a | in it), the tables, the named object dictionary and the
dictionaries it names; and an entity, owned by its block, is never one to purge. A layer, a linetype or a block that
any pointer of the drawing names, a soft one too, as a 330 of an XRECORD's data, is kept, as its own Erase
refuses it.
public IReadOnlyList<DxfDBObject> Purge(IReadOnlyList<DxfDBObject> ids)
Parameters
idsIReadOnlyList<DxfDBObject>The objects, of this drawing and not erased.
Returns
- IReadOnlyList<DxfDBObject>
Those of them nothing uses, in their order.
Remarks
The objects are not erased. A layer, a linetype, a dimension style, a block, an XRECORD or a GROUP given back is
erased by its own Erase, which refuses none of them: a handle of the extended data of any application counts
as a hard reference, and a record a soft pointer names is kept, as Erase refuses both. A text style, an
MLINESTYLE, a MATERIAL, a DICTIONARYVAR and the other objects of the OBJECTS section the library does not erase yet: their Erase throws
NotSupportedException. A reference from an object given counts as any other, as AutoCAD counts it, so
that a linetype only a layer given draws with is kept until that layer is erased and the purge run again.
db.Purge(db.LayerTable.Cast<DxfDBObject>().ToList()) of a drawing whose layers are 0, steel with a line on
it and an empty one gives the empty one.
Exceptions
- ArgumentNullException
Thrown when the objects are null.
- ArgumentException
Thrown when an object is null, erased or not of this drawing.