Core & Document
Document lifecycle: create / destroy drawings, refresh the display, global queries.
15 functions.
CadCompressCompacts the drawing database in memory (reclaims erased-entity slack).
CadCreateCreates a new, empty drawing and returns its handle.
CadDestroyDestroys the drawing and releases every entity, window and resource belonging to it.
CadExpandPre-allocates database capacity ahead of bulk entity creation.
CadFileNewNew empty drawing in-place (Vecad CadFileNew = CadPurge CAD_CLEAR_ALL): erase every entity, reset dirty + filename.
CadFileOpenLoad a DXF into the document (merges into the current contents).
CadFileOpenMemLoads a drawing from an in-memory, NUL-terminated DXF buffer.
CadFileSaveSave to the stored filename (set on open / save-as / CadPutFileName).
CadFileSaveAsFile save as.
CadFileSaveMemDXF to a memory buffer; returns the byte size (copies up to MaxSize).
CadFireLoadSaveEventHost-driven file load/save progress notification (Vecad CadFireLoadSaveEvent): the host calls this to drive the LoadSave callback (mode 0 = load, 1 = save) — e.g.
CadGetNumEntitiesLast-error reporting (Vecad CadGetError/ErrorStr).
CadGetVersionLibrary version: returns a numeric version + writes a version string.
CadRegenRegenerate = repaint the OpenGL view (yucad renders analytically, so there is no GDI display-list to rebuild — an update() is the equivalent).
CadUpdateRedraws the drawing in all attached windows — call after adding or editing entities.