Filter out unconnected walls

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 :slight_smile:

@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.
image

Another way (which might not always be accurate) is to check via location curves:

1 Like

Would this work with an X intersection though?

This should do the trick. Rhythm to the rescue! ConnectedWallCheck.dyn (22.2 KB)


3 Likes

@mikael.z

Hi,

You can try this:

Regards,

2 Likes

I was just about to post an almost identical solution :smiley: But you beat me to it! #greatMindsThinkAlike #outOfTheBoxGoodness

3 Likes

@solamour

:smiley: :+1:

1 Like

Thank you very much @AmolShah !

That was exactly what I was looking for :slight_smile:

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 :pray:

Thank you again :slight_smile:

Best regards,
Mikael

1 Like

@AmolShah, @jacob.small, @Organon, @solamour, thank you all for great ideas!

3 Likes