Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FamilyCanConvertToFaceHostBased not giving results as described in the API docs

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
jeanmarc.couffin
282 Views, 3 Replies

FamilyCanConvertToFaceHostBased not giving results as described in the API docs

a user of the pyRevit forum has raised an issue about the tool to convert a family to a face hosted one
 
the original code fro the tool is here
 
The principles are pretty simple, but the application is not doing things in a way to makes sense or is self explanatory.
If I take the docs from the Revit API for the FamilyCanConvertToFaceHostBased method in the FamilyUtils Class
I get that it works with certain categories and hosted by ceiling, wall, ...  families, but I tried it in many revit version, languages, projects to almost no avail. Only one family worked out in all of my tests.

You can find the complete explaination here https://discourse.pyrevitlabs.io/t/convert-family-to-face-hosted/1412/5
 
I did try to debug with the following code to figure out which families coud 'behave'
 
 

 

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, ... ?

3 REPLIES 3
Message 2 of 4

Message 3 of 4

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_0-1675876622923.png

 

 

Message 4 of 4

@RPTHOMAS108 thanks for the detailed reply, It all makes sense now.

 

For the sake of sum things up

  1. no instance placed
  2. specific categories
  3. must be a hosted family

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.

Post to forums  

Forma Design Contest


Rail Community