get_locations
Retrieve precise location data for Revit elements in JSON-RPC 2.0 format. Batch query multiple elements, handle unit conversions (feet to millimeters), and process point and curve positions for efficient automation.
Instructions
获取Revit元素的位置信息,支持点和曲线元素,遵循JSON-RPC 2.0规范。 mcp_tool使用时params不要有任何注释信息
特性:
- 支持批量查询多个元素的位置
- 自动处理单位转换(英尺转毫米)
- 支持点位置和曲线位置(直线和圆弧)
- 完善的错误处理机制
参数: ctx (Context): FastMCP上下文对象 method (str): JSON-RPC方法名,默认为"GetLocations" params (List[Dict]): 查询参数列表,每个字典包含: - elementId (Union[str, int]): 要查询的元素ID,优先使用str类型Id
返回: dict: JSON-RPC 2.0格式的响应,结构为: 成功时: { "jsonrpc": "2.0", "result": { "elementId1": [ { "X": float, # X坐标(毫米) "Y": float, # Y坐标(毫米) "Z": float # Z坐标(毫米) }, ... ], ... }, "id": request_id } 失败时: { "jsonrpc": "2.0", "error": { "code": int, "message": str, "data": any }, "id": request_id }
错误代码: -32600: 无效请求 -32602: 无效参数(元素不存在等) -32603: 内部错误 -32700: 解析错误
示例: # 查询多个元素的位置 response = get_location(ctx, params=[ {"elementId": 123456}, {"elementId": "789012"} ])
Input Schema
Name | Required | Description | Default |
---|---|---|---|
method | No | GetLocations | |
params | No |
Input Schema (JSON Schema)
You must be authenticated.
Other Tools from Revit MCP Server
- active_view
- call_func
- create_cable_trays
- create_door_windows
- create_ducts
- create_family_instances
- create_floor_plan_views
- create_floors
- create_grids
- create_levels
- create_pipes
- create_rooms
- create_room_tags
- create_sheets
- create_walls
- delete_elements
- execute_commands
- find_elements
- get_commands
- get_locations
- get_selected_elements
- link_dwg_and_activate_view
- move_elements
- parameter_elements
- show_elements
- update_elements
Related Tools
- @ZedMoster/revit-mcp
- @ZedMoster/revit-mcp
- @ZedMoster/revit-mcp
- @ZedMoster/revit-mcp
- @ZedMoster/revit-mcp