get_levels
Retrieve all floor levels from a Revit model to access building elevation data and structural information for design analysis and documentation.
Instructions
获取 Revit 模型中的所有楼层
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:160-167 (registration)Registration of the "get_levels" MCP tool in ListToolsRequestSchema, defining its name, description, and empty input schema.{ name: "get_levels", description: "获取 Revit 模型中的所有楼层", inputSchema: { type: "object", properties: {} } }, {
- src/index.ts:163-166 (schema)Input schema for the get_levels tool (no parameters required).inputSchema: { type: "object", properties: {} }
- src/revitService.ts:88-95 (handler)The handler function in RevitService that executes the get_levels tool logic by delegating to RevitSocketClient.getLevels().async getLevels(): Promise<any[]> { try { return await this.client.getLevels(); } catch (error) { console.error('[RevitService] 获取楼层失败,使用模拟数据:', error); throw error; // 不使用模拟数据,直接抛出错误 } }
- src/revitSocketClient.ts:211-214 (helper)Supporting utility in RevitSocketClient that sends the 'get_levels' command to the Revit plugin via socket and returns the levels.public async getLevels(sortByElevation: boolean = true): Promise<any[]> { const response = await this.sendRequest<any[]>('get_levels', { }); return response; }