2017-04-10 94 views
0

內的房間的鄰居我想瀏覽所有的房間(或實際上所有空間)建築物的,爲了得到相鄰空間到這些空間的名單。我看了一下它herehere一些很老的帖子,但這些使用BoundarySegment對象的「元素」屬性,如:獲取的Revit 2017年API

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

如果我沒有記錯,這是不再可能訪問牆來自BoundarySegment(?)的對象是否有替代方案?

感謝,

阿爾諾。

+0

所以鄰居是什麼,共享一堵牆,即使沒有門/打開? – Matt

+0

對於我打算做的,是的! – Arnaud

回答

1

得到了http://www.revitapidocs.com

搜索BoundarySegment類。

我收到消息:「2017 |資源不可用於活動API年...資源僅適用於2015年」。

看看有哪些新的2017年的Revit 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

所有在兩者提供的代碼包含在建築編碼器樣本:

https://github.com/jeremytammik/the_building_coder_samples

Building編碼器樣本保存在GitHub上,隨着他們的出現,他們遷移到新版本的Revit API。因此,你可以看到如何實現在Revit 2017年同樣的事情在GitHub上,網址爲:

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

+0

再次感謝!我不知道樣本是從一個版本維護到另一個版本! – Arnaud