Revit MCP Server

by ZedMoster
Verified

create_floors

Create multiple floors in Revit with automated unit conversion, floor type matching, and error handling. Supports batch creation of structural and non-structural floors based on boundary points and elevation.

Instructions

在Revit中创建楼板,支持批量创建,遵循JSON-RPC 2.0规范。 mcp_tool使用时params不要有任何注释信息

特性:

  • 支持批量创建多个楼板
  • 自动处理单位转换(毫米转英尺)
  • 自动匹配楼板类型或使用默认类型
  • 支持结构楼板和非结构楼板
  • 自动根据z值标高确定楼层
  • 完善的错误处理机制

参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"CreateFloors" params (List[Dict]): 楼板参数列表,每个字典包含: - boundaryPoints (List[Dict]): 楼板边界点列表,每个点包含: - x (float): X坐标(毫米) - y (float): Y坐标(毫米) - z (float): Z坐标(毫米) - floorTypeName (str, optional): 楼板类型名称(可选) - structural (bool, optional): 是否为结构楼板(默认为False)

返回: 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_floors(ctx, params=[ { "boundaryPoints": [ {"x": 0, "y": 0, "z": 0}, {"x": 5000, "y": 0, "z": 0}, {"x": 5000, "y": 5000, "z": 0}, {"x": 0, "y": 5000, "z": 0}, {"x": 0, "y": 0, "z": 0} ], "floorTypeName": "常规 - 150mm", "structural": True }, { "boundaryPoints": [ {"x": 0, "y": 0, "z": 3000}, {"x": 5000, "y": 0, "z": 3000}, {"x": 5000, "y": 5000, "z": 3000}, {"x": 0, "y": 5000, "z": 3000}, {"x": 0, "y": 0, "z": 3000} ], "floorTypeName": "常规 - 200mm" } ])

# 输出示例 { "jsonrpc": "2.0", "result": [213001, 213002], "id": 1 }

Input Schema

NameRequiredDescriptionDefault
methodNoCreateFloors
paramsNo

Input Schema (JSON Schema)

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