Cadwork Api !!install!!
cadwork is a specialized CAD/CAM software primarily used in the timber construction industry. Unlike general-purpose CAD tools (like AutoCAD), its API is deeply integrated with wood construction logic (panels, beams, joints, lists).
Important Note: The cadwork API is proprietary. The official documentation is provided to license holders via the cadwork helpdesk or the "Help" section within the software. cadwork api
Below is a detailed guide on the architecture, requirements, and practical usage of the cadwork API. cadwork is a specialized CAD/CAM software primarily used
Use Case 2: Dynamic Camber Calculation
For long-span glulam beams, camber (upward curvature) is mandatory. Using the API, engineers extract the beam's support points and self-weight, calculate the deflection curve (using an external structural library), and write the camber values back into the beam's geometry as a vertical curve—all without leaving cadwork. Use Case 2: Dynamic Camber Calculation For long-span
Step 2: Add References
- In the Solution Explorer, right-click References -> Add Reference.
- Click Browse.
- Navigate to your cadwork installation directory (e.g.,
C:\cadwork\v30\). - Select the necessary DLLs:
cwAPI.dllcwBaseTypes.dllcwGeometry.dll
- Crucial: In the Properties of these references, set "Copy Local" to False. The plugin must use the DLLs loaded by the cadwork application, not local copies.
5. Practical Examples
7. Troubleshooting & Best Practices
- Units: cadwork API operates strictly in Millimeters. Always convert user input (inches/meters) to mm before passing to API.
- Error Handling: Wrap API calls in
try-catchblocks. Accessing a deleted element ID or invalid geometry can crash the host application.try var el = _api.getElement(id); // logic catch (Exception ex) _api.messageBox("Error: " + ex.Message); - Regeneration: After bulk changes, call
_api.regen()to update the 3D view. However, call it sparingly as it is resource-intensive. - Null Checks: Always check if
getElementreturns null. An ID might exist in the selection cache but be deleted from the model.