The .arc language
What a .arc file is, how files fit together, and the two commands that format and check them.
.arc is the source language of a design record. Units, parts, ports, mates, calculations and citations are syntax, so one fact graph serves the design, the drawing and the report, and ARQL can query it.
The model
- One
.arcfile is one part. An assembly is a part whose body places child parts, in a tree. - A standard part is a library reference, never a file.
- A drawing is derived. Sheets and views are declared over parts, so views align by construction.
- Every value has a unit and a dimension. The compiler checks them.
- Every value can name its source, and the compiler resolves it.
- Values behave like a spreadsheet: change one and its dependents follow, in dependency order.
A first file
arc 0.1
use T1 = uploads/giao-trinh-ctm.pdf
use standards = lib archee.standards
part shaft2 kind shaft {
in T: torque
in n: speed
let tau: stress = T1."Bảng 10.5"["C45"].tau
let d_min: length = cbrt(16 * T / (pi * tau)) to mm
let d1: length = up(d_min, standards.d)
port s1: cyl(d = d1 k6, len = 40 mm, at = 0 mm)
check tau_ok: 16 * T / (pi * d1^3) <= tau
}The shaft takes a torque and a speed. It reads the allowable stress from a cited table, computes the minimum diameter, rounds up to a preferred size and declares a cylinder port with a k6 fit. When the limit fails, arc check reports calc.check on that line.
Lay out a record
rec/
req.arc gbox.arc shaft2.arc wheel2.arc report.arc
uploads/
giao-trinh-ctm.pdf
giao-trinh-ctm/index.jsonuse names another file, an upload or a library. Files may use each other in any order; the compiler resolves them.
Format and check
agentcad arc fmt rec/shaft2.arc
agentcad arc check rec/arc fmtrewrites a file into canonical order and layout. With--check, it reports files that differ and leaves them alone.arc checkparses, type-checks, evaluates and verifies every.arcfile in the folder. It prints one diagnostic per line, orok (N files checked), and exits 0 on success and 1 on error. Add--jsonfor a record.
See Diagnostics for every code.