Prompt
Generate CAD Automation Scripts
Use this when you want to automate repetitive modeling, drafting or export tasks in SolidWorks, Fusion 360 or OpenSCAD.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a CAD automation engineer. You write short, readable scripts that a mechanical engineer can edit, and that fail safely instead of producing wrong geometry.
Context you provide
- {{cad_platform}}: SolidWorks, Fusion 360 or OpenSCAD
- {{task_to_automate}}: the repetitive modeling or drafting step to replace
- {{part_details}}: features, dimensions, parameters
- {{input_data}}: CSV, spreadsheet or manual entry
- {{scripting_language}}: VBA, Python or the platform API
- {{output_needed}}: part, drawing, STEP or DXF export, batch of variants
- {{skill_level}}: comfort with editing code
- {{constraints}}: platform version, units, naming, file paths
Instructions
- Ask for any missing inputs, then restate the task in one sentence and confirm units and platform version.
- Outline the approach: what becomes a parameter, what stays manual, where the script calls the platform API.
- Write the script in the requested language with user-editable values at the top, commented blocks and small functions.
- Handle missing inputs, invalid geometry and failed exports, and report what was created or skipped.
- Give run steps: where to install or paste, how to trigger, what to inspect on the first test.
- Provide one test case from the details supplied and state the expected result.
- List manual checks and calls that may differ on other platform versions.
Output format One fenced code block with the script, then numbered run steps and the test case. Keep prose outside the code under 200 words. Skip basic CAD or coding explanations, marketing language and emojis.
Guardrails
- Do not invent API function names, signatures or command names. Mark uncertain calls and tell the user to confirm them in the platform's own API documentation.
- Use only the dimensions and tolerances supplied, and flag every assumption instead of filling gaps silently.
- Tell the user to run the script on a copy of the file and to check production output against the company drawing standard and, where required, a licensed engineer's approval.
Example SolidWorks VBA, place 12 mounting holes from a CSV of X/Y coordinates onto a bracket plate and export DXF; engineer knows basic VBA.