I’m using Rhythm’s Application.GetOpenDocuments to get all the open documents and then trying to filter out projects. The rhythm node gives Autodesk.Revit.DB.Document but the Document.IsFamilyDocument requires Revit.Application.Document. Is there a way to convert this or is there another node I can use to get open documents that provides the correct output?
Warning:
Warning: Document.IsFamilyDocument expects argument type(s) (Revit.Application.Document), but was called with (Autodesk.Revit.DB.Document).
Hmm. That might need a python node since I’m returning the core revit.db object. Last time I looked at it, the wrapper for ‘Revit.Application.Document’ was not public.
I think this should work. Let me know because I typed it on my phone.
# import common language runtime
import clr
# Import RevitAPI
clr.AddReference('RevitAPI')
# Import the appropriate classes we need
from Autodesk.Revit.DB import *
def IsFamDoc(doc):
return doc.IsFamilyDocument
docs = IN[0]
#return the results
if isinstance(IN[0], list): OUT = [IsFamDoc(x) for x in docs]
else: OUT = IsFamDoc(docs)
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 14, in
File “”, line 9, in IsFamDoc
TypeError: bool is not callable
Your a superstar. I haven’t had a chance to test the fix to the python you posted earlier but I will check both that and the package update as soon as I have time. Thanks.