我已尝试通过Forge API从Revit文件的Sheets (3D Submission)获取Area对象。使用此链接,区域信息不存在,即使我已在工作表中添加了该区域。GET /modelderivative/v2/designdata/{urn}/metadata/{guid of sheet}/properties
我的目标是在 2D / Sheets (3D Submission)中标记区域。我怎样才能做到这一点 ?
区域,我的意思是这样 >>在 2D 中标记区域
我已尝试通过Forge API从Revit文件的Sheets (3D Submission)获取Area对象。使用此链接,区域信息不存在,即使我已在工作表中添加了该区域。GET /modelderivative/v2/designdata/{urn}/metadata/{guid of sheet}/properties
我的目标是在 2D / Sheets (3D Submission)中标记区域。我怎样才能做到这一点 ?
区域,我的意思是这样 >>在 2D 中标记区域
区域对象看起来像 Revit Room 或 Revit Zoom。如果您的缩放或房间在查看器上是可点击的,那么您可以通过 API Get Properties获取其属性。这是我用来归档您想要的内容的几个步骤,您可以比较是否有遗漏的内容。
检查房间/区域元素在您的 Revit 工作表中是否有效。房间/区域应由墙壁或Room Separation
/围起来Area Boundary
。
将配置良好的 RVT 上传到 Forge 进行翻译。
翻译完成后,A102 - Plans
通过 Forge Viewer 加载工作表视图(在本例中称为),并确保视图中的房间/区域元素是可点击的。
通过检索objectId
所选房间/区域的viewer.getSelection()
。例如objectId of the selected room/area in this view is
4089`。
调用 API GET :urn/metadata来获取工作表的guid
. 现在是abdacd31-f94c-e84f-9a58-4663e281d894
例如。
{ "data": { "type": "metadata", "metadata": [ { "name": "{3D}", "role": "3d", "guid": "6bfb4886-f2ee-9ccb-8db0-c5c170220c40" }, { "name": "A102 - Plans", "role": "2d", "guid": "abdacd31-f94c-e84f-9a58-4663e281d894" } ] } }
Kitchen & Dining 101 [857279]
和 id的房间4089
在 API 响应中。{ "objectid": 4084, "name": "Rooms", "objects": [ { "objectid": 4085, "name": "Bath 203 [857200]" }, { "objectid": 4086, "name": "Bath 205 [857203]" }, { "objectid": 4087, "name": "Bedroom 202 [857206]" }, { "objectid": 4088, "name": "Entry Hall 201 [857209]" }, { "objectid": 4089, "name": "Kitchen & Dining 101 [857279]" } ] }
/modelderivative/v2/{YOUR_RVT_URN}/metadata/abdacd31-f94c-e84f-9a58-4663e281d894/properties?objectid=4089
它的响应如下所示,那么您将在响应中看到您想要显示的区域。{ "data": { "type": "properties", "collection": [ { "objectid": 4089, "name": "Kitchen & Dining 101 [857279]", "externalId": "e6ac360b-aaed-4c3b-a130-36b4c2ac9d13-000d1467", "properties": { "Constraints": { "Base Offset": "0.000 mm", "Level": "Level 1", "Limit Offset": "6500.000 mm", "Upper Limit": "Level 1" }, "Dimensions": { "Area": "26.971 m^2", "Computation Height": "0.000 mm", "Perimeter": "29060.000 mm", "Unbounded Height": "6500.000 mm", "Volume": "118.317 m^3" }, "Identity Data": { "Base Finish": "", "Ceiling Finish": "", "Comments": "", "Department": "", "Floor Finish": "", "Image": "", "Name": "Kitchen & Dining", "Number": "101", "Occupancy": "", "Occupant": "", "Wall Finish": "" }, "Phasing": { "Phase": "Working Drawings" } } } ] } }
希望有帮助~