create_walls
Create walls in Revit with batch processing, automatic unit conversion from millimeters to feet, and wall type matching based on thickness parameters.
Instructions
在Revit中创建墙体,支持批量创建,遵循JSON-RPC 2.0规范。 mcp_tool使用时params不要有任何注释信息
特性:
支持批量创建多个墙体
自动处理单位转换(毫米转英尺)
自动创建或匹配符合厚度的墙类型
支持指定标高或使用默认标高
完善的错误处理机制
参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"CreateWalls" params (List[Dict]): 墙体参数列表,每个字典包含: - startX (float): 起点X坐标(毫米) - startY (float): 起点Y坐标(毫米) - endX (float): 终点X坐标(毫米) - endY (float): 终点Y坐标(毫米) - height (float): 墙体高度(毫米) - width (float): 墙体厚度(毫米) - elevation (float, optional): 墙体底部标高(毫米,默认为0)
返回: dict: JSON-RPC 2.0格式的响应,结构为: 成功时: { "jsonrpc": "2.0", "result": [ { "elementId": "墙体元素ID", "name": "墙体名称", "familyName": "墙体族名称" }, ... ], "id": request_id } 失败时: { "jsonrpc": "2.0", "error": { "code": int, "message": str, "data": any }, "id": request_id }
示例: response = create_walls(ctx, params=[ {"startX": 0, "startY": 0, "endX": 5000, "endY": 0, "height": 3000, "width": 200}, {"startX": 5000, "startY": 0, "endX": 5000, "endY": 5000, "height": 3000, "width": 200, "elevation": 1000} ])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | CreateWalls | |
| params | No |
Implementation Reference
- xml_revit_mcp/server.py:41-44 (registration)create_walls tool is listed in ARCHITECTURAL_TOOLS for MCP server registrationARCHITECTURAL_TOOLS = [ create_levels, create_floor_plan_views, create_grids, create_walls, create_floors, create_door_windows, create_rooms, create_room_tags, create_family_instances, create_sheets ]
- xml_revit_mcp/server.py:136-139 (registration)Loop that applies @server.tool() decorator to register create_walls and other architectural tools to the MCP server# 注册建筑工具 for tool in ARCHITECTURAL_TOOLS: server.tool()(tool)
- xml_revit_mcp/prompts.py:27-27 (helper)Usage guidance for create_walls tool in asset creation strategy prompt- 使用create_walls()创建墙体,注意指定正确的起点、终点、高度和宽度
- xml_revit_mcp/server.py:16-16 (helper)Import statement that brings in create_walls function from tools module (file not found in codebase)from .tools import *