AgentSkillsCN

dynamo-automation

专为通过 MCP 自动化 Autodesk Dynamo 图形创建而设计的专项工作流。适用于用户提出以下需求时使用:(1) 创建或放置 Dynamo 节点(原生/包/自定义);(2) 将 Python 脚本注入 Dynamo 节点;(3) 建立节点连接;(4) 分析工作区状态;(5) 排查 MCP 集成中的疑难问题(幽灵连接、UI 同步问题);(6) 操作 Dynamo 脚本库。

SKILL.md
--- frontmatter
name: dynamo-automation
description: Specialized workflow for automating Autodesk Dynamo graph creation through MCP. Use when the user requests (1) Creating or placing Dynamo nodes (native/packages/custom), (2) Injecting Python scripts into Dynamo nodes, (3) Establishing node connections, (4) Analyzing workspace state, (5) Troubleshooting MCP integration (ghost connections, UI sync issues), (6) Working with Dynamo script libraries.

Dynamo Automation Skill

Note for All AI Agents:
This is the Antigravity-specific Skill wrapper with auto-triggering capability.
Universal Documentation: See ../../docs/ai-guide/quick-start.md for complete guidance.


Fast-track workflow for controlling Autodesk Dynamo through Model Context Protocol (MCP).

For Non-Antigravity Users

If you're using Claude Desktop, Gemini CLI, or other AI agents:

  • This Skill will not auto-trigger
  • Please refer to docs/ai-guide/quick-start.md directly
  • All MCP tools work the same across all AI agents

Quick Start

1. Environment Check

bash
python .skills/dynamo-automation/scripts/check_connection.py

If connection fails → See Troubleshooting

2. Choose Your Strategy

Decision Tree:

code
User Request
    ├─ Simple geometry with fixed params?
    │  └─ Use Code Block Strategy → references/code_block_strategy.md
    │
    ├─ Parameterized nodes?
    │  └─ Use Native Node Strategy → references/native_node_strategy.md
    │
    ├─ Python script injection?
    │  └─ Use Python Injection → references/python_injection.md
    │
    └─ Connect nodes?
       └─ Use Connection Patterns → references/connection_patterns.md

Core Workflows

Node Creation

Strategy Selection:

ScenarioStrategyReference
Fixed coordinates (e.g., Point(0,0,0))Code Blockcode_block_strategy.md
Parameterized (e.g., Cuboid(width, length, height))Native Nodenative_node_strategy.md
Complex nested geometryCode Blockcode_block_strategy.md

Quick Templates:

  • See assets/templates/ for ready-to-use JSON examples

Python Script Injection

Triple-Guarantee Mechanism:

  1. Name Loop - Try multiple node names for cross-version compatibility
  2. Dedicated Command - Use UpdatePythonNodeCommand via reflection
  3. Forced UI Sync - Call OnNodeModified(true) to refresh UI

Full details: python_injection.md

Quick Template:

json
{
  "nodes": [{
    "id": "py_script",
    "name": "Python Script",
    "pythonCode": "OUT = IN[0]",
    "x": 500,
    "y": 300
  }]
}

Node Connection

Critical Rules:

  • ✅ Use fromPort / toPort (0-indexed)
  • ❌ Never use fromIndex / toIndex (invalid fields)
  • ✅ Ensure ID mapping exists before connecting

Full details: connection_patterns.md

Quick Template:

json
{
  "connectors": [{
    "from": "node_a",
    "to": "node_b",
    "fromPort": 0,
    "toPort": 0
  }]
}

Workspace Analysis

Analyze current state:

bash
python .skills/dynamo-automation/scripts/analyze_workspace.py

Returns:

  • Workspace name & file path
  • Node count & types
  • Connection status
  • Error/warning flags

Templates Library

Location: assets/templates/

TemplatePurposeStrategy
point_basic.jsonSingle point creationCode Block
line_nested.jsonNested geometry exampleCode Block
cuboid_parameterized.jsonParameterized solidNative Node
sphere_with_preview.jsonPreview control demoNative Node
python_basic.jsonEmpty Python nodePython
python_revit_rooms.jsonRevit room readerPython
connection_workflow.jsonSelect → Python workflowConnection

Usage:

python
# Load template
import json
with open('.skills/dynamo-automation/assets/templates/point_basic.json') as f:
    template = json.load(f)

# Modify coordinates
template['nodes'][0]['value'] = "Point.ByCoordinates(100, 200, 300);"

# Execute
await execute_dynamo_instructions(json.dumps(template))

Common Patterns

Pattern 1: Code Block (Simple Geometry)

json
{
  "nodes": [{
    "id": "geom1",
    "name": "Number",
    "value": "Point.ByCoordinates(0, 0, 0);",
    "x": 300,
    "y": 300
  }]
}

Pattern 2: Native Node (Parameterized)

json
{
  "nodes": [{
    "id": "cube1",
    "name": "Cuboid.ByLengths",
    "params": {"width": 100, "length": 50, "height": 30},
    "x": 500,
    "y": 300
  }]
}

Pattern 3: Python Script

json
{
  "nodes": [{
    "id": "py1",
    "name": "Python Script",
    "pythonCode": "import clr\nOUT = 'Hello Dynamo'",
    "x": 500,
    "y": 300
  }]
}

Troubleshooting

Issue: Connection failed

Check:

  1. Is Python WebSocket server running? (python bridge/python/server.py)
  2. Is Dynamo open with workspace active?
  3. Run scripts/check_connection.py for diagnostics

Solutions: See troubleshooting.md


Issue: Node created but not visible

Cause: Ghost connection (old Dynamo session)

Solution:

  1. Close Dynamo completely
  2. Restart Python server
  3. Reopen Dynamo
  4. Reconnect

Details: troubleshooting.md


References

All detailed technical documentation is in references/:


Skill Version: 1.0
Last Updated: 2026-01-24
Maintained by: Dynamo MCP Team