Hello all,
Ok, I actually have two questions, but they are related and any help would be appreciated.
Question 1:
I have a python node that seems pretty simple, and I do generally get what I am after, but the output of the node shows null, but has a number of items with it.
Here is an image of it after hovering on the node. You can see that it show there are 307 items in the output.
But when I try to expand the list out, I just get a null.
You can also see that the watch node doesn’t produce any results. Anyone have any idea why this would happen? I also tried putting this in a custom node and that provided the same results.
Question 2:
The Custom node is trying to collect all Family Types of a specific category within a Document that is loaded in the background. When I run this script the first time, everything tends to go ok except the first document doesn’t close. Because of this I have to restart everything each time to get it to reset because the document hangs from then on.
Is there something in my node or the way I am handling the Closing of the document that is causing this?
Full Error:
“Close is not allowed when there is any open sub-transaction, transaction or transaction group.”
import System
import clr
clr.AddReference("RevitNodes")
import Revit
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
dataEnteringNode = IN
cats = IN[0]
docs = IN[1]
elems = []
try:
for fd in docs:
TransactionManager.Instance.EnsureInTransaction(fd)
families = set()
for cat in cats:
collector = FilteredElementCollector(fd)
collector.OfCategory(System.Enum.ToObject(BuiltInCategory, cat.Id))
collector.OfClass(FamilySymbol)
types = collector.ToElements()
elems.append(types)
#for type in types:
# families.add(type)
#families = list(families)
TransactionManager.Instance.TransactionTaskDone()
except:
pass
OUT = elems, docs
Thanks in advance for any help you can offer!