Class DxfUnknownEntity
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
An entity of a type the library has no class for, such as a REGION, a SHAPE or an ACAD_PROXY_ENTITY: kept as the file has it, its groups read as they are, its look editable and the entity erasable.
public sealed class DxfUnknownEntity : DxfEntity
- Inheritance
-
DxfUnknownEntity
- Inherited Members
Remarks
Its Layer, colour, linetype, lineweight and visibility are set as any entity's are, every other group of its record kept as it was; its geometry is not changed, so TransformBy(GeoTransform3) is refused, but for an MLINE, which a transformation that scales alike moves (DxfMlineBuilder builds one), and a REGION, whose ACIS data is written anew for the body it becomes (a move, a turn, a scale or a mirror). It is copied as it is by Clone(), and by GetTransformedCopy(GeoTransform3) with the identity. GetGeometry() gives what DxfReader reads of it, nothing for a type it does not read. An MLINE is exploded into its lines and caps, and a MESH into the 3DFACEs of its faces (Explode()).
Properties
- Groups
Gets every group of the entity's record, in the order of the file, after the group 0 that names its type, each value the text the file prints; a new list on each call. Of a POLYLINE they run on through its vertices and of an INSERT through its attributes, each opened by its own group 0. A comment (999) is not among them, though the file keeps it.
Methods
- CreateRegion(DxfRegionShape, DxfDatabase)
Makes a REGION of a shape, for a drawing: its ACIS data written as AutoCAD 2021 writes it for the drawing's version, SAT text in the groups of the entity for R2000 to R2010 (version 400 of ACIS for R2000, ASM 208, 212 and 215 for R2004, R2007 and R2010) and, for R2013 and R2018, SAB in the data store of the file (the section ACDSDATA, which AppendEntity(DxfEntity) writes the record of), the entity naming its data by a GUID.
- Explode()
Gets the entities an MLINE breaks into, as AutoCAD's
Explode, as ezdxf'svirtual_entitiesgives them, from the geometry its record holds and the MLINESTYLE it names: for an open one its start caps, then a LINE for each element along each segment, the miter lines at each joint where its style draws them, then its end caps. A cap across the elements is two LINEs, from the outer elements to the point halfway between them; an outer cap a half circle from the outer element on the left round to the one on the right, two quarter ARCs where their colours differ; inner arcs join each pair of inner elements, the second and the last but one, the third and the last but two, as AutoCAD's MLSTYLE draws them. A LINE has the element's colour and linetype, an ARC its colour, each the MLINE's look besides, its true colour left off. An element broken along a segment (MLEDIT) gives a LINE for each piece left, and caps the MLINE leaves off (flags 4 and 8 of its group 71) are not drawn; a line of no length is left out, and the fill of a filled style too. The MLINE of the style Standard, two elements 0.5 either side, through four vertices gives six LINEs. A MESH not smoothed (level 0) breaks into a 3DFACE for each face, in the order of its list of faces, each with the MESH's look and every edge drawn, as AutoCAD's EXPLODE breaks one and ezdxf'sMeshBuilderrenders it: a face of four corners a 3DFACE of them, of three one ending on its third; a cube 10 by 10 by 10 of eight vertices and six faces gives six 3DFACEs. A face of more than four corners breaks into a strip of triangles, as AutoCAD 2021'sExplodebreaks one: from two corners on, the rest taken by turns from the far end and the near one, each triangle after the first the other way round; from the face's first two corners, or from its last two back the other way where it faces into a closed MESH whose other faces face out, as AutoCAD turns every face of a closed mesh to face out. The face of the corners 0 to 4 alone, or one of an open MESH, gives the triangles (0, 1, 4), (2, 4, 1) and (4, 2, 3), and as the base of a pyramid facing up into it (4, 3, 0), (2, 0, 3) and (0, 2, 1); of 0 to 5, (0, 1, 5), (2, 5, 1), (5, 2, 4) and (3, 4, 2) alone and (5, 4, 0), (3, 0, 4), (0, 3, 1) and (2, 1, 3) as such a base. A face of four corners or three that faces into a closed MESH is turned as well, its corners read from its last back, as AutoCAD 2021 explodes one: the square base (0, 1, 2, 3) of a pyramid facing up into it gives the 3DFACE of (3, 2, 1, 0), a side (0, 3, 4) facing in (4, 3, 0); every other is given as the file holds it. A face given a colour of its own (an override of the MESH, its subentity 1 the first face) keeps it on its 3DFACEs, as AutoCAD keeps it. A MESH smoothed, and one that gives a face a material or a transparency of its own, or an edge or a vertex anything of its own, is refused. A REGION breaks into the curves of its loops, a hole before the loop it is cut from, as AutoCAD's Explode gives them: a box 40 by 30 with a circular hole gives a circle and four lines, a stadium two lines and two arcs, each with the REGION's look; a REGION of several faces (the union of two regions far apart) breaks into a REGION for each face, as AutoCAD's does, and its arcs run counter-clockwise about the face's normal. Any other type refuses: a 3DSOLID, a BODY and a surface, which AutoCAD breaks with its solid modeler, and every type AutoCAD does not break.
- GetRegionShape()
Gets the shape of a REGION: its loops and its area and perimeter, read from the ACIS data it holds, the SAT text of its groups or the SAB of the data store of its file (the section ACDSDATA); null for an entity of another type, for a REGION whose data is not there or not readable, and for one whose body is not flat faces of lines and arcs of ellipses.
- SetRegionShape(DxfRegionShape)
Gives a REGION another shape in place, its handle, owner, layer and look kept, as AutoCAD's
BooleanOperationleaves the first region of a union: the ACIS data is written anew for the drawing's version, in the SAT groups or in the record of the data store the region already has.