DynamoDS / Dynamo

Open Source Graphical Programming for Design
https://dynamobim.org
Other
1.72k stars 633 forks source link

Dynamo crash while "Python Script" opening #9418

Closed MarcinTata closed 4 years ago

MarcinTata commented 5 years ago

Hello. It happened to me first time. "Python from Script" is working and executes provided script. Background: lately I installed VisualStudio2017 with Python package.

Dynamo version

2.0.2.6826

Operating system

W10

What did you do?

I tried to open node "Python Script".

What did you see instead?

Error message.

Setting identificator of connectionId caused exception.

w System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) w System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) w System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) w System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) w PythonNodeModelsWpf.ScriptEditorWindow..ctor(DynamoViewModel dynamoViewModel, PythonNode nodeModel, NodeView nodeView, WindowRect& windowRect) w PythonNodeModelsWpf.PythonNodeViewCustomization.EditScriptContent() w PythonNodeModelsWpf.PythonNodeViewCustomization.view_MouseDown(Object sender, MouseButtonEventArgs e) w System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) w System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) w System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) w System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) w System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) w System.Windows.Input.InputManager.ProcessStagingArea() w System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) w System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) w System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) w System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) w System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) w MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) w MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) w System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) w System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) w System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) w MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) w MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) w System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) w System.Windows.Application.RunDispatcher(Object ignore) w System.Windows.Application.RunInternal(Window window) w DynamoSandbox.DynamoCoreSetup.RunApplication(Application app)

mjkkirschner commented 5 years ago

what python package have you installed in visual studio?

MarcinTata commented 5 years ago

Actually, I'm not sure if it was a 'package' or a set of templates. Anyway I chose it at the same step of installation were I chose version of Visual Strudio (2017). obraz

MarcinTata commented 5 years ago

Reinstallation of Dynamo does not help.

mjkkirschner commented 5 years ago

it's unclear to me if this has anything to do with your use of the python tools for vs.

The exception itself is unfortunately not too useful, it just points to some xaml loader code from .net. But this code is called when the python editor UI is called - which we use AvalonEdit for. I would start there looking for conflicts, like something else loading another version.

MarcinTata commented 5 years ago

Hello,

My packages:

mjkkirschner commented 5 years ago

interesting - where are you running Sandbox from on disk? Have you built sandbox yourself or this is one that installed with DynamoRevit? Can you debug it to see the loaded modules?

mjkkirschner commented 5 years ago

also a first easy debugging step is to remove all the packages from your package folder and just place them outside of the package folder to see if the issue reproduces with all packages removed.

additionally - what versions of .net do you have installed?

MarcinTata commented 5 years ago

I run DynamoSandbox shortcut from desktop. DynamoSandbox is in C:\Program Files\Dynamo\Dynamo Core\2. Removing all packages from package folder WORKS.

Then I found a package that seems to mess with Dynamo: its Simplex. The package enables Dynamo to work with a few other programmes.

These are .NET versions: net

Soooo: Simplex package is the problem.

mjkkirschner commented 5 years ago

is this package opensource somewhere?

marcellosgamb commented 5 years ago

I will work with mjkkirschner to resolve. The simplex package may have extra references that are not needed or may need to be split up Yes it talks with 4 databases Revit, SAP, ETABS, TEKLA

mjkkirschner commented 4 years ago

@marcellosgamb - please reopen this issue if you were not able to resolve the problem with the python node editor.