from pyrevit import revit, DB
all_families = DB.FilteredElementCollector(revit.doc).OfClass(DB.Family).ToElements()
count = 0
for fam in all_families:
if DB.FamilyUtils.FamilyCanConvertToFaceHostBased(revit.doc, fam.Id):
print(
'Family {0} can be converted to face-hosted family.'.format(fam.Name))
else:
count += 1
print('{0} cannot be converted to face-hosted family.'.format(count))
The only family that I could find to work was this one https://mega.nz/file/3s8jGCSJ#h2Kce_3pss7dRVXSEKUu-ISBQBEp1pdQn5OIAG94U_k
The general question is:
What are the exact conditions for a family to be convertible? 3D geometry, initial hosting, ... ?
Solved! Go to Solution.
Solved by jeanmarc.couffin. Go to Solution.
Solved by RPTHOMAS108. Go to Solution.
Although the API documentation has some slight English errors making it hard to understand I believe it is saying that it will return false if you have instances of the family placed in the project?
"True if the family can be converted to face-based. Otherwise false, which will be returned if there any family instances exist in the project, the family is already face-based, or the family does not have a host. Also, false is returned if the family does not belong to one of the following categories:"
I don't really see the great benefit of it if that is the case since you would just edit the family and make them Work plane based. (which then gives you the option for face hosting when it is inserted):
@RPTHOMAS108 thanks for the detailed reply, It all makes sense now.
For the sake of sum things up
Tried it on a table family that was floor based, it worked as expected.
I agree the work plan based option solves it in a different manner without fuss.
Can't find what you're looking for? Ask the community or share your knowledge.