Home /Modules/api/autocad.html

autocad.html

api/sleela/3.1/version-012/package/autocad.html · 495 line(s) · html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Package autocad — SleelaDoc API</title>
<link rel="stylesheet" href="../style.css">

</head>
<body>
<header class="top">
  <div class="brand"><a href="../index.html">SleelaDoc API</a></div>
  <div class="tag">HTML documentation for the SLeeLa standard library (/lib)</div>
</header>
<div class="wrap">
<nav class="side">
  <a href="../index.html"><strong>Home</strong></a>
  <a href="../packages.html"><strong>All packages</strong></a>
  <a href="../glossary.html"><strong>Glossary</strong></a>
  <a href="../authorship.html"><strong>Authorship</strong></a>
  <h2>Packages</h2><ul>
<li><a href="../package/advantage.html">advantage</a></li>
<li><a href="../package/alphabet.html">alphabet</a></li>
<li><a href="../package/antivirus.html">antivirus</a></li>
<li><a href="../package/api.html">api</a></li>
<li><a href="../package/array.html">array</a></li>
<li><a href="../package/audio.html">audio</a></li>
<li><a href="../package/autocad.html">autocad</a></li>
<li><a href="../package/ballum.html">ballum</a></li>
<li><a href="../package/bash.html">bash</a></li>
<li><a href="../package/boolean.html">boolean</a></li>
<li><a href="../package/cdma.html">cdma</a></li>
<li><a href="../package/char.html">char</a></li>
<li><a href="../package/character.html">character</a></li>
<li><a href="../package/character-recognition.html">character-recognition</a></li>
<li><a href="../package/churn.html">churn</a></li>
<li><a href="../package/citizen.html">citizen</a></li>
<li><a href="../package/codecs.html">codecs</a></li>
<li><a href="../package/collections.html">collections</a></li>
<li><a href="../package/common-rails.html">common-rails</a></li>
<li><a href="../package/compiler.html">compiler</a></li>
<li><a href="../package/compression.html">compression</a></li>
<li><a href="../package/config.html">config</a></li>
<li><a href="../package/connector.html">connector</a></li>
<li><a href="../package/coorenagraph.html">coorenagraph</a></li>
<li><a href="../package/core.html">core</a></li>
<li><a href="../package/cpu.html">cpu</a></li>
<li><a href="../package/crypto.html">crypto</a></li>
<li><a href="../package/data.html">data</a></li>
<li><a href="../package/data-structures.html">data-structures</a></li>
<li><a href="../package/database.html">database</a></li>
<li><a href="../package/debugger.html">debugger</a></li>
<li><a href="../package/decompiler.html">decompiler</a></li>
<li><a href="../package/deliberation.html">deliberation</a></li>
<li><a href="../package/drivers.html">drivers</a></li>
<li><a href="../package/examples.html">examples</a></li>
<li><a href="../package/filesystem.html">filesystem</a></li>
<li><a href="../package/gameplay.html">gameplay</a></li>
<li><a href="../package/governance.html">governance</a></li>
<li><a href="../package/gui.html">gui</a></li>
<li><a href="../package/guidoc.html">guidoc</a></li>
<li><a href="../package/hotlink.html">hotlink</a></li>
<li><a href="../package/html.html">html</a></li>
<li><a href="../package/http.html">http</a></li>
<li><a href="../package/http-1.0.html">http-1.0</a></li>
<li><a href="../package/http-2.0.html">http-2.0</a></li>
<li><a href="../package/http-3.0.html">http-3.0</a></li>
<li><a href="../package/http-4.0.html">http-4.0</a></li>
<li><a href="../package/http-5.0.html">http-5.0</a></li>
<li><a href="../package/http-6.0.html">http-6.0</a></li>
<li><a href="../package/http-7.0.html">http-7.0</a></li>
<li><a href="../package/http-8.0.html">http-8.0</a></li>
<li><a href="../package/http-9.0.html">http-9.0</a></li>
<li><a href="../package/http-servers.html">http-servers</a></li>
<li><a href="../package/ide.html">ide</a></li>
<li><a href="../package/ide-workbench.html">ide-workbench</a></li>
<li><a href="../package/idea.html">idea</a></li>
<li><a href="../package/inference-model.html">inference-model</a></li>
<li><a href="../package/inputs.html">inputs</a></li>
<li><a href="../package/international-criminal-court.html">international-criminal-court</a></li>
<li><a href="../package/io.html">io</a></li>
<li><a href="../package/java.html">java</a></li>
<li><a href="../package/java28.html">java28</a></li>
<li><a href="../package/journey.html">journey</a></li>
<li><a href="../package/languages.html">languages</a></li>
<li><a href="../package/large-language-models.html">large-language-models</a></li>
<li><a href="../package/ledger.html">ledger</a></li>
<li><a href="../package/linux-editors.html">linux-editors</a></li>
<li><a href="../package/manifesto.html">manifesto</a></li>
<li><a href="../package/math.html">math</a></li>
<li><a href="../package/memory.html">memory</a></li>
<li><a href="../package/modules.html">modules</a></li>
<li><a href="../package/moral-capacitor.html">moral-capacitor</a></li>
<li><a href="../package/munction.html">munction</a></li>
<li><a href="../package/native.html">native</a></li>
<li><a href="../package/net.html">net</a></li>
<li><a href="../package/neural-nets.html">neural-nets</a></li>
<li><a href="../package/nordshrift.html">nordshrift</a></li>
<li><a href="../package/observer.html">observer</a></li>
<li><a href="../package/opcodes.html">opcodes</a></li>
<li><a href="../package/operating-system.html">operating-system</a></li>
<li><a href="../package/os-level-support.html">os-level-support</a></li>
<li><a href="../package/philosophers.html">philosophers</a></li>
<li><a href="../package/philosophy.html">philosophy</a></li>
<li><a href="../package/politico.html">politico</a></li>
<li><a href="../package/process.html">process</a></li>
<li><a href="../package/psychiatry.html">psychiatry</a></li>
<li><a href="../package/public.html">public</a></li>
<li><a href="../package/reflection.html">reflection</a></li>
<li><a href="../package/regex.html">regex</a></li>
<li><a href="../package/registry.html">registry</a></li>
<li><a href="../package/rmi.html">rmi</a></li>
<li><a href="../package/rrs.html">rrs</a></li>
<li><a href="../package/runtime.html">runtime</a></li>
<li><a href="../package/security.html">security</a></li>
<li><a href="../package/server-edition.html">server-edition</a></li>
<li><a href="../package/signal-processing.html">signal-processing</a></li>
<li><a href="../package/sldocument.html">sldocument</a></li>
<li><a href="../package/sleela.html">sleela</a></li>
<li><a href="../package/sleela-sql.html">sleela-sql</a></li>
<li><a href="../package/sleela-terminal.html">sleela-terminal</a></li>
<li><a href="../package/sleeladoc.html">sleeladoc</a></li>
<li><a href="../package/slrtp.html">slrtp</a></li>
<li><a href="../package/social-model.html">social-model</a></li>
<li><a href="../package/softlisten.html">softlisten</a></li>
<li><a href="../package/sommeliers.html">sommeliers</a></li>
<li><a href="../package/spatial.html">spatial</a></li>
<li><a href="../package/sst.html">sst</a></li>
<li><a href="../package/synchro.html">synchro</a></li>
<li><a href="../package/systems.html">systems</a></li>
<li><a href="../package/telephony-skya.html">telephony-skya</a></li>
<li><a href="../package/terminal.html">terminal</a></li>
<li><a href="../package/terminal_pixel.html">terminal_pixel</a></li>
<li><a href="../package/text.html">text</a></li>
<li><a href="../package/ui.html">ui</a></li>
<li><a href="../package/us-infrastructure.html">us-infrastructure</a></li>
<li><a href="../package/user-interface.html">user-interface</a></li>
<li><a href="../package/video.html">video</a></li>
<li><a href="../package/vm.html">vm</a></li>
<li><a href="../package/web-server-technology.html">web-server-technology</a></li>
<li><a href="../package/website.html">website</a></li>
<li><a href="../package/wifi.html">wifi</a></li>
<li><a href="../package/xlt.html">xlt</a></li>
<li><a href="../package/xml.html">xml</a></li>
</ul>
</nav>
<main>
<div class="crumbs"><a href="../index.html">Home</a> &rsaquo; <a href="../packages.html">Packages</a> &rsaquo; autocad</div>
<h1>Package <code>autocad</code></h1>
<div class="lead">This package contains <strong>9</strong> source unit(s) defining <strong>9</strong> class(es) / struct(s). Each unit below lists its fields (the values it stores) and methods (the actions it performs), with a plain explanation of each.</div>
<input class="search" placeholder="Filter on this page (Ctrl+F also works)…" oninput="flt(this.value)">
<h2 class="section" data-u="autocad">autocad <span class="pill syntax">#sleela 2.5</span> <span class="muted" style="font-size:13px">(lib/autocad/autocad.sleela)</span></h2>
<div data-u="autocad autocadrenderer">
<h3 id="AutoCadRenderer">AutoCadRenderer <span class="pill">class</span></h3>
<div class="meta-note">Carries the standard <strong>Metadata Class record</strong> — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.</div>
<p class="muted"><strong>Fields</strong> — the named values this unit stores.</p>
<table class="members"><tr><th>Field</th><th>Declaration</th><th>What it holds</th></tr>
<tr><td><code>walls</code></td><td><span class="sig">String walls</span></td><td class="desc">accumulated LINE entities (walls layer)</td></tr>
<tr><td><code>dims</code></td><td><span class="sig">String dims</span></td><td class="desc">accumulated dimension LINE + measured TEXT entities</td></tr>
<tr><td><code>notes</code></td><td><span class="sig">String notes</span></td><td class="desc">accumulated TEXT entities (notes layer)</td></tr>
<tr><td><code>noteCount</code></td><td><span class="sig">int noteCount</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
</table>
<p class="muted"><strong>Methods</strong> — the actions this unit can perform.</p>
<table class="members"><tr><th>Method</th><th>Signature</th><th>What it does</th></tr>
<tr><td><code>begin</code></td><td><span class="sig">void begin(String t, String u)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>grow</code></td><td><span class="sig">void grow(double x, double y)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>num</code></td><td><span class="sig">String num(double v)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>istr</code></td><td><span class="sig">String istr(int v)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>lineEntity</code></td><td><span class="sig">String lineEntity(String lyr, double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>textEntity</code></td><td><span class="sig">String textEntity(String lyr, double x, double y, double height, String value)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>distance</code></td><td><span class="sig">double distance(double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>addWall</code></td><td><span class="sig">void addWall(double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>addRoom</code></td><td><span class="sig">void addRoom(double w, double h)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>addDim</code></td><td><span class="sig">void addDim(double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>addNote</code></td><td><span class="sig">void addNote(double x, double y, String text)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>numberOf</code></td><td><span class="sig">double numberOf(int v)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>applyDirective</code></td><td><span class="sig">void applyDirective(String op, double n1, double n2, double n3, double n4, String text)</span></td><td class="desc">Apply one plan directive to the model.</td></tr>
<tr><td><code>layer</code></td><td><span class="sig">String layer(String name, int color)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>emit</code></td><td><span class="sig">String emit()</span></td><td class="desc">Serialize the whole model to AutoCAD DXF text.</td></tr>
<tr><td><code>build</code></td><td><span class="sig">String build()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>main</code></td><td><span class="sig">void main()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
</table>
</div>
<h2 class="section" data-u="slcadcommand">SLCadCommand <span class="pill syntax">#sleela 2.5</span> <span class="muted" style="font-size:13px">(lib/autocad/SLCadCommand.sleela)</span></h2>
<div data-u="slcadcommand slcadcommand">
<h3 id="SLCadCommand">SLCadCommand <span class="pill">class</span></h3>
<p class="desc">Defines SLCadCommand -- one recorded, reversible edit the AutoCAD Creator(TM) applied to a document. Every creation (line/text/dim/room) and every alteration (move/reshape/relabel/restyle/delete) is captured as a command so the Creator can keep an audit trail and offer undo: a command remembers its verb, the id of the entity it affected, and the &quot;before&quot; values needed to reverse it (prior endpoints, prior label/layer, prior alive flag). This keeps editing a first-class, inspectable operation rather than an opaque mutation -- which is exactly what makes a creator (as opposed to a one-shot renderer) possible. Family: autocad. SLeeLa owns the edit history; a command is a plain record, replayed/reversed against an SLCadDocument.</p>
<div class="meta-note">Carries the standard <strong>Metadata Class record</strong> — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.</div>
<p class="muted"><strong>Fields</strong> — the named values this unit stores.</p>
<table class="members"><tr><th>Field</th><th>Declaration</th><th>What it holds</th></tr>
<tr><td><code>CREATE</code></td><td><span class="sig">static final int CREATE  = 0</span></td><td class="desc">Verb ordinals. an entity was created (undo = delete it)</td></tr>
<tr><td><code>MOVE</code></td><td><span class="sig">static final int MOVE    = 1</span></td><td class="desc">translated by (dx,dy)</td></tr>
<tr><td><code>RESHAPE</code></td><td><span class="sig">static final int RESHAPE = 2</span></td><td class="desc">endpoints changed (before stored)</td></tr>
<tr><td><code>RELABEL</code></td><td><span class="sig">static final int RELABEL = 3</span></td><td class="desc">text value changed (before stored)</td></tr>
<tr><td><code>RESTYLE</code></td><td><span class="sig">static final int RESTYLE = 4</span></td><td class="desc">layer changed (before stored)</td></tr>
<tr><td><code>DELETE</code></td><td><span class="sig">static final int DELETE  = 5</span></td><td class="desc">tombstoned (undo = restore)</td></tr>
<tr><td><code>verb</code></td><td><span class="sig">int verb</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>entityId</code></td><td><span class="sig">int entityId</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>priorValue</code></td><td><span class="sig">String priorValue</span></td><td class="desc">RELABEL prior text</td></tr>
<tr><td><code>priorLayer</code></td><td><span class="sig">String priorLayer</span></td><td class="desc">RESTYLE prior layer</td></tr>
<tr><td><code>seq</code></td><td><span class="sig">int seq</span></td><td class="desc">Audit metadata: when the edit was applied (host-supplied) and its order in the session. seq is 1-based; stampedAt is a Julian date (0 = unstamped) and stampLabel its readable form. Stamped by the Creator via stamp().</td></tr>
<tr><td><code>stampedAt</code></td><td><span class="sig">double stampedAt</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>stampLabel</code></td><td><span class="sig">String stampLabel</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
</table>
<p class="muted"><strong>Methods</strong> — the actions this unit can perform.</p>
<table class="members"><tr><th>Method</th><th>Signature</th><th>What it does</th></tr>
<tr><td><code>stamp</code></td><td><span class="sig">void stamp(int sequence, double whenJulian, String whenText)</span></td><td class="desc">Attach the audit stamp (sequence number + host time) to this command.</td></tr>
<tr><td><code>getSeq</code></td><td><span class="sig">int getSeq()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getStampedAt</code></td><td><span class="sig">double getStampedAt()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getStampLabel</code></td><td><span class="sig">String getStampLabel()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>create</code></td><td><span class="sig">void create(int id)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>move</code></td><td><span class="sig">void move(int id, double ddx, double ddy)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>reshape</code></td><td><span class="sig">void reshape(int id, double ox1, double oy1, double ox2, double oy2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>relabel</code></td><td><span class="sig">void relabel(int id, String prior)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>restyle</code></td><td><span class="sig">void restyle(int id, String prior)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>deleted</code></td><td><span class="sig">void deleted(int id)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getVerb</code></td><td><span class="sig">int getVerb()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getEntityId</code></td><td><span class="sig">int getEntityId()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>undo</code></td><td><span class="sig">boolean undo(SLCadDocument doc)</span></td><td class="desc">Reverse this command against `doc`. Returns true when something changed.</td></tr>
<tr><td><code>describe</code></td><td><span class="sig">String describe()</span></td><td class="desc">A short, human-readable description for a history/log view.</td></tr>
<tr><td><code>describeAt</code></td><td><span class="sig">String describeAt()</span></td><td class="desc">The same description prefixed with the audit stamp, for a timeline view: &quot;#3 @ 2026-10-13T18:00Z move #7&quot;</td></tr>
</table>
</div>
<h2 class="section" data-u="slcadcreator">SLCadCreator <span class="pill syntax">#sleela 2.5</span> <span class="muted" style="font-size:13px">(lib/autocad/SLCadCreator.sleela)</span></h2>
<div data-u="slcadcreator slcadcreator">
<h3 id="SLCadCreator">SLCadCreator <span class="pill">class</span></h3>
<p class="desc">Defines SLCadCreator -- the AutoCAD Creator(TM): the SLeeLa facade a front end drives to CREATE and ALTER 2D AutoCAD documents and then SAVE them as DXF. It owns an editable SLCadDocument, a current selection (the id a GUI tool acts on), the active layer, and a bounded command history so every create/alter/delete is recorded and undoable. Creation builders (line/wall/room/dim/note) each record a CREATE command; alteration verbs (move/reshape/relabel/restyle/delete) snapshot the prior state before mutating so undo() can reverse them. save() asks the document for the full DXF text. This is the authoritative editing brain; the SleelaUI GUI (autocad/creator) is only a surface that issues these intents and previews the result -- JavaFX never computed geometry here, and neither does SleelaUI. Family: autocad. SLeeLa owns the document, the edits, and the history; a front end selects, creates, alters, and saves through this object.</p>
<div class="meta-note">Carries the standard <strong>Metadata Class record</strong> — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.</div>
<p class="muted"><strong>Fields</strong> — the named values this unit stores.</p>
<table class="members"><tr><th>Field</th><th>Declaration</th><th>What it holds</th></tr>
<tr><td><code>MAX_HISTORY</code></td><td><span class="sig">static final int MAX_HISTORY = 4096</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>doc</code></td><td><span class="sig">SLCadDocument doc</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>selection</code></td><td><span class="sig">int selection</span></td><td class="desc">currently selected entity id (-1 = none)</td></tr>
<tr><td><code>activeLayer</code></td><td><span class="sig">String activeLayer</span></td><td class="desc">layer new geometry lands on by default</td></tr>
<tr><td><code>history</code></td><td><span class="sig">SLCadCommand[] history</span></td><td class="desc">recorded edits (for undo + audit)</td></tr>
<tr><td><code>historyCount</code></td><td><span class="sig">int historyCount</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>nowJulian</code></td><td><span class="sig">double nowJulian</span></td><td class="desc">---- clock (host-supplied) ---------------------------------------------- The runtime has no live wall-clock, so the host feeds time in. `nowJulian` is the current time as a Julian date (AutoCAD&#x27;s $TDCREATE/$TDUPDATE unit) and `nowLabel` a readable form; every edit stamps the document and the command it records. Left at 0/&quot;&quot; (the default), timestamping is inert and output is byte-identical to the pre-timestamp Creator.</td></tr>
<tr><td><code>nowLabel</code></td><td><span class="sig">String nowLabel</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
</table>
<p class="muted"><strong>Methods</strong> — the actions this unit can perform.</p>
<table class="members"><tr><th>Method</th><th>Signature</th><th>What it does</th></tr>
<tr><td><code>setClock</code></td><td><span class="sig">void setClock(double whenJulian, String whenText)</span></td><td class="desc">Advance the Creator&#x27;s clock. A host calls this before an edit (or once per UI frame) so subsequent edits carry the given time.</td></tr>
<tr><td><code>clock</code></td><td><span class="sig">double clock()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>clockLabel</code></td><td><span class="sig">String clockLabel()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>newDocument</code></td><td><span class="sig">void newDocument(String title, String units)</span></td><td class="desc">Start a fresh, empty document (no creation timestamp).</td></tr>
<tr><td><code>newDocumentAt</code></td><td><span class="sig">void newDocumentAt(String title, String units, double createdJulian, String createdText)</span></td><td class="desc">Start a fresh document stamped with a host-supplied creation time.</td></tr>
<tr><td><code>document</code></td><td><span class="sig">SLCadDocument document()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>selected</code></td><td><span class="sig">int selected()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>hasSelection</code></td><td><span class="sig">boolean hasSelection()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>select</code></td><td><span class="sig">void select(int id)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>deselect</code></td><td><span class="sig">void deselect()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>layer</code></td><td><span class="sig">String layer()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>setLayer</code></td><td><span class="sig">void setLayer(String lyr)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>setAt</code></td><td><span class="sig">void setAt(double x, double y)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>line</code></td><td><span class="sig">int line(double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>wall</code></td><td><span class="sig">int wall(double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>room</code></td><td><span class="sig">int room(double w, double h, String name)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>dimension</code></td><td><span class="sig">int dimension(double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>note</code></td><td><span class="sig">int note(double x, double y, String text)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>text</code></td><td><span class="sig">int text(double x, double y, String value, double height)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>created</code></td><td><span class="sig">int created(int id)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>move</code></td><td><span class="sig">boolean move(int id, double dx, double dy)</span></td><td class="desc">Move the current selection (or a specific id) by (dx,dy).</td></tr>
<tr><td><code>moveSelection</code></td><td><span class="sig">boolean moveSelection(double dx, double dy)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>reshape</code></td><td><span class="sig">boolean reshape(int id, double x1, double y1, double x2, double y2)</span></td><td class="desc">Re-point a line/dim&#x27;s endpoints (prior endpoints captured for undo).</td></tr>
<tr><td><code>relabel</code></td><td><span class="sig">boolean relabel(int id, String text)</span></td><td class="desc">Change a text/dim label (prior value captured for undo).</td></tr>
<tr><td><code>restyle</code></td><td><span class="sig">boolean restyle(int id, String layer)</span></td><td class="desc">Move an entity onto a different layer (prior layer captured for undo).</td></tr>
<tr><td><code>delete</code></td><td><span class="sig">boolean delete(int id)</span></td><td class="desc">Delete (tombstone) an entity; clears the selection if it was selected.</td></tr>
<tr><td><code>deleteSelection</code></td><td><span class="sig">boolean deleteSelection()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>pickAt</code></td><td><span class="sig">int pickAt(double x, double y, double radius)</span></td><td class="desc">Turn a canvas click (model coordinates) into a selection.</td></tr>
<tr><td><code>edits</code></td><td><span class="sig">int edits()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>lastCommand</code></td><td><span class="sig">SLCadCommand lastCommand()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>lastDescription</code></td><td><span class="sig">String lastDescription()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>undo</code></td><td><span class="sig">boolean undo()</span></td><td class="desc">Reverse the most recent recorded edit. Returns true if one was undone.</td></tr>
<tr><td><code>logEdit</code></td><td><span class="sig">void logEdit(SLCadCommand c)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>makeCreate</code></td><td><span class="sig">SLCadCommand makeCreate(int id)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>makeMove</code></td><td><span class="sig">SLCadCommand makeMove(int id, double dx, double dy)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>makeReshape</code></td><td><span class="sig">SLCadCommand makeReshape(int id, double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>makeRelabel</code></td><td><span class="sig">SLCadCommand makeRelabel(int id, String prior)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>makeRestyle</code></td><td><span class="sig">SLCadCommand makeRestyle(int id, String prior)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>makeDelete</code></td><td><span class="sig">SLCadCommand makeDelete(int id)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>inspect</code></td><td><span class="sig">String inspect(int id)</span></td><td class="desc">One-line description of an entity by id (&quot;&quot; if there is no such entity). The GUI property strip and any audit view read this to show WHAT a given id is -- its kind, layer, geometry, and label.</td></tr>
<tr><td><code>inspectSelection</code></td><td><span class="sig">String inspectSelection()</span></td><td class="desc">The currently selected entity, described (or a hint when nothing is picked).</td></tr>
<tr><td><code>listEntities</code></td><td><span class="sig">String listEntities()</span></td><td class="desc">A newline-separated listing of every entity currently in the document (alive and tombstoned), newest slots last. Suitable for a report pane.</td></tr>
<tr><td><code>listHistory</code></td><td><span class="sig">String listHistory()</span></td><td class="desc">A newline-separated listing of the recorded edit history, each line carrying its sequence number and timestamp -- the time-ordered audit trail.</td></tr>
<tr><td><code>report</code></td><td><span class="sig">String report()</span></td><td class="desc">A full inspection report: document metadata (title, units, timestamps, counts) followed by the entity listing and the edit history. This is the &quot;inspect the AutoCAD content&quot; surface a report pane or a headless run dumps.</td></tr>
<tr><td><code>stampText</code></td><td><span class="sig">String stampText(String label, double julian)</span></td><td class="desc">Render a timestamp for the report: prefer the readable label, fall back to the Julian value, and say &quot;unset&quot; when the host supplied no time.</td></tr>
<tr><td><code>applyDirective</code></td><td><span class="sig">void applyDirective(String op, double n1, double n2, double n3, double n4, String text)</span></td><td class="desc">Apply one FORMAT.md directive to the document, so a .plan or the GUI&#x27;s plan editor can seed a drawing the creator then edits. Mirrors the directive vocabulary of lib/autocad/SLCadPlan + autocad/cad/plan.sleela.</td></tr>
<tr><td><code>save</code></td><td><span class="sig">String save()</span></td><td class="desc">Produce the full AutoCAD DXF for the current document. The GUI&#x27;s Save action hands this to the host to write to a .dxf file; the runnable build prints it (exactly as the one-shot renderer persists its output).</td></tr>
<tr><td><code>summary</code></td><td><span class="sig">String summary()</span></td><td class="desc">A one-line status summary for a GUI status bar.</td></tr>
</table>
</div>
<h2 class="section" data-u="slcaddocument">SLCadDocument <span class="pill syntax">#sleela 2.5</span> <span class="muted" style="font-size:13px">(lib/autocad/SLCadDocument.sleela)</span></h2>
<div data-u="slcaddocument slcaddocument">
<h3 id="SLCadDocument">SLCadDocument <span class="pill">class</span></h3>
<p class="desc">Defines SLCadDocument -- the editable 2D AutoCAD document the</p>
<div class="meta-note">Carries the standard <strong>Metadata Class record</strong> — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.</div>
<p class="muted"><strong>Fields</strong> — the named values this unit stores.</p>
<table class="members"><tr><th>Field</th><th>Declaration</th><th>What it holds</th></tr>
<tr><td><code>MAX_ENTITIES</code></td><td><span class="sig">static final int MAX_ENTITIES = 8192</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>title</code></td><td><span class="sig">String title</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>units</code></td><td><span class="sig">String units</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>items</code></td><td><span class="sig">SLCadEntity[] items</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>count</code></td><td><span class="sig">int count</span></td><td class="desc">number of slots used (alive + tombstoned)</td></tr>
<tr><td><code>nextId</code></td><td><span class="sig">int nextId</span></td><td class="desc">monotonic id source</td></tr>
<tr><td><code>createdAt</code></td><td><span class="sig">double createdAt</span></td><td class="desc">---- timestamps --------------------------------------------------------- Time is supplied by the host (there is no live wall-clock in the runtime), so the engine stays deterministic. A timestamp is carried as a Julian date (AutoCAD&#x27;s $TDCREATE/$TDUPDATE unit, group code 40) plus a human-readable label the inspection/report API prints. createdAt is set once at begin(); updatedAt advances on every mutation via touch(). Julian date the document was created (0 = unset)</td></tr>
<tr><td><code>updatedAt</code></td><td><span class="sig">double updatedAt</span></td><td class="desc">Julian date of the most recent edit (0 = unset)</td></tr>
<tr><td><code>createdLabel</code></td><td><span class="sig">String createdLabel</span></td><td class="desc">readable creation stamp (e.g. &quot;2026-10-13T18:00Z&quot;)</td></tr>
<tr><td><code>updatedLabel</code></td><td><span class="sig">String updatedLabel</span></td><td class="desc">readable last-update stamp</td></tr>
<tr><td><code>writer</code></td><td><span class="sig">SLCadDxf writer</span></td><td class="desc">the DXF section wrapper (reused)</td></tr>
</table>
<p class="muted"><strong>Methods</strong> — the actions this unit can perform.</p>
<table class="members"><tr><th>Method</th><th>Signature</th><th>What it does</th></tr>
<tr><td><code>begin</code></td><td><span class="sig">void begin(String t, String u)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>beginAt</code></td><td><span class="sig">void beginAt(String t, String u, double createdJulian, String createdText)</span></td><td class="desc">Begin a document and record its creation timestamp (Julian date + label). A zero/empty timestamp means &quot;unset&quot; and no $TDCREATE/$TDUPDATE is emitted, so existing callers of begin() are byte-compatible with the old output.</td></tr>
<tr><td><code>getTitle</code></td><td><span class="sig">String getTitle()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getUnits</code></td><td><span class="sig">String getUnits()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>setTitle</code></td><td><span class="sig">void setTitle(String t)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>setUnits</code></td><td><span class="sig">void setUnits(String u)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>setAt</code></td><td><span class="sig">void setAt(double x, double y)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getCreatedAt</code></td><td><span class="sig">double getCreatedAt()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getUpdatedAt</code></td><td><span class="sig">double getUpdatedAt()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getCreatedLabel</code></td><td><span class="sig">String getCreatedLabel()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getUpdatedLabel</code></td><td><span class="sig">String getUpdatedLabel()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>touch</code></td><td><span class="sig">void touch(double whenJulian, String whenText)</span></td><td class="desc">Record that the document changed at the given host-supplied time. The Creator calls this after each create/alter/delete so $TDUPDATE and the readable label track the last edit. Called with (0, &quot;&quot;) it is a no-op, which keeps timestamp-unaware callers unchanged.</td></tr>
<tr><td><code>addLine</code></td><td><span class="sig">int addLine(String layer, double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>addText</code></td><td><span class="sig">int addText(String layer, double x, double y, String value, double height)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>addDim</code></td><td><span class="sig">int addDim(String layer, double x1, double y1, double x2, double y2, double height)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>addWall</code></td><td><span class="sig">int addWall(double x1, double y1, double x2, double y2)</span></td><td class="desc">A wall is a line on the &quot;walls&quot; layer.</td></tr>
<tr><td><code>addNote</code></td><td><span class="sig">int addNote(double x, double y, String text)</span></td><td class="desc">A note is text on the &quot;notes&quot; layer at a default height.</td></tr>
<tr><td><code>addDimension</code></td><td><span class="sig">int addDimension(double x1, double y1, double x2, double y2)</span></td><td class="desc">A dimension on the &quot;dims&quot; layer with the standard label height.</td></tr>
<tr><td><code>addRoom</code></td><td><span class="sig">int addRoom(double w, double h, String name)</span></td><td class="desc">Expand a room (w x h) at the current insertion point into four walls and a centred label; returns the id of the first (south) wall so a caller can locate the room.</td></tr>
<tr><td><code>store</code></td><td><span class="sig">int store(SLCadEntity e)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>size</code></td><td><span class="sig">int size()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>at</code></td><td><span class="sig">SLCadEntity at(int index)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>indexOfId</code></td><td><span class="sig">int indexOfId(int id)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>byId</code></td><td><span class="sig">SLCadEntity byId(int id)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>aliveCount</code></td><td><span class="sig">int aliveCount()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>pick</code></td><td><span class="sig">int pick(double x, double y, double radius)</span></td><td class="desc">Hit test: the id of the live entity whose anchor/first point is nearest to (x,y) within `radius`, or -1. Lets a GUI turn a click into a selection.</td></tr>
<tr><td><code>dist</code></td><td><span class="sig">double dist(double ax, double ay, double bx, double by)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>sqrtApprox</code></td><td><span class="sig">double sqrtApprox(double v)</span></td><td class="desc">A dependency-free square root (Newton&#x27;s method) so hit testing needs no import beyond this class; converges fast for the magnitudes CAD uses.</td></tr>
<tr><td><code>move</code></td><td><span class="sig">boolean move(int id, double dx, double dy)</span></td><td class="desc">Move an entity by (dx,dy). Returns true if it existed and is alive.</td></tr>
<tr><td><code>reshape</code></td><td><span class="sig">boolean reshape(int id, double x1, double y1, double x2, double y2)</span></td><td class="desc">Re-point a line/dim&#x27;s endpoints.</td></tr>
<tr><td><code>moveTo</code></td><td><span class="sig">boolean moveTo(int id, double x, double y)</span></td><td class="desc">Move a point-anchored entity (TEXT) or a line&#x27;s first point.</td></tr>
<tr><td><code>relabel</code></td><td><span class="sig">boolean relabel(int id, String text)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>restyle</code></td><td><span class="sig">boolean restyle(int id, String layer)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>remove</code></td><td><span class="sig">boolean remove(int id)</span></td><td class="desc">Soft-delete (tombstone) / restore -- ids stay stable across the edit.</td></tr>
<tr><td><code>restore</code></td><td><span class="sig">boolean restore(int id)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>minX</code></td><td><span class="sig">double minX()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>maxX</code></td><td><span class="sig">double maxX()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>minY</code></td><td><span class="sig">double minY()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>maxY</code></td><td><span class="sig">double maxY()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>boundX</code></td><td><span class="sig">double boundX(boolean wantMin)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>boundY</code></td><td><span class="sig">double boundY(boolean wantMin)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>fold</code></td><td><span class="sig">double fold(double acc, double v, boolean wantMin, boolean seen)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>toDxf</code></td><td><span class="sig">String toDxf()</span></td><td class="desc">Emit the whole document as AutoCAD DXF (R12 text) with the current extents. This is what the Creator&#x27;s Save produces; a host writes it to a .dxf file (or the runnable `main` prints it, as the renderer does).</td></tr>
</table>
</div>
<h2 class="section" data-u="slcaddxf">SLCadDxf <span class="pill syntax">#sleela 2.5</span> <span class="muted" style="font-size:13px">(lib/autocad/SLCadDxf.sleela)</span></h2>
<div data-u="slcaddxf slcaddxf">
<h3 id="SLCadDxf">SLCadDxf <span class="pill">class</span></h3>
<p class="desc">Defines the SLeeLa standard-library type SLCadDxf used within the autocad library family.</p>
<div class="meta-note">Carries the standard <strong>Metadata Class record</strong> — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.</div>
<p class="muted"><strong>Methods</strong> — the actions this unit can perform.</p>
<table class="members"><tr><th>Method</th><th>Signature</th><th>What it does</th></tr>
<tr><td><code>num</code></td><td><span class="sig">String num(double v)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>istr</code></td><td><span class="sig">String istr(int v)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>julian</code></td><td><span class="sig">String julian(double v)</span></td><td class="desc">Format a Julian-date timestamp as a plain fixed-point decimal (6 places), never scientific notation. DXF group-code-40 values must be plain decimals, and a Julian date (~2.46e6) would otherwise print as &quot;2.461e+06&quot;, which both loses precision and breaks strict DXF readers. Builds the string from integer + scaled-fraction parts so no stdlib formatting import is needed.</td></tr>
<tr><td><code>wholeStr</code></td><td><span class="sig">String wholeStr(double w)</span></td><td class="desc">The integer part of a non-negative double as plain decimal digits (never scientific notation, which &quot;&quot; + aDouble would otherwise produce for a Julian date of ~2.46e6).</td></tr>
<tr><td><code>pad6</code></td><td><span class="sig">String pad6(double f)</span></td><td class="desc">Zero-pad a 0..999999 fractional count to exactly six decimal digits.</td></tr>
<tr><td><code>digitChar</code></td><td><span class="sig">String digitChar(double d)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>layer</code></td><td><span class="sig">String layer(String name, int color)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>header</code></td><td><span class="sig">String header(double minX, double minY, double maxX, double maxY,</span></td><td class="desc">Header with drawing extents plus the AutoCAD creation/update timestamps. $TDCREATE / $TDUPDATE are DXF&#x27;s standard local creation and last-update times, expressed as Julian dates (group code 40). A zero timestamp means &quot;unset&quot; and the record is omitted, so passing (…, 0.0, 0.0) reproduces the pre-timestamp HEADER byte-for-byte. (SLeeLa has no method overloading, so this is the single header entry point; callers always pass the two stamps.)</td></tr>
<tr><td><code>tables</code></td><td><span class="sig">String tables()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>document</code></td><td><span class="sig">String document(double minX, double minY, double maxX, double maxY,</span></td><td class="desc">Wrap the three accumulated entity strings in a complete DXF document, with the AutoCAD creation/update timestamps embedded in the HEADER. (No method overloading in SLeeLa, so this is the single entry point; pass 0.0/0.0 for the timestamps to emit a HEADER identical to the pre-timestamp output.)</td></tr>
</table>
</div>
<h2 class="section" data-u="slcadentity">SLCadEntity <span class="pill syntax">#sleela 2.5</span> <span class="muted" style="font-size:13px">(lib/autocad/SLCadEntity.sleela)</span></h2>
<div data-u="slcadentity slcadentity">
<h3 id="SLCadEntity">SLCadEntity <span class="pill">class</span></h3>
<p class="desc">Defines SLCadEntity -- a single, individually addressable 2D drawing entity in the editable AutoCAD model. Where SLCadModel accumulates geometry append-only into a DXF string (good for one-shot rendering), an SLCadEntity is a mutable record the AutoCAD Creator(TM) can select, move, re-layer, re-label, and delete after it has been created. Each entity has a stable id, a kind (line / text / dim), a layer, two points (p1,p2 -- the second is unused for a point-anchored TEXT), a text value (for TEXT and the measured label of a DIM) and a text height, plus an &quot;alive&quot; flag so a delete is a soft tombstone that keeps ids stable. This is the atom the editable SLCadDocument stores and the SLCadCanvas paints. Family: autocad. SLeeLa owns the geometry and every edit to it; a front end only issues create/alter/move/delete intents.</p>
<div class="meta-note">Carries the standard <strong>Metadata Class record</strong> — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.</div>
<p class="muted"><strong>Fields</strong> — the named values this unit stores.</p>
<table class="members"><tr><th>Field</th><th>Declaration</th><th>What it holds</th></tr>
<tr><td><code>KIND_LINE</code></td><td><span class="sig">static final int KIND_LINE = 0</span></td><td class="desc">Entity-kind ordinals. A front end and the renderer agree on these. a straight segment (walls/dims geometry)</td></tr>
<tr><td><code>KIND_TEXT</code></td><td><span class="sig">static final int KIND_TEXT = 1</span></td><td class="desc">a point-anchored text label (notes/title)</td></tr>
<tr><td><code>KIND_DIM</code></td><td><span class="sig">static final int KIND_DIM  = 2</span></td><td class="desc">a linear dimension: segment + measured label</td></tr>
<tr><td><code>id</code></td><td><span class="sig">int id</span></td><td class="desc">stable identity, assigned by the document</td></tr>
<tr><td><code>kind</code></td><td><span class="sig">int kind</span></td><td class="desc">KIND_LINE / KIND_TEXT / KIND_DIM</td></tr>
<tr><td><code>layer</code></td><td><span class="sig">String layer</span></td><td class="desc">&quot;walls&quot; / &quot;dims&quot; / &quot;notes&quot;</td></tr>
<tr><td><code>value</code></td><td><span class="sig">String value</span></td><td class="desc">text payload (TEXT content; &quot;&quot; for a bare LINE)</td></tr>
<tr><td><code>height</code></td><td><span class="sig">double height</span></td><td class="desc">text height (for TEXT / DIM label)</td></tr>
<tr><td><code>alive</code></td><td><span class="sig">int alive</span></td><td class="desc">1 = present, 0 = tombstoned (deleted but id reserved)</td></tr>
</table>
<p class="muted"><strong>Methods</strong> — the actions this unit can perform.</p>
<table class="members"><tr><th>Method</th><th>Signature</th><th>What it does</th></tr>
<tr><td><code>asLine</code></td><td><span class="sig">void asLine(int entityId, String lyr, double ax, double ay, double bx, double by)</span></td><td class="desc">Configure as a straight segment on `lyr` from (ax,ay) to (bx,by).</td></tr>
<tr><td><code>asText</code></td><td><span class="sig">void asText(int entityId, String lyr, double ax, double ay, String text, double h)</span></td><td class="desc">Configure as a text label anchored at (ax,ay) with content `text`.</td></tr>
<tr><td><code>asDim</code></td><td><span class="sig">void asDim(int entityId, String lyr, double ax, double ay, double bx, double by, double h)</span></td><td class="desc">Configure as a linear dimension between (ax,ay) and (bx,by); the measured label is derived on demand (see measured()).</td></tr>
<tr><td><code>getId</code></td><td><span class="sig">int getId()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getKind</code></td><td><span class="sig">int getKind()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getLayer</code></td><td><span class="sig">String getLayer()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>isLine</code></td><td><span class="sig">boolean isLine()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>isText</code></td><td><span class="sig">boolean isText()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>isDim</code></td><td><span class="sig">boolean isDim()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>isAlive</code></td><td><span class="sig">boolean isAlive()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getX1</code></td><td><span class="sig">double getX1()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getY1</code></td><td><span class="sig">double getY1()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getX2</code></td><td><span class="sig">double getX2()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getY2</code></td><td><span class="sig">double getY2()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getValue</code></td><td><span class="sig">String getValue()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>getHeight</code></td><td><span class="sig">double getHeight()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>length</code></td><td><span class="sig">double length()</span></td><td class="desc">The measured length of a dimension (and the natural label for a DIM).</td></tr>
<tr><td><code>label</code></td><td><span class="sig">String label()</span></td><td class="desc">The label text for this entity: its value, or the measured length for a DIM with no explicit override.</td></tr>
<tr><td><code>midX</code></td><td><span class="sig">double midX()</span></td><td class="desc">The midpoint, where a DIM measurement/label sits.</td></tr>
<tr><td><code>midY</code></td><td><span class="sig">double midY()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>kindName</code></td><td><span class="sig">String kindName()</span></td><td class="desc">The entity kind as a word, for reports and the GUI readout.</td></tr>
<tr><td><code>describe</code></td><td><span class="sig">String describe()</span></td><td class="desc">A one-line, human-readable summary of this entity&#x27;s current state, e.g. &quot;#7 line walls (0,0)-&gt;(6000,0)&quot; (a wall) &quot;#9 text notes (3000,2000) \&quot;Lobby\&quot;&quot; (a label) &quot;#4 dim dims (0,-600)-&gt;(10000,-600) =10000&quot; (a dimension + measure) A tombstoned entity is flagged so an audit sees deletions too.</td></tr>
<tr><td><code>translate</code></td><td><span class="sig">void translate(double dx, double dy)</span></td><td class="desc">Move the whole entity by (dx,dy).</td></tr>
<tr><td><code>setP1</code></td><td><span class="sig">void setP1(double ax, double ay)</span></td><td class="desc">Set the first point (and, for TEXT, keep the second coincident).</td></tr>
<tr><td><code>setP2</code></td><td><span class="sig">void setP2(double bx, double by)</span></td><td class="desc">Set the second point (ignored for TEXT, which is point-anchored).</td></tr>
<tr><td><code>setEndpoints</code></td><td><span class="sig">void setEndpoints(double ax, double ay, double bx, double by)</span></td><td class="desc">Re-point both ends at once.</td></tr>
<tr><td><code>setLayer</code></td><td><span class="sig">void setLayer(String lyr)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>setValue</code></td><td><span class="sig">void setValue(String text)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>setHeight</code></td><td><span class="sig">void setHeight(double h)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>kill</code></td><td><span class="sig">void kill()</span></td><td class="desc">Soft-delete: keep the id reserved so other entities keep their identity.</td></tr>
<tr><td><code>revive</code></td><td><span class="sig">void revive()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>toDxf</code></td><td><span class="sig">String toDxf()</span></td><td class="desc">Emit just this entity&#x27;s DXF group-code/value records (empty when dead).</td></tr>
<tr><td><code>lineRecord</code></td><td><span class="sig">String lineRecord(String lyr, double ax, double ay, double bx, double by)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>textRecord</code></td><td><span class="sig">String textRecord(String lyr, double ax, double ay, double h, String text)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>num</code></td><td><span class="sig">String num(double v)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
</table>
</div>
<h2 class="section" data-u="slcadmodel">SLCadModel <span class="pill syntax">#sleela 2.5</span> <span class="muted" style="font-size:13px">(lib/autocad/SLCadModel.sleela)</span></h2>
<div data-u="slcadmodel slcadmodel">
<h3 id="SLCadModel">SLCadModel <span class="pill">class</span></h3>
<p class="desc">Defines the SLeeLa standard-library type SLCadModel used within the autocad library family.</p>
<div class="meta-note">Carries the standard <strong>Metadata Class record</strong> — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.</div>
<p class="muted"><strong>Fields</strong> — the named values this unit stores.</p>
<table class="members"><tr><th>Field</th><th>Declaration</th><th>What it holds</th></tr>
<tr><td><code>noteCount</code></td><td><span class="sig">int noteCount</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
</table>
<p class="muted"><strong>Methods</strong> — the actions this unit can perform.</p>
<table class="members"><tr><th>Method</th><th>Signature</th><th>What it does</th></tr>
<tr><td><code>begin</code></td><td><span class="sig">void begin(String t, String u)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>setAt</code></td><td><span class="sig">void setAt(double x, double y)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>grow</code></td><td><span class="sig">void grow(double x, double y)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>num</code></td><td><span class="sig">String num(double v)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>lineEntity</code></td><td><span class="sig">String lineEntity(String lyr, double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>textEntity</code></td><td><span class="sig">String textEntity(String lyr, double x, double y, double height, String value)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>addWall</code></td><td><span class="sig">void addWall(double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>addRoom</code></td><td><span class="sig">void addRoom(double w, double h)</span></td><td class="desc">Expand a room into its four wall segments at the current insertion point.</td></tr>
<tr><td><code>addDim</code></td><td><span class="sig">void addDim(double x1, double y1, double x2, double y2)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>addNote</code></td><td><span class="sig">void addNote(double x, double y, String text)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>distance</code></td><td><span class="sig">double distance(double x1, double y1, double x2, double y2)</span></td><td class="desc">Straight-line distance -- used to compute dimension labels.</td></tr>
</table>
</div>
<h2 class="section" data-u="slcadplan">SLCadPlan <span class="pill syntax">#sleela 2.5</span> <span class="muted" style="font-size:13px">(lib/autocad/SLCadPlan.sleela)</span></h2>
<div data-u="slcadplan slcadplan">
<h3 id="SLCadPlan">SLCadPlan <span class="pill">class</span></h3>
<p class="desc">Defines the SLeeLa standard-library type SLCadPlan used within the autocad library family.</p>
<div class="meta-note">Carries the standard <strong>Metadata Class record</strong> — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.</div>
<p class="muted"><strong>Methods</strong> — the actions this unit can perform.</p>
<table class="members"><tr><th>Method</th><th>Signature</th><th>What it does</th></tr>
<tr><td><code>kindOf</code></td><td><span class="sig">int kindOf(String op)</span></td><td class="desc">Map a directive keyword to its stable kind code so a front end and the renderer agree on the vocabulary: 0 title 1 units 2 at 3 room 4 wall 5 door 6 dim 7 note</td></tr>
<tr><td><code>known</code></td><td><span class="sig">boolean known(String op)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
</table>
</div>
<h2 class="section" data-u="slcadrenderer">SLCadRenderer <span class="pill syntax">#sleela 2.5</span> <span class="muted" style="font-size:13px">(lib/autocad/SLCadRenderer.sleela)</span></h2>
<div data-u="slcadrenderer slcadrenderer">
<h3 id="SLCadRenderer">SLCadRenderer <span class="pill">class</span></h3>
<p class="desc">Defines the SLeeLa standard-library type SLCadRenderer used within the autocad library family.</p>
<div class="meta-note">Carries the standard <strong>Metadata Class record</strong> — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.</div>
<p class="muted"><strong>Fields</strong> — the named values this unit stores.</p>
<table class="members"><tr><th>Field</th><th>Declaration</th><th>What it holds</th></tr>
<tr><td><code>title</code></td><td><span class="sig">String title</span></td><td class="desc">drawing title</td></tr>
<tr><td><code>units</code></td><td><span class="sig">String units</span></td><td class="desc">drawing units (e.g. &quot;mm&quot;)</td></tr>
</table>
<p class="muted"><strong>Methods</strong> — the actions this unit can perform.</p>
<table class="members"><tr><th>Method</th><th>Signature</th><th>What it does</th></tr>
<tr><td><code>begin</code></td><td><span class="sig">void begin(String t, String u)</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>drawingTitle</code></td><td><span class="sig">String drawingTitle()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
<tr><td><code>drawingUnits</code></td><td><span class="sig">String drawingUnits()</span></td><td class="desc"><span class="muted">No description in source.</span></td></tr>
</table>
</div>
<script>function flt(q){q=q.toLowerCase();document.querySelectorAll('[data-u]').forEach(function(el){el.style.display = el.getAttribute('data-u').indexOf(q)>=0||q==''?'':'none';});}</script>
<footer>
Generated by <code>tools/generate-sleeladoc-api.py</code> from the live
<code>/lib</code> tree on 2026-11-14 08:57 UTC.
SleelaDoc — the SLeeLa documentation brand. SLeeLa — MEARVK LLC · Max Rupplin · UNCW, NCSU, Harvard · 2026 · George Soros 2507-2608.
</footer>
</main>
</div>
</body>
</html>