Revit MCP Server

by ZedMoster
Verified

create_levels

Create and manage building levels in Revit in bulk, including automatic unit conversion (mm to feet) and resolving naming conflicts. Follows JSON-RPC 2.0 for structured requests and responses.

Instructions

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

特性:

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

参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"CreateLevels" params (List[Dict]): 标高参数列表,每个字典包含: - elevation (float): 标高高度(毫米) - name (str, optional): 标高名称(可选,默认为"Level_{elevation}")

返回: 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_levels(ctx, params=[ {"elevation": 8000, "name": "Level_3"}, {"elevation": 12000} # 自动生成名称"Level_12000" ])

Input Schema

NameRequiredDescriptionDefault
methodNoCreateLevels
paramsNo

Input Schema (JSON Schema)

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