Scripts in ClassCAD
CCScripts are currently (as of August 2025) available only to a limited closed group of interested customers as part of an early evaluation program. There is no confirmed release date for scripts, and they should not be used in production systems at this stage. For the best experience, CCScripts require the beta version of our VS Code plugin, which provides the necessary tools to write and manage code efficiently. If you are interested in exploring CCScripts or learning more about their capabilities, please contact us for further details.
This description is intended to give you an early look at the future direction we are pursuing, and to highlight features that may become available in upcoming releases.
Scripts in ClassCAD, called CCScripts, are very powerful. They are a safe subset of the ClassCAD language, designed to enable API calls including control structures directly to be executed directly in our engine. The Script API executes CCScripts just like a standard API call, ensuring seamless integration.
CCScript is ideal for automation, whether used as a standalone tool via an HTTP request or integrated into a CAD application like Buerligons. Within such applications, it can be used to implement custom features in a part’s history or invoked in a broader context.
A CCScript can be considered the coded representation of a model. In addition to storing the native model, its code equivalent could be maintained on GitHub, allowing software development workflows, including CI/CD pipelines, to be leveraged. These scripts can be dynamically loaded on demand from a specified URL.
When executing a script in an active session, you can pass parameters from the session to it. Similarly, when running a script in a new session, you can establish a context by first loading a model into it.
You can also think of these scripts as specialized functionality within a CAD environment — useful for specific cases but impractical to embed directly into the system due to complexity.
We will provide our ClassCAD VSCode extension, that simplifies scripting, by providing typical code completion, documentation help etc. You can run scripts only frpom VScode at the moment. In the near future we will also extend Buerligons to run scripts interactively in part and assembly mode.
roundtrip: model to script to model
Code and models are interchangeable to a certain extend. This is simply due to the fact that ClassCAD can executes API calls and if you would record the steps of creating the part interactively you get the code. The other way round, you normally loose information when you run scripts to build models, because control strcutures like for loops cannot be reflected in the operation / feature sequence.
To create code from models you use the script API The very appealing functionality is that you can interactive model assemblies and then create product variants in code. This is supported by the type parameters from scriptgeneration. Instead of creating parts from scratch, they can be loaded by Url and adapted with an setExpresssion call.
Scripts as custom features with SOLID and CURVE API
History based Cad Systems like ClassCAD run features in a sequence and each feature creates or modifies solids. These results can then be resued in later features. You can move back and forth in the history and the system takes care that everything is handled correctly in the history. Our part API allows you to create these features like sketches or extrusions.
Using CCSpripts you can implement your own custom feature, which you embedded as custom operation into the part history sequence. The EntityInjection is exactly this feature, like a extrusion or fillet, which contains your custom code and will be executed by the system, when parts are calculated. EntityInjection makes sure that for example solid input data for your feature will not destructively be modified, when you run your code!
In this container live all the curves and solids created during the execution of the script. SolidAPi supports many CAD operations, like booleans, extrusions or revolve which work destructively on the solids in the container. Solid API is more efficient than part API since it avoids some overhead for object/feature creation.
Important point to consider: Since we do not promote to store scripts in a model, you better reload these scripts from a URL, when it is executed. In the future, we plan to provide a scripts container to make the code available for the engine to exectute.
scripts versus batch
Running commands in batch mode via the Common API is another way to automate tasks. While CCScripts offer programming capabilities with control structures, batch commands are simply sequences by jobs. The results of a batch call is basically an array of results of the individual calls and thus allows to check errors or results for each call individually. Here is a small example how batch APi can be used even to run scripts in the body of an Http call:
const body = {
api: 'v1/common/batch',
param: {
jobs: [
{ api: 'v1/common/clear' },
{ api: 'v1/script/run', param: { data: script, scriptParam: param } },
{ api: 'v1/common/save', param: { format: 'ofb', encoding: 'base64' } },
{ api: 'v1/common/save', param: { format: 'scg', encoding: 'base64' } },
],
},
}