Method Explode
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
Explode()
Gets the entities of the block placed where the INSERT puts them, as AutoCAD's Explode gives them: new
entities in no file, one level down, so that an INSERT in the block comes out an INSERT, and an ATTDEF of the block a
DxfAttributeDefinition placed as the rest are. The INSERT's ATTRIBs are not among them: their values
stay where they are, in AttributeCollection. A MINSERT of more than one cell is refused, as AutoCAD
refuses one (see Explode()).
public override IReadOnlyList<DxfEntity> Explode()
Returns
- IReadOnlyList<DxfEntity>
The entities, in the order of the block, each of its own look; to be added to a drawing by AppendEntity(DxfEntity). The INSERT of BOLT whose block holds a CIRCLE, a LINE and the ATTDEF MARK, and which gives MARK the value B-12, explodes into a DxfCircle, a DxfLine and the DxfAttributeDefinition MARK; B-12 is not among them.
Remarks
An entity whose class can be moved by the block's placing is a copy of it moved so, as GetTransformedCopy(GeoTransform3) gives it. One the placing cannot keep its class under, as a circle scaled unlike along its two axes, is made of the shapes DxfReader places of it alone, written as DxfWriter writes them, an ELLIPSE for that circle, with its look; nothing nested is placed for it. An INSERT in the block that cannot hold the placing, one turned in its block under a scale unlike along the world's axes, is exploded in its turn and its parts placed, so that what is drawn stays where it was. A type the library neither moves nor reads, as a REGION or an OLE2FRAME, is left out, and so are a MULTILEADER and an ACAD_TABLE under a placing that scales them unlike along their axes or shears them, which they do not hold.
The entities are made in a drawing of R2018: an ELLIPSE or a SPLINE that a circle or an arc comes out as under a scale unlike along its axes is refused by AppendEntity(DxfEntity) in a drawing of R12, which has no such type.
What exploding makes is counted before any INSERT of the block is exploded in its turn, and held to the bound the reader holds the INSERTs it places to, MaxPlacedEntities's 2 000 000: each entity given, and each INSERT moved or exploded on the way through the nest; past it, nothing is given. A block of 100 INSERTs, each turned by 20 degrees, of a block of 100 INSERTs turned by 10 degrees of a block of 100 lines, inserted stretched to twice its width, comes out as 1 000 000 lines, its INSERTs exploded all the way down; the same with 200 lines in the last block is refused. An INSERT that has to be exploded in its turn, of a block already being exploded further out, would have the block insert itself without end, and is refused too; one that holds the placing comes out an INSERT, as the block's other INSERTs do.
Exceptions
- ArgumentException
Thrown when an INSERT in the nest that has to be exploded in its turn is of a block already being exploded, so that the block would insert itself.
- InvalidOperationException
Thrown when exploding would make more than 2 000 000 entities, the bound of MaxPlacedEntities.
- InvalidOperationException
Thrown when the drawing has no block of the INSERT's name.