Skip to main content
Glama

create_cable_trays

Automate cable tray creation in Revit using JSON-RPC 2.0. Supports batch creation, unit conversion, type matching, and error handling for efficient modeling workflows.

Instructions

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

特性:

  • 支持批量创建多个电缆桥架

  • 自动处理单位转换(毫米转英尺)

  • 自动匹配桥架类型

  • 支持指定桥架宽度和高度

  • 完善的错误处理机制

参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"CreateCableTrays" params (List[Dict]): 桥架参数列表,每个字典包含: - cableTrayTypeName (str): 桥架类型名称 - startX (float): 起点X坐标(毫米) - startY (float): 起点Y坐标(毫米) - startZ (float): 起点Z坐标(毫米) - endX (float): 终点X坐标(毫米) - endY (float): 终点Y坐标(毫米) - endZ (float): 终点Z坐标(毫米) - width (float): 桥架宽度(毫米) - height (float): 桥架高度(毫米)

返回: 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_cable_trays(ctx, params=[ { "cableTrayTypeName": "梯级式电缆桥架", "startX": 0, "startY": 0, "startZ": 3000, "endX": 5000, "endY": 0, "endZ": 3000, "width": 200, "height": 100 }, { "cableTrayTypeName": "标准", "startX": 5000, "startY": 0, "startZ": 3000, "endX": 5000, "endY": 5000, "endZ": 3000, "width": 200, "height": 100 } ])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoCreateCableTrays
paramsNo

Implementation Reference

  • The create_cable_trays tool function is included in the MEP_TOOLS list used for registration.
    MEP_TOOLS = [ create_ducts, create_pipes, create_cable_trays ]
  • Loop that registers all tools in MEP_TOOLS, including create_cable_trays, to the FastMCP server.
    # 注册MEP工具 for tool in MEP_TOOLS: server.tool()(tool)
  • Import statement that brings in the create_cable_trays function from the tools module.
    from .tools import *

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