One of the most innovative features introduced in cadwork version 29 is the ability to create "script-filled attributes". Traditionally, an attribute's content (e.g., a part's group, name, or a custom property) had to be manually set. With script-filled attributes, this content is generated automatically at runtime by a Python script.
The official API documentation is an evolving resource that outlines all available functions, methods, and examples.
// Define start and end points (Units are typically Millimeters) cwGeometry.cwPoint3d startPoint = new cwGeometry.cwPoint3d(0, 0, 0); cwGeometry.cwPoint3d endPoint = new cwGeometry.cwPoint3d(3000, 0, 0); cadwork api
The cadwork API's utility extends beyond just its own scripting environment. It serves as the foundation for powerful integrations with other industry-standard design tools, bridging the gap between complex surface modeling and timber construction.
Developing custom tools through the Cadwork API requires an upfront investment in coding knowledge, but the return on investment is massive. By shifting from manual modeling to algorithmic, rule-based design, timber construction companies can drastically cut down design lead times, eliminate human error on the shop floor, and scale their production capacity without linearly increasing engineering staff. One of the most innovative features introduced in
public class MyFirstPlugin
The cadwork API is a transformative tool that turns a powerful 3D modeling software into a fully customizable platform. Whether you are a construction professional looking to automate daily tasks, a developer building complex integrations like compas_cadwork , or a firm seeking to streamline your data workflow with script-filled attributes, the API provides the means. The official API documentation is an evolving resource
if (newBeamId > 0)
| Industry | Application | |----------|--------------| | | Automatically generate stud layouts based on wall length and spacing rules. | | Roof truss design | Create a parametric truss family where angle and overhang are variables. | | Steel connections | Apply bolt patterns and end-plates to hundreds of beams instantly. | | Quality control | Compare as-designed vs as-built geometry using exported data. | | BIM coordination | Export element GUIDs and custom properties to IFC for clash detection. |
The Cadwork API enables automation across the entire project lifecycle, moving from basic property management to advanced parametric geometric modeling.