Don’t know if this is a runtime issue, but all of a sudden one of my scripts is broken.
the cultprit seems to be this method.
floortypes = DB.FilteredElementCollector(active_doc).OfClass(DB.FloorType.ToElements()
for ft in floortypes: # type: DB.FloorType
print(ft.Name) # <-- this is line 81
Gives me this traceback
IronPython Traceback:
Traceback (most recent call last):
File "...\create_wideslab_script.py", line 422, in <module>
File "...\create_wideslab_script.py", line 251, in pick_refs_main
File "...\Create WideSlab.pushbutton\create_wideslab_script.py", line 81, in get_document_wideslab_type
AttributeError: Name
Script Executor Traceback:
System.MissingMemberException: Name
at CallSite.Target(Closure , CallSite , Object , CodeContext )
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 System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
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)
And the weird thing, this runs perfectly fine in the revit python shell. Has been working for me forever.
What’s even weirder. If I print(dir(ft))
I can see the name attr in the list of attriburtes. It’s maddening.
So it has the property… but I can’t read it?
Currently running pyrevit with 279 engine, tried reloading, rebooting, changing engine