Entity Model
Everything you draw is an entity on a layer, optionally inside a block. Handles tie it all together.
Document · layers · blocks · entities
- A document (
hDwg) holds layers, blocks, styles and the model-space entity list. - Every entity belongs to a layer (colour, linetype, lineweight, on/off,
frozen, locked). Layer functions are the
CadAddLayer/CadLayer*family. - A block is a named group of entities. An insert places a block with a
position, scale and rotation. See
CadAddBlock/CadAddIns*.
Entity families
Each geometric type has an CadAdd* constructor plus a family of
getters/setters. The reference groups them; the essentials:
Line / Ray / XLine
CadAddLine,
CadAddRay, CadAddXline — segment and infinite lines.
Arc & Circle
CadAddArc,
CadAddCircle plus 3-point / mid-point constructors.
Polyline
CadAddPolyline /
CadAddPline with per-vertex bulges; polygon & rectangle helpers.
Text
CadAddText, CadAddMText,
CadAddWText, arc-text — with alignment (CAD_TA_*) and styles.
Ellipse & Spline
CadAddEllipse,
CadAddSpline — full/partial ellipses and rational splines.
Hatch
CadAddHatch — solid and real
pattern fills over boundary loops.
Dimensions & Leaders
CadAddDim*,
CadAddLeader — linear, aligned, radial, diametric, angular.
Image
CadAddImage — raster image reference
(JPG/PNG/BMP/…).
Face
CadAddFace — a 3-/4-corner 3DFACE with
per-edge visibility flags.
Multiline
CadAddMline — parallel-element
multilines with named styles.
Working with existing entities
Iterate the model with CadGetFirstEntity / CadGetNextEntity,
query type with CadEntityGetType (returns a CAD_ENT_*
constant), and read/modify shared attributes — layer, colour, linetype, lineweight —
through the CadEntity* family. Geometric edits (move, rotate, scale,
mirror, copy, trim, extend, offset, fillet, explode, erase) each have their own
export.
Coordinate accessors & user data
Per-type coordinate getters/setters expose the defining points of each entity
(line endpoints, arc center/radius/angles, text insertion point, …). Two opaque
string slots — CadEntityPutParkData / CadEntityPutWayData
and their getters — let a host attach its own persistent per-entity payload.
Selection
The CadSel* family manages the selection set — select by handle, by
window, all, none, invert — and the interactive pick flows through the
event callbacks.