Exploding Entities

Some entities can be exploded, or decomposed, into a set of simpler elements. The specific behavior depends on the class. For example, boxes can be exploded into regions, then lines. Polylines can be exploded into line segments. An mtext entity can be exploded into a separate text entity for each line of the original object. An mline entity can be exploded into individual lines. When you explode a block reference, AutoCAD copies all entities in the block reference and then splits them into their components.

The explode() function creates an array of objects derived from AcDbEntity.

The following table shows what happens when you explode each entity, when it is by itself and when it is in a block insert that is nonuniformly scaled.

Exploding entities 

   

Entity

By Itself

Nonuniform Scaling (when in a block)

AcDb3dSolid

Regions, bodies

NA; can't be exploded

AcDb2dPolyline

Lines, arcs

Self/NA

AcDb3dPolyline

Lines

Self

AcDbArc

Self

Ellipse

AcDbAssocArray

Curves (splines, lines, arcs, circles), blocks, text, and other standard or custom objects

NA

AcDbBody

Regions, bodies

NA

AcDbCircle

Self

Ellipse

AcDbDimension

Solids, lines, text strings, points

NA

AcDbEllipse

Self

Self

AcDbLeader

Self

NA

AcDbLine

Self

Self

AcDbRay

Self

Self

AcDbSpline

Self

Self

AcDbXline

Self

Self

AcDbFace

Self

Self

AcDbMline

Lines

Self

AcDbMText

One text entity for each line

Self

AcDbPoint

Self

Self

AcDbPolyFaceMesh

AcDbFace

Self

AcDbPolygonMesh

Self

Self

AcDbRegion

Curves (splines, lines, arcs, circles)

NA

AcDbShape

Self

Self

AcDbSolid

Self

Self

AcDbText

Self

Self

AcDbTrace

Self

Self

The explode() function is a read-only function that does not modify the original entity. It returns a set of entities for the application to handle as desired. One potential use of this function is to explode a complex entity to produce simpler entities and then operate on those entities. For example, if you were implementing an intersectForPoints() function for a polyline, it might be easier to deal with the individual pieces of the polyline rather than the complete entity.

The following statements are true for the EXPLODE command (but not for the explode() function):