Has this tool become unusable? I have changed the category for my family to every single type listed in this tool, but nothing converts. Is converting a family to a face host-based one possible with another kind? I remember this working back in version 4.4 or something, but I haven’t figured this out since then. Does anyone know how to fix this issue?
Hello, hi @eluvs89
Do you have a family file I could try it on specifically.
There’s a good chance that either the category isn’t right or the base family has no host.
I have tried nearly all the family types listed under the tool, so I tried a brand new wall-hosted lighting fixture family and still, it failed. You can find the basic family I used to test this tool in this link: WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free
Also, that’s a Revit 2023 file.
thanks for the file
I tried it, no success, as expected
I also tried on different project files with this code, just to check if any family would qualify for Conversion…
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))
Well…
I found only one out of 3 project files. And found none in two sample files from Toto’s Desk.
I also tried in Revit in French and English
I could not figure out a common denominator for the CanConvert to pass a True
I could not find further reasons in the API docs ApiDocs.co
I tried changing the category for some families, hosted by wall or non-hosted, etc. Also tried in Revit 2017->2023…
If it worked previously for you in the past, you got lucky!
you can try to figure it out with the family that was working if you feel like it 376 KB file on MEGA
it is more a question for the people developing the Revit API I guess
escalated that on to the Revit API forum. I did not get it at first, while reading the api:
three conditions for the API method to work as expected:
- no instance placed
- specific categories ( see list here ApiDocs.co)
- must be a hosted family
The code for the tool itself has issues I can spot. I will try to look at it and fix it later.
It cannot delete placed instances as it is now. so that is a big no go.
But by itself, if:
- you take a hosted family,
- change its category to match the list
or if it is already of that category
- and you don’t have any instance placed, and select the family from the project browser, it will work.
I tried this with the same family in Revit 2023 and got the error below. The family wasn’t placed anywhere and it is a type that it should work with. Tried with an electrical fixture family as well, but got the same error.
IronPython Traceback:
Traceback (most recent call last):
File “C:\Users\elovell\AppData\Roaming\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Project.panel\ptools.stack\Family.pulldown\Convert Family To Face Host Based.pushbutton\script.py”, line 31, in
AttributeError: ‘FamilySymbol’ object has no attribute ‘Symbol’
Script Executor Traceback:
System.MissingMemberException: ‘FamilySymbol’ object has no attribute ‘Symbol’
at IronPython.Runtime.Binding.PythonGetMemberBinder.FastErrorGet1.GetError(CallSite site, TSelfType target, CodeContext context) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at Microsoft.Scripting.Interpreter.DynamicInstruction
3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)
try selecting the family from the project browser.
I will try to fix it for the general case, but in the meantime, using this method that should work.
I tried with the arch sample file, used the table, set it to the comm devices cat, reloaded it, removed all instances and then selected it from the browser (but I might have tweaked the code in the meantime, I cannot remember)
anyway, I will try and fix it. And then you will owe me a beer if we get to meet
Haha I will gladly buy you a beer if we get to meet. I tried selecting the family from the project browser and still got that same error. Greatly appreciate the help with this. I have no idea how I got this to work way back in the day, but it was so many offices ago that I can barely remember what version of Revit I was even in. I am just surprised that I am the first person to write in about this tool. I have had at least 1 person in every office ask for a family to be converted from one host to face based and this tool was amazing for that. For a while, I was not updating pyRevit from the 4.4 version so I didn’t lose the ability to use this tool.