I have customised a clockwork node so that I can get all of the family types from within a queried family document from file path.
I can get its name (as that seems to be one of the only available properties on API docs of the family type class) but when outputting it I am having trouble trying to get the actual ‘Family Type’ back into a Dynamo compatible object.
Instead I am stuck with the Revit API object ‘Autodesk.Revit.DB.FamilyType’
Since this object has no Id property and I failed in trying to use the .ToDSType() command, how would it be possible to get the revit entity as a dynamo entity?
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
#doc = DocumentManager.Instance.CurrentDBDocument
doc = IN[0]
elementlist = list()
nameslist = list()
if doc.IsFamilyDocument:
for ftype in doc.FamilyManager.Types:
elementlist.append(ftype)
nameslist.append(ftype.Name)
OUT = [elementlist,nameslist]
@haganjake2 I think it is not possible to get the family types within a family document since the family needs to be “placed” within a project document so the types can “exist”, even the Family.All node from the Orchid package will output families within a family document, and not the family types created within the family document, maybe I am wrong…That being said, you can try a workaround to load families to a blank project and then extract the family types by family, hope it is what you are after:
In my experience types of actual families in the family editor environment aren’t able to be wrapped back (I think, pretty sure I tried that). Usually when working with family types I use custom nodes to work with that object in its DB state, and it should be fine to pass into other nodes. Family types in family documents are quite unique in how they work, another good example of this is the forwarditerator for getting family types which is quite different from iterating with other objects in Dynamo/Revit.
Hrm there aren’t many out there I’ve come across aside from Orchid. I built a handful into Crumple in Python as I couldn’t get consistent outcomes from Orchid over time (list levels and condense options seemed to change between builds, unsure).