Skip to main content

Native engine

The native engine runs on your server, on Windows (x64) or Linux (x64, arm64). Clients connect to the ClassCAD server, which starts an engine for each session. It comes with the Business plan.

Download​

Under Downloads on your account: choose the platform and the version, download the archive and unpack it. The page shows an install script for each platform as well.

Key​

The engine gets its key with a secret access token from your account: put the token in .classcad.token in the engine's folder, or in the environment variable CLASSCAD_TOKEN. At startup the engine fetches its key and keeps it until a day before it ends, so it starts without us for a while.

echo ccsk_… > .classcad.token

A machine without internet reads a key file instead, .classcad.appkey in the engine's folder: an offline key, which we make on request. It appears among your access tokens, where you download it.

Engines up to 21.2.0 read only the key file: make one under Downloads → Key and save it there. It is valid until your plan's period ends, at most a year; then make a new one.

Start​

The ClassCAD server needs Node.js 20 or newer.

./classcad-socketio.sh

On Windows, classcad-socketio.cmd. The server listens on port 9091.

Connect​

npm install @buerli.io/classcad
import { init, SocketIOClient, BuerliCadFacade } from '@buerli.io/classcad'

init(id => new SocketIOClient('ws://localhost:9091', id))

const facade = new BuerliCadFacade()
await facade.connect()
const api = facade.api

const part = await api.v1.part.create({ name: 'Flange' })

This is the program from WebAssembly; only the init line differs.

Python and .NET​

The API also comes as packages for Python and .NET. Under Downloads, API wrappers, are the packages for the engine version you run, with their install commands: an API package and a connector for each language. The .NET packages are installed from a local NuGet source; the connector's dependencies come from nuget.org, so both sources need to be configured.

from classcadconnector import SocketIOClient

client = SocketIOClient(url="ws://localhost:9091")
await client.connect()
api = client.getApiU()
part = await api.v1.part.create({"name": "Flange"})
var client = new ClassCAD.SocketIOClient("ws://localhost:9091");
await client.Connect();
var api = client.GetApiU();
var part = await api.v1.part.Create(new() { name = "Flange" });