Unable to run dynamo script after receiving error

I ran my script and received an error that the application did not close correctly. I tried to run it again to close the document so my revit family was not left open which caused it to crash. I didn’t save it but when I reopened it nothing would work. I can’t do anything without the same error reproducing. Even if I try to open a new workspace it crashes with the same error of “The managed object is not valid”. I tried closing out and restarting my computer but it didn’t fix the issue. Let me know if I need to provide some more information, thanks!

This shows me trying to run the script but everything is returning “null”. The bottom left shows that the run has started but nothing is happening.

Here is the error code I’m receiving
The managed object is not valid.

at Autodesk.Revit.DB.Transaction.GetStatus()
at RevitServices.Transactions.AutomaticTransactionStrategy.ForceCloseTransaction(TransactionHandle handle)
at Dynamo.Applications.Models.RevitDynamoModel.OnEvaluationCompleted(Object sender, EvaluationCompletedEventArgs e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Dynamo.Graph.Workspaces.HomeWorkspaceModel.OnEvaluationCompleted(EvaluationCompletedEventArgs e)
at Dynamo.Models.DynamoModel.RunCancelImpl(RunCancelCommand command)
at Dynamo.Models.DynamoModel.ExecuteCommand(RecordableCommand command)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
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)

Did you also close Revit?

Yes, the first time I closed Revit. After that didn’t work I restarted my computer. Even when I open a new workspace it still crashes when I try to run a simple script

Try building something in sandbox or studio real quick.

I was actually unaware of what sandbox was until you just said something ha. Sandbox seems to run fine. I can tell because when I switch to Manual run and push the run button it doesn’t crash like dynamo.

Even when all I do is hit the run button on a new work space it still crashes dynamo.

No issue when I hit the run button on Sandbox though.
image

Well, we’re approaching uninstall and reinstall, but I would wait to see if someone else can shed more light on the error first as I’m not sure which…

I’m not very familiar with Sandbox, is it just a standalone version that doesn’t have association to the dynamo I have attached to Revit? One key difference I see is that there is no built in packages on sandbox so I might try and uninstall all the libraries I downloaded and reinstall.

It utilizes dynamo core and severs the Revit tie in. Packages may be the issue but not likely unless you installed something in the session that crashed.

Deleting the packages worked. I should have only deleted one of them so I could see which one it was, but tbh I didn’t think it would work…

1 Like