Supported Entities

// 13 DXF entity types parsed and rendered

@cadview supports the most common DXF entity types covering geometry, text, block references, dimensions, and fill patterns.

Geometry

LINE

A straight line segment between two points.

PropertyTypeDescription
startPoint3DStart point
endPoint3DEnd point

CIRCLE

A full circle defined by center and radius.

PropertyTypeDescription
centerPoint3DCenter point
radiusnumberRadius

ARC

A circular arc segment.

PropertyTypeDescription
centerPoint3DCenter point
radiusnumberRadius
startAnglenumberStart angle in degrees
endAnglenumberEnd angle in degrees

ELLIPSE

A full or partial ellipse.

PropertyTypeDescription
centerPoint3DCenter point
majorAxisPoint3DEndpoint of major axis (relative to center)
minorRationumberRatio of minor to major axis (0โ€“1)
startParamnumberStart parameter in radians
endParamnumberEnd parameter in radians

LWPOLYLINE

A lightweight polyline with optional arc segments (bulge factor).

PropertyTypeDescription
verticesDxfLwPolylineVertex[]Vertex list with x, y, bulge, widths
closedbooleanWhether the polyline is closed
constantWidthnumberConstant width for all segments
elevationnumberZ elevation

POLYLINE

A 2D or 3D polyline (legacy format).

PropertyTypeDescription
verticesDxfLwPolylineVertex[]Vertex list
closedbooleanWhether the polyline is closed
is3dbooleanWhether this is a 3D polyline

SPLINE

A B-spline (NURBS) curve.

PropertyTypeDescription
degreenumberSpline degree
knotsnumber[]Knot vector
controlPointsPoint3D[]Control points
fitPointsPoint3D[]Fit points
weightsnumber[]Control point weights

POINT

A single point in space.

PropertyTypeDescription
positionPoint3DPoint coordinates

Text

TEXT

Single-line text.

PropertyTypeDescription
textstringText content
insertionPointPoint3DInsertion point
heightnumberText height
rotationnumberRotation in degrees
stylestringText style name
hAlignnumberHorizontal alignment (0โ€“5)
vAlignnumberVertical alignment (0โ€“3)

MTEXT

Multi-line formatted text. May contain MTEXT format codes (e.g., \P for paragraph break, \fArial; for font changes). Format codes are stripped during rendering.

PropertyTypeDescription
textstringText with format codes
insertionPointPoint3DInsertion point
heightnumberText height
widthnumberText box width
attachmentPointnumberAttachment point (1โ€“9)
rotationnumberRotation in degrees
stylestringText style name

References

INSERT

A block reference (instance of a block definition). Supports scale, rotation, and MINSERT grids.

PropertyTypeDescription
blockNamestringReferenced block name
insertionPointPoint3DInsertion point
scaleXnumberX scale factor
scaleYnumberY scale factor
scaleZnumberZ scale factor
rotationnumberRotation in degrees
columnCountnumberGrid columns (MINSERT)
rowCountnumberGrid rows (MINSERT)
columnSpacingnumberColumn spacing
rowSpacingnumberRow spacing
attribsDxfAttrib[]Block attributes

DIMENSION

A dimension annotation. Rendered via its associated anonymous block.

PropertyTypeDescription
blockNamestringAnonymous block containing dimension geometry
dimStylestringDimension style name
dimTypenumberDimension type flags
defPointPoint3DDefinition point
textMidpointPoint3DText midpoint
textOverridestringOverride text (empty = auto-calculated)

Fill

HATCH

A filled region with boundary paths. Supports solid fills and hatch patterns.

PropertyTypeDescription
patternNamestringHatch pattern name (e.g., "SOLID")
solidFillbooleanWhether this is a solid fill
boundaryPathsDxfHatchBoundaryPath[]Boundary path definitions
patternAnglenumberPattern rotation angle
patternScalenumberPattern scale

Boundary paths can be either polyline-based or edge-based (composed of LINE, ARC, ELLIPSE, and SPLINE edges).

Common Properties

All entities share these base properties:

PropertyTypeDescription
typestringEntity type discriminant
handlestring?Unique entity handle
layerstringLayer name
colornumberACI color (0=BYBLOCK, 256=BYLAYER, 1โ€“255=direct)
trueColornumber?24-bit RGB color
lineTypestringLine type name
lineTypeScalenumberLine type scale factor
lineWeightnumberLine weight
visiblebooleanVisibility flag
extrusionPoint3DOCS normal vector