Cadwork Api Verified

The cadwork API (officially CwAPI3D) is a programming interface that allows you to automate tasks and create custom plugins within cadwork 3D. It primarily supports Python, though a C++ interface is also available. Core Functionality

The API provides "Controllers" to interact with different parts of the 3D model:

Element Controller: Create, modify, copy, and delete architectural and structural elements (beams, panels, drillings).

File Controller: Manage exports and imports for various formats like IFC, Rhino, STEP, and STL. cadwork api

Utility Controller: Access general data like camera positions, coordinate systems, and visibility states.

Attribute Controller: Read and write user attributes for BIM and data management. Getting Started with Python

Installation: You can install the local stub package via pip to get IDE autocompletion: pip install cwapi3d. The cadwork API (officially CwAPI3D ) is a

File Structure: Scripts must be placed in your user profile folder under ...\3d\API.x64\. Every script requires its own folder, and the Python file must share the folder's name (e.g., MyPlugin/MyPlugin.py).

Running Scripts: Once placed, your script appears as a button in the Plugin Bar (Window -> Plugins) within cadwork 3D. You don't need to restart cadwork to test code changes; simply save the .py file and click the button again. Development Resources Cadwork Python Documentation


5. File I/O and Data Exchange

Automate imports (DXF, IFC, STEP) and exports (BOM, CSV, DSTV, PXML). The API allows you to build custom translators that convert cadwork data into formats required by sawmills, robot cells, or structural analysis software. Python (Primary): Python is the recommended language for

3. Batch Your Transactions

When modifying thousands of elements, use ctrl.start_transaction() and ctrl.commit_transaction(). This bundles all operations, making the script dramatically faster and allowing one-click undo in cadwork.

What is the cadwork API?

The cadwork API (Application Programming Interface) is a set of programming tools that allows users to extend, automate, and customize cadwork’s native functionality. Instead of manually drawing, modifying, or reporting every element, the API enables you to control cadwork through code.

In simple terms: if you can do it manually in cadwork, you can automate it with the API.

Programming Languages Supported

cadwork has evolved its API over multiple versions (v20, v21, v24, etc.). Currently, the most robust support exists for:

  • Python (Primary): Python is the recommended language for the cadwork API. The cadwork Python package (available via PyPI) provides a clean, object-oriented interface. It is ideal for rapid prototyping, data science, and glueing different systems together.
  • C++: For performance-critical applications (e.g., real-time physics engines or custom constraint solvers), the native C++ API offers raw speed and full memory control.
  • C# / .NET: Many engineering firms use C# to build Windows desktop plugins that integrate seamlessly with cadwork’s UI.

For most users, Python is the starting point. The learning curve is gentle, and the cadwork community has shared hundreds of snippets for common tasks.

Integration patterns

  • Direct API calls: use SDK libraries (if provided) or REST/COM interfaces to query and update model data from external applications or scripts.
  • File-based exchange: export cadwork-native files or standard formats (IFC, STEP, CSV) then process them with external tools—simple, robust for one-way workflows.
  • Middleware/broker: place a service between cadwork and downstream systems to translate formats, handle authentication, and queue batches for fabrication.
  • Event-driven automation: subscribe to model-change events to run validation, update BOMs, or regenerate NC output automatically on save.