Find host type for families in project browser but not placed

Hi All,

Does anybody know of a way to find the host type for families loaded into a project but not placed as instances?

I have tried to get parameter node and also clockwork package element host.

Neither of which produce any data for families not placed. What I am trying to do is filter a list so I can place instances by host type in an array of all loaded families.

Below is an image of a workflow that doesn’t work.

Thanks, Simon

42

Host is a family parameter. You’ll have to get the family element, not the family instance.

Hi Nick,

Thanks for the reply. It seems not all families have Host Type has a family parameter.

I think they all have the parameter but some families obviously don’t use a host.

Hi Nick,

What I am trying to do is to create an array of all the families in an project but I first need to know how the find the host type of each family. Do you know which nodes can select family types not family instances?

This is accessible in the document of the family.

This should do it.


use this chart for what each number means in regards to hosting (I believe 0 means it does not require a host)
image

and the python script

import clr
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN
#unwrap all elements to use with API
items = UnwrapElement(IN[0])
typelist = list()
for i in items:
	try:
		typelist.append(i.OwnerFamily)
	except:
		typelist.append(List())
#Assign your output to the OUT variable
OUT = typelist
2 Likes

You don’t even need to access the family document, you can get it directly from the project definition.

1 Like

Thanks Guys,

Thats exactly what I was looking for.

Arraying Families By Host Type #2.dyn (31.5 KB)

1 Like