Passthrough node is not working

First part of this script creates some wall elements, when the second part of it will find out those wall elements from bounding boxes created around Door Window geometry. So the second part of the script need to wait for the first part to be executed. For that I am using passthrough node but seems the bounding box filter still could not find the walls hence returning a empty list. can some one please point me out what am I missing here. I am also sharing the python script and the graph along with it for reference. Any suggestion or help on this will be appreciated.

Drywall IFC Final with UI 30052022 Test Set.dyn (185.2 KB)

import clr
clr.AddReference(‘RevitAPI’)
clr.AddReference(‘System’)
clr.AddReference(‘RevitNodes’)
clr.AddReference(‘RevitServices’)
import Revit
import RevitServices
from Autodesk.Revit.DB import *
from System.Collections.Generic import List
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
doc = DocumentManager.Instance.CurrentDBDocument

#Functions for list handling
def ProcessList(_func, _list):
return map( lambda x: ProcessList(_func, x) if type(x)==list else _func(x), _list )

#Preparing input from dynamo to revit

def ToRevit(item):
return item.ToRevitType(True)

if isinstance(IN[0], list):
bblist = ProcessList(ToRevit, IN[0])
else:
bblist = [ToRevit(IN[0])]

def collectElementsInBB(bb):
outline = Outline(bb.Min, bb.Max)
filter = BoundingBoxIntersectsFilter(outline)
collector = FilteredElementCollector(doc, doc.ActiveView.Id).WherePasses(filter)
return [e.ToDSType(True) for e in collector]

OUT = ProcessList(collectElementsInBB, bblist)

Try this in code block:

[passthrough,waitfor][0];

I am not sure but I is not this is the same code block that is inside the Passthrough custom node. I am not using the node properly or proper location. Missing out something for input node of python script.

It’s likely that you can’t pull the geometry data from the walls until the transaction has completed, as they haven’t been committed, and so deeper properties aren’t returning correct values or even a null value. Add a Transaction.End and a Transaction.Start right after the pass though and see if that fixes things.

2 Likes

Thanks a lot @jacob.small. You are a genius. :star_struck: :star_struck: :star_struck:

Not really. Just seen a lot in my day. :slight_smile: