ZW3D Macro Writer for Openclaw

An AI agent skill designed to write, edit, debug, and execute ZW3D CAD macro files for streamlined design automation.

shemin1024
v1.0.0
May 25, 2026
0
443
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install zw3d-macro

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install zw3d-macro using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is ZW3D Macro Writer?

The ZW3D Macro Writer is an advanced automation asset designed for mechanical engineering and CAD design workflows. This capability allows AI coding agents using Openclaw Skills to seamlessly generate, analyze, test, and execute ZW3D CAD macro (.mac) files. By translating natural language instructions into precise ZW3D API calls, UI interactions, and geometry declarations, it automates complex physical modeling tasks, drastically reducing manual engineering overhead.

With native support for control structures (IF, WHILE, BUFFER), history manager selection, automatic view range extension, and complex geometric features, this skill bridges the gap between conversational AI and desktop CAD software. Whether generating high-precision fixture base plates, constructing parametric hole arrays, or editing existing model histories, it provides a highly reliable syntax engine to interact with ZW3D.

ZW3D Macro Writer Use Cases

  • Automating the creation of standardized CAD models like base plates, desktops, and extruded components from simple dimensional requirements.
  • Modifying existing parametric models by opening files and editing existing features in the history manager instead of building models from scratch.
  • Generating large-scale patterned feature arrays, such as 3x3 or 5x5 grid arrays of threaded or through-bore holes, with coordinate-based positioning.
  • Batch testing and debugging of ZW3D macros using breakpoints, error handling controls, and baseline verification coordinates.
  • Direct CAD process execution using PowerShell triggers to launch ZW3D and execute macro scripts natively.

How ZW3D Macro Writer Works

  1. Instruction Parsing: The AI agent analyzes user input to determine if the workflow requires creating a new CAD model or modifying an existing template.
  2. Syntax Construction: Geometric entities, sketch selections, features (extrusion, filleting, chamfering, hole features), and mouse coordinates are translated into native command arrays such as vxSend, vxInitCmd, and vxSendEvt.
  3. History Tree Mapping: For parametric updates, the skill locates the precise features inside the ZW3D History Manager using 1-indexed historical identifiers (e.g., selecting block features via index events).
  4. Buffer & Control Isolation: Complex command sets, conditional operations, and UI confirmations are securely wrapped inside logical control loops and buffer states.
  5. Execution Orchestration: The compiled macro is saved as a .mac file and executed via a direct PowerShell command, launching the ZW3D executable to run the automated operations dynamically.

ZW3D Macro Writer Setup

Prerequisites

Ensure that the ZW3D CAD application is installed and its executable directory is registered within your system's Environment Variables.

Direct PowerShell Execution

To trigger an automated macro execution directly within ZW3D, use the following execution pattern from your terminal:

Start-Process "zw3d.exe" "path/to/macro.mac"

Macro Generation Setup

Always initialize macro structures with correct header comments (Author, Date, Version, Description) and close the macro with mandatory environment cleanup commands to ensure workspace integrity:

MACRO main
[QaBlVersion,1]
[vxBuildDate,01/01/2026]
[vxConfigDefault,2800]

# Macro commands go here

[vxConfigRestore]
ENDMACRO

ZW3D Macro Writer Data Schema & Taxonomy

The ZW3D Macro Writer organizes outputs into standard CAD macro files (.mac) utilizing a structured instruction schema:

Command Class Syntax Pattern Target Application
GUI Commands [vxSend, "$CdFileNew"] Direct UI operations, new files, and template loads
Template Commands [vxSend, "!FtAllBox"] Initiates geometric primitives, sketches, and extrusions
Special Commands [vxSend, "~CdFiMorePick"] Advanced selections, auto-selection sweeps, and wizard triggers
UI Events [vxSendEvt, "UiHistoryManager", ...] Direct simulation of clicks, history selections, and field focus events
Initialization Values [vxInitCmd, FtAllBox, <8,0>...] Low-level geometric constraint declarations and dimensions

ZW3D Macro Writer Advanced Features

  • Auto-Reordering Event System: Dynamically shifts critical operations like vxInitCmd and QaAllowRetry to execute one line earlier than written for proper timing synchronization with active dialogs.
  • Smart Automatic Edge Selection: Employs ~CdFiMorePick to instantly identify and select all edge sets for complex chamfers and fillets without requiring coordinate mapping.
  • Parametric Rollback Boundaries: Uses the BUFFER and ENDBUFFER boundaries to isolate and perform rapid rollbacks of pattern modifications in the history queue.
  • Advanced Debugger Integrations: Implements runtime diagnostics using commands like [DebugOn], single-line breakpoints (+), and baseline validations via barycenter coordinates ([QaOutBary]).

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*