Skip to main content
Glama
ZedMoster

Revit MCP Server

by ZedMoster

create_floor_plan_views

Create floor plan views from specified levels in Revit, supporting batch creation and automatic handling of existing views to prevent duplicates.

Instructions

根据给定标高创建楼层平面视图,遵循JSON-RPC 2.0规范。 mcp_tool使用时params不要有任何注释信息

特性:

  • 支持批量创建多个楼层平面视图

  • 自动跳过已存在的视图,避免重复创建

  • 完善的错误处理机制

参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为 CreateFloorPlanViews params (List[Dict]): 视图参数列表,每个字典包含: - levelId (str): 标高的ElementId - viewName (str): 要创建的视图名称

返回: 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_floor_plan_views(ctx, params=[ {"levelId": "123456", "viewName": "Level 1 - Floor Plan"}, {"levelId": "789012", "viewName": "Level 2 - Floor Plan"} ])

# 返回示例
{
    "jsonrpc": "2.0",
    "result": [
        {
            "elementId": "123789",
            "name": "Level 1 - Floor Plan",
            "familyName": "Floor Plan"
        },
        {
            "elementId": "123790",
            "name": "Level 2 - Floor Plan",
            "familyName": "Floor Plan"
        }
    ],
    "id": 1
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoCreateFloorPlanViews
paramsNo

Implementation Reference

  • Defines the ARCHITECTURAL_TOOLS list that includes the create_floor_plan_views tool function, imported from .tools.
    ARCHITECTURAL_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
    ]
  • Registers all architectural tools, including create_floor_plan_views, to the FastMCP server using server.tool() decorator.
    for tool in ARCHITECTURAL_TOOLS:
        server.tool()(tool)
  • Usage instruction for the create_floor_plan_views tool in the asset creation strategy prompt.
    - 使用create_floor_plan_views()为每个标高创建平面视图
  • Test script demonstrating the RPC call to CreateFloorPlanViews method with example parameters, likely corresponding to the tool's implementation logic.
    # 构造 JSON-RPC 请求
    json_rpc_request = {
        "jsonrpc": "2.0",
        "method": "CreateFloorPlanViews",
        "params":
            [
                {"levelId": "355", "viewName": "Level 1 - Floor Plan"},
                {"levelId": "2607", "viewName": "Level 2 - Floor Plan"}
            ]
        ,
    }
    
    # 发送更新元素数据
    send_tcp_data(json_rpc_request)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZedMoster/revit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server