Hello,
I’m trying to find a way to use the API to filter out walls that are not connected to another wall. Like this:
Any of you done this before or have any idea how it could be done?
Best regards,
Mikael
Hello,
I’m trying to find a way to use the API to filter out walls that are not connected to another wall. Like this:
Any of you done this before or have any idea how it could be done?
Best regards,
Mikael
@mikael.z Look into this property:
https://www.revitapidocs.com/2019/ddb745bd-7bf5-1e2d-6166-1dffa8427565.htm
This has already been implemented in one of GeniusLoci’s nodes.
Another way (which might not always be accurate) is to check via location curves:
Would this work with an X intersection though?
I was just about to post an almost identical solution But you beat me to it! #greatMindsThinkAlike #outOfTheBoxGoodness
Thank you very much @AmolShah !
That was exactly what I was looking for
Here is my solution:
# IMPORT
import sys
import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
# CODE
doc = DocumentManager.Instance.CurrentDBDocument
walls = FilteredElementCollector(doc, doc.ActiveView.Id).WherePasses(
ElementCategoryFilter(BuiltInCategory.OST_Walls)).ToElements()
unconnected_walls = [wall for wall in walls if all([
wall.Location.ElementsAtJoin[0].IsEmpty,
wall.Location.ElementsAtJoin[1].IsEmpty]) == True]
OUT = unconnected_walls
Please comment on my code if you see any improvement that can be made
Thank you again
Best regards,
Mikael
@AmolShah, @jacob.small, @Organon, @solamour, thank you all for great ideas!