dnenov / pyChilizer

GNU General Public License v3.0
20 stars 8 forks source link

Room Plan View Causes Errors #51

Open DarkElephantDesignTech opened 1 year ago

DarkElephantDesignTech commented 1 year ago

I discovered an issue with "Room Data View" tool that causes the following error when there is no view type with exact name " Floor Plan". See the error below. I was able to figure this by inspecting the code, instead of picking Floor Plan types, it looks for types that are literally named "Floor Plan".

Room Data sheet tool doesn't seem to be impacted by this error, it happens only when I use "Room Plan View". I was able to work around this by creating a view type and name it "Floor Plan", but it would be nice to resolve this (:

IronPython Traceback:
Traceback (most recent call last):
 File "C:\Users\ykaranfil\AppData\Roaming\pyRevit\Extensions\pyChilizer.extension\pyChilizer.tab\Project.panel\rooms.stack\Room Plan View.pushbutton\script.py", line 28, in <module>
IndexError: index out of range: 0

Script Executor Traceback:
System.IndexOutOfRangeException: index out of range: 0
 at IronPython.Runtime.Operations.PythonOps.FixIndex(Int32 v, Int32 len)
 at IronPython.Runtime.List.get_Item(Int32 index)
 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)