0

我正在尝试浏览建筑物的所有房间(或实际上所有空间),以便获取每个空间的相邻空间列表。我在这里这里阅读了一些关于它的非常古老的帖子,但是这些使用 BoundarySegment 对象的“元素”属性,例如:

foreach( BoundarySegment s in b )
...
Element neighbour = s.Element;

如果我没记错的话,这不再可能从 BoundarySegment 访问墙壁对象(?)是否有替代方案?

谢谢,

阿尔诺。

4

1 回答 1

1

访问http://www.revitapidocs.com

搜索 BoundarySegment 类。

我收到消息:“2017 | 活动 API 年的资源不可用...资源仅适用于 2015”。

查看 Revit 2017 API 中的新增功能:

http://thebuildingcoder.typepad.com/blog/2016/04/whats-new-in-the-revit-2017-api.html

过时的 API 删除列表 Autodesk.Revit.DB.BoundarySegment.Element。

你上面提到的两个帖子是:

http://thebuildingcoder.typepad.com/blog/2013/09/room-neighbours.html

http://thebuildingcoder.typepad.com/blog/2009/01/room-and-wall-adjacency.html

两者中提供的所有代码都包含在 The Building Coder 示例中:

https://github.com/jeremytammik/the_building_coder_samples

Building Coder 示例在 GitHub 上维护,并在出现时迁移到新版本的 Revit API。因此,您可以在 GitHub 上查看如何在 Revit 2017 中实现相同的功能,网址为:

https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdRoomWallAdjacency.cs

https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdRoomNeighbours.cs

于 2017-04-11T07:27:21.043 回答