DynamoDS / DynamoRevit

Dynamo Libraries for Revit
https://dynamobim.org
328 stars 184 forks source link

Dynamo player destroys graphs #2691

Open dimven opened 3 years ago

dimven commented 3 years ago

Dynamo version

2.6.1

Revit version

2021

Operating system

Win 10

What did you do?

Ran a nicely laid out and grouped graph through dynamo player

What did you expect to see?

The same.

What did you see instead?

This POS: image

~100 nodes on top of each other and no more groups 🤦

And no, the auto node layout (Ctrl + L) is not a solution, because it's oblivious to the logical grouping of the nodes.

Bonus points:

Now the code blocks are broken too image

mjkkirschner commented 3 years ago

Hey @dimven - can you describe your workflow a bit more - maybe some background will help get to the bottom of it.

Especially given the failure to load the codeblock view - this appears to be some kind of datarace or view layer conflict - Do you have lots of addins and packages installed? (I'll assume yes?)

I think getting the list of loaded modules when this occurs, and maybe a gif of your workflow will help us understand whats going on.

https://docs.microsoft.com/en-us/sysinternals/downloads/listdlls can be used if you don't have visual studio on this machine.

dimven commented 3 years ago

The only plugin I have on the Revit side is RevitLookup. However I do have a bunch of packages and a few view extensions in Dynamo: image

I dug through the logs from yesterday and this part stood out:

2021-04-16 09:08:33Z : Active view is now FSSD-_3D MODEL
2021-04-16 09:08:36Z : Failed to apply NodeViewCustomization for CodeBlockNodeModel
2021-04-16 09:08:36Z : System.NullReferenceException:
2021-04-16 09:08:36Z : Object reference not set to an instance of an object.
2021-04-16 09:08:36Z :    at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateClassHighlightRule(EngineController engineController)
   at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateHighlightingRules(TextEditor editor, EngineController controller)
   at Dynamo.UI.Controls.CodeBlockEditor..ctor(NodeView nodeView)
   at Dynamo.Wpf.CodeBlockNodeViewCustomization.CustomizeView(CodeBlockNodeModel model, NodeView nodeView)
   at lambda_method(Closure , NodeModel , NodeView )
   at Dynamo.Wpf.NodeViewCustomizationLibrary.TryApplyCustomization(NodeModel model, NodeView view, InternalNodeViewCustomization customization)
2021-04-16 09:08:36Z : Failed to apply NodeViewCustomization for CodeBlockNodeModel
2021-04-16 09:08:36Z : System.NullReferenceException:
2021-04-16 09:08:36Z : Object reference not set to an instance of an object.
2021-04-16 09:08:36Z :    at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateClassHighlightRule(EngineController engineController)
   at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateHighlightingRules(TextEditor editor, EngineController controller)
   at Dynamo.UI.Controls.CodeBlockEditor..ctor(NodeView nodeView)
   at Dynamo.Wpf.CodeBlockNodeViewCustomization.CustomizeView(CodeBlockNodeModel model, NodeView nodeView)
   at lambda_method(Closure , NodeModel , NodeView )
   at Dynamo.Wpf.NodeViewCustomizationLibrary.TryApplyCustomization(NodeModel model, NodeView view, InternalNodeViewCustomization customization)
2021-04-16 09:08:36Z : Failed to apply NodeViewCustomization for CodeBlockNodeModel
2021-04-16 09:08:36Z : System.NullReferenceException:
2021-04-16 09:08:36Z : Object reference not set to an instance of an object.
2021-04-16 09:08:36Z :    at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateClassHighlightRule(EngineController engineController)
   at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateHighlightingRules(TextEditor editor, EngineController controller)
   at Dynamo.UI.Controls.CodeBlockEditor..ctor(NodeView nodeView)
   at Dynamo.Wpf.CodeBlockNodeViewCustomization.CustomizeView(CodeBlockNodeModel model, NodeView nodeView)
   at lambda_method(Closure , NodeModel , NodeView )
   at Dynamo.Wpf.NodeViewCustomizationLibrary.TryApplyCustomization(NodeModel model, NodeView view, InternalNodeViewCustomization customization)
2021-04-16 09:08:36Z : Failed to apply NodeViewCustomization for CodeBlockNodeModel
2021-04-16 09:08:36Z : System.NullReferenceException:
2021-04-16 09:08:36Z : Object reference not set to an instance of an object.
2021-04-16 09:08:36Z :    at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateClassHighlightRule(EngineController engineController)
   at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateHighlightingRules(TextEditor editor, EngineController controller)
   at Dynamo.UI.Controls.CodeBlockEditor..ctor(NodeView nodeView)
   at Dynamo.Wpf.CodeBlockNodeViewCustomization.CustomizeView(CodeBlockNodeModel model, NodeView nodeView)
   at lambda_method(Closure , NodeModel , NodeView )
   at Dynamo.Wpf.NodeViewCustomizationLibrary.TryApplyCustomization(NodeModel model, NodeView view, InternalNodeViewCustomization customization)
2021-04-16 09:08:36Z : Failed to apply NodeViewCustomization for CodeBlockNodeModel
2021-04-16 09:08:36Z : System.NullReferenceException:
2021-04-16 09:08:36Z : Object reference not set to an instance of an object.
2021-04-16 09:08:36Z :    at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateClassHighlightRule(EngineController engineController)
   at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateHighlightingRules(TextEditor editor, EngineController controller)
   at Dynamo.UI.Controls.CodeBlockEditor..ctor(NodeView nodeView)
   at Dynamo.Wpf.CodeBlockNodeViewCustomization.CustomizeView(CodeBlockNodeModel model, NodeView nodeView)
   at lambda_method(Closure , NodeModel , NodeView )
   at Dynamo.Wpf.NodeViewCustomizationLibrary.TryApplyCustomization(NodeModel model, NodeView view, InternalNodeViewCustomization customization)
2021-04-16 09:08:36Z : Failed to apply NodeViewCustomization for CodeBlockNodeModel
2021-04-16 09:08:36Z : System.NullReferenceException:
2021-04-16 09:08:36Z : Object reference not set to an instance of an object.
2021-04-16 09:08:36Z :    at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateClassHighlightRule(EngineController engineController)
   at Dynamo.Wpf.Views.CodeHighlightingRuleFactory.CreateHighlightingRules(TextEditor editor, EngineController controller)
   at Dynamo.UI.Controls.CodeBlockEditor..ctor(NodeView nodeView)
   at Dynamo.Wpf.CodeBlockNodeViewCustomization.CustomizeView(CodeBlockNodeModel model, NodeView nodeView)
   at lambda_method(Closure , NodeModel , NodeView )
   at Dynamo.Wpf.NodeViewCustomizationLibrary.TryApplyCustomization(NodeModel model, NodeView view, InternalNodeViewCustomization customization)
2021-04-16 09:08:48Z : DynamoPackageManager (id: FCABC211-D56B-4109-AF18-F434DFE48139) extension is removed
2021-04-16 09:08:48Z : Goodbye

I suspect the issue was from the Monocle view extension. I updated it and can't replicate the issue any more. I think I was on the 2020.10.1 version prior to the update. It comes with a version of the Xceed Toolkit and so do Dynamo and Revit. My best guess is this was creating a version conflict and the update resolved it.

Isn't there a better way to avoid these issues? Do you know of any event similar to AppDomain.AssemblyLoad or AppDomain.AssemblyResolve that triggers before the load and can check if an assembly with that name is already loaded and use it instead?

The weird thing here was that this issue only occurred after using player. Running dynamo as usual showed no problems whatsoever.

Regarding the workflow, I didn't do anything peculiar.

louistrue commented 3 years ago

Happened to me too a few days ago. Used Dynamo Player, then opened graph directly from Player. All nodes in one place, no groups. Also have monocle installed. Closing Revit and reopening the graph in a new revit session resolved the issue for me. Everything went back to normal.

johnpierson commented 3 years ago

I suspect the issue was from the Monocle view extension. I updated it and can't replicate the issue any more. I think I was on the 2020.10.1 version prior to the update. It comes with a version of the Xceed Toolkit and so do Dynamo and Revit. My best guess is this was creating a version conflict and the update resolved it.

The previous version might have still had the Custom Node coloring feature I had before. I removed that recently as I did not like how it iterated through the node views. Do you think the view extension could have been doing this? I have seen similar errors before with graphs "stacking" nodes, (before monocle existed in some cases).