pyRevit
pyRevit copied to clipboard
Print Sheets Error - When working with multiple people in shared model
Describe the bug
We have run into the following issue on numerous occasions and it only occurs when multiple people are working in the same workshared model. The print window opens as normal, operates as normal, but when you click the "Print" button, a print is not initiated and an error window pops up (code pasted at bottom of issue). On 1-2 occasions, this has also crashed Revit (don't have the code from that instance, sorry!).
To Reproduce This issue only appears to occur when multiple people are working in the same workshared model. I have not had it occur individually.
Expected behavior Expected sheets to print.
Desktop (please complete the following information):
`Microsoft Windows [Version 10.0.19044.1889] (c) Microsoft Corporation. All rights reserved.
C:\Users\kyle.pfannenstiel>pyrevit env ==> Registered Clones (full git repos) ==> Registered Clones (deployed from archive/image) master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.9.22032+1638-wip" | Path: "C:\Users\kyle.pfannenstiel\AppData\Roaming\pyRevit-Master" ==> Attachments master | Product: "Autodesk Revit 2022" | Engine: IPY277 (277) | Path: "C:\Users\kyle.pfannenstiel\AppData\Roaming\pyRevit-Master" master | Product: "2021.1.5" | Engine: IPY277 (277) | Path: "C:\Users\kyle.pfannenstiel\AppData\Roaming\pyRevit-Master" master | Product: "Autodesk Revit 2020" | Engine: IPY277 (277) | Path: "C:\Users\kyle.pfannenstiel\AppData\Roaming\pyRevit-Master" master | Product: "Autodesk Revit 2019" | Engine: IPY277 (277) | Path: "C:\Users\kyle.pfannenstiel\AppData\Roaming\pyRevit-Master" ==> Installed Extensions MyCustomExtension | Type: Unknown | Repo: "" | Installed: "C:\Users\kyle.pfannenstiel\Documents\Revit\pyRevit\MyCustomExtension.extension" ==> Default Extension Search Path C:\Users\kyle.pfannenstiel\AppData\Roaming\pyRevit\Extensions ==> Extension Search Paths C:\Users\kyle.pfannenstiel\Documents\Revit\pyRevit ==> Extension Sources - Default https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json ==> Extension Sources - Additional ==> Installed Revits Autodesk Revit 2022 | Version: 22.1.30.34 | Build: 20220520_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022" 2021.1.5 | Version: 21.1.50.27 | Build: 20211018_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021" Autodesk Revit 2020 | Version: 20.2.70.6 | Build: 20220112_1230(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2020" Autodesk Revit 2019 | Version: 19.2.50.16 | Build: 20220111_1110(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2019" ==> Running Revit Instances Error: Object reference not set to an instance of an object. Run with "--debug" option to see debug messages`
Additional context See error code copied from popup window below.
`
ERROR [pyrevit.revit.db.transaction] Error in Transaction Context. Rolling back changes. | <type 'exceptions.Exception'>:Sheet number is already in use. Parameter name: sheetNumber
ERROR [pyrevit.revit.db.transaction] Error in TransactionGroup Context. Rolling back changes. | <type 'exceptions.Exception'>:Sheet number is already in use. Parameter name: sheetNumber
IronPython Traceback:
Traceback (most recent call last):
File "C:\Users\kyle.pfannenstiel\AppData\Roaming\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Drawing Set.panel\Print Sheets.pushbutton\script.py", line 1410, in
Script Executor Traceback:
Autodesk.Revit.Exceptions.ArgumentException: Sheet number is already in use.
Parameter name: sheetNumber
at Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception)
at Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at IronPython.Runtime.Method.MethodBinding1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0) 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.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at IronPython.Compiler.PythonCallTargets.OriginalCallTarget3(PythonFunction function, Object arg0, Object arg1, Object arg2)
at CallSite.Target(Closure , CallSite , Object , Object , RoutedEventArgs )
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Scripting(Object[] , Object , RoutedEventArgs )
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.ShowDialog()
at Microsoft.Scripting.Interpreter.FuncCallInstruction2.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2) 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)`
It probably has something to do with some of the sheets being owned by anyone other that the person submitting the print. I need to look into the code to see if we can add checks for this
I seem to have the same behaviour. Workshared, multiple users, cloudshared
Revit 2022.1.3