yucad C API
A modern, 64-bit, OpenGL-rendered 2D CAD engine
exposed as a flat C ABI — a drop-in replacement for the legacy Vecad.dll.
yucad is a standalone Windows DLL (yucad.dll) that draws, edits and
persists 2D CAD drawings. It owns its own OpenGL viewport, its own command state
machine (draw, snap, rubber-band preview), its own entity/layer/block model, and
its own DXF reader/writer. A host application — written in C, C++, Delphi, C#,
or anything that can call a __stdcall DLL — drives it entirely through
integer handles and plain C types. No C++ objects, no STL, and no Qt types ever
cross the boundary.
The API surface deliberately mirrors the classic Vecad library:
same function names (CadCreate, CadAddLine,
CadCmdStart…), same constant values, same calling convention.
An application already written against Vecad migrates by swapping the DLL —
the source barely changes.
What's in this documentation
Getting Started
Create a document, embed a viewport, draw your first line, save to DXF.
C ABI & Handles
Calling convention, handle model, strings, error handling, threading.
Windows & OpenGL
Two embedding modes: the Qt-backed CadWndCreate viewport and the
host-owned CadWin* offscreen-GL surface.
Entity Model
Lines, arcs, polylines, text, dimensions, blocks, images, faces — how entities, layers and blocks fit together.
Road Alignment
The CadRPlan* / CadRProf* clothoid horizontal &
parabolic vertical alignment subsystem.
Event Callbacks
Register __stdcall function pointers for mouse, selection,
command and document notifications.
DXF File I/O
What the reader and writer support: entities, styles, hatch patterns, layouts, XDATA.
Printing
Plot to printer, PDF and raster image; named plot regions.
Function Index
All ~1200 exported functions alphabetically — every one with its own page: prototype, parameters, return value, related functions.
Chapters
The API grouped by family (per entity type, layers, styles, commands, events, printing, road…), VeCAD-help style.