Revit MCP Server

by ZedMoster
Verified

create_grids

Generate and manage grids in Revit, including straight and curved grids, with automatic unit conversion, name conflict resolution, and error handling.

Instructions

在Revit中创建轴网,支持直线轴网和弧线轴网,遵循JSON-RPC 2.0规范。 mcp_tool使用时params不要有任何注释信息

特性:

  • 支持批量创建多个轴网
  • 支持直线轴网和弧线轴网创建
  • 自动处理单位转换(毫米转英尺)
  • 自动处理轴网名称冲突
  • 完善的错误处理机制

参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"CreateGrids" params (List[Dict]): 轴网参数列表,每个字典包含: - startX (float): 起点X坐标(毫米) - startY (float): 起点Y坐标(毫米) - endX (float): 终点X坐标(毫米) - endY (float): 终点Y坐标(毫米) - name (str, optional): 轴网名称(可选) - centerX (float, optional): 弧线轴网的圆心X坐标(毫米) - centerY (float, optional): 弧线轴网的圆心Y坐标(毫米)

返回: 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_grids(ctx, params=[ { "name": "Grid_A", "startX": 0, "startY": 0, "endX": 10000, "endY": 0 }, { "name": "Grid_B", "startX": 5000, "startY": 0, "endX": 5000, "endY": 10000, "centerX": 5000, "centerY": 5000 } ])

# 输出示例 { "jsonrpc": "2.0", "result": [ { "elementId": "212801", "name": "Grid_A", "familyName": "轴网" }, { "elementId": "212802", "name": "Grid_B", "familyName": "轴网" } ], "id": 1 }

Input Schema

NameRequiredDescriptionDefault
methodNoCreateGrids
paramsNo

Input Schema (JSON Schema)

{ "properties": { "method": { "default": "CreateGrids", "title": "Method", "type": "string" }, "params": { "default": null, "items": { "additionalProperties": true, "type": "object" }, "title": "Params", "type": "array" } }, "title": "create_gridsArguments", "type": "object" }
ID: 4dgua6bhbf