Table of Contents

Class CadFlatten

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

Walks the block references of a drawing, nested ones and arrays of them included, to the entities they are drawn as, each in world coordinates with the path of blocks it came out of and the transformation that placed it, the drawing left as it is. It is what EXPLODE and BURST do, repeated down the nest and kept apart from the drawing.

public static class CadFlatten
Inheritance
CadFlatten
Inherited Members

Remarks

The walk calls the library's Explode of a block reference, the same call EXPLODE and BURST make, one level at a time on copies: each copy is already placed in the world, so a block turned and scaled within another gives its pieces where the drawing shows them, a circle under a scale unlike along its axes comes out an ELLIPSE, and an inner reference that cannot hold the placing is exploded in its turn, as EXPLODE does (that inner block is then missing from Path). No second transformation code stands beside it. An array of references (MINSERT), which EXPLODE refuses, is walked cell by cell: the pieces of its first cell moved along the turned axes of the array by the spacing of the column and row, as the library moves them to measure the array.

What a piece is on layer 0, ByBlock in colour or ByBlock in linetype takes the layer, colour and linetype of the reference, all the way down, as BURST gives them. The attributes of a reference come out as entities of their own, and a constant attribute definition of a block as one with Constant; a variable definition is left out, its attribute standing in its place.

Methods

Walk(CadDocument, string)

Walks the spaces of a drawing. The entities come in the order of their handles, hexadecimal numbers taken as numbers (handle 9 before 1A), the pieces of one block reference after each other in the order of IndexPath; the drawing is not changed and no entity of it is. A walk places no more than 2 000 000 entities through block references; each reference it refuses stays as one INSERT and is named in Refused, as one nested more than 64 deep is, so that blocks nested a few deep with many references each (40 references in each of four levels is 102 million lines) cannot fill the memory.