Nodes dissapear after reopening file


#1

When I add nodes to a graph, then save and reopen the graph, most of the nodes I placed are gone. Can anyone help me troubleshoot this issue?

Only occurs in Revit 2018.3.2 + Dynamo 2.0.2. I have tested with Revit 2019 + Dynamo 2.0.2 on this same computer and everything works as expected.


#2

please try checking in the dynamo console for errors.

Also it may be some addin in 2018 causing conflicts with json.net - I would try first disabling addins or finding the difference between addins in 2019 / 2018.


#3

I checked the console I was getting errors like this:
This graph has a nodeview with id:03890bcc-a32c-46d1-9812-3e34adbdcb4c and name:String, but does not contain a matching nodeModel

This appears to be the same issue as this tread: Nodes and Wires Missing When Opening DYN File

After removing all addins and installing them back one at a time, I can confirm the error is caused by PyRevit. I will follow up with them to resolve this.


#4

indeed - pyrevit uses a newer version of json.net -

We (dynamo team) advise using the same version as revit (9.0.1) if possible - (and definitely not shipping another one) - this is likely to cause issues at runtime.


#5

While I understand your point, you can hardly blame another project for wanting to use something newer than what was available in 2016.


#6

Is there a way to point Dynamo to the json.net it likes so the one in PyRevit doesn’t confuse it? I am also having nodes disappear and I would like to use both tools.


#7

@Michael_Kirschner2, could you please verify the version of json once more

I use 8.0.3, which has been the recommendation until now as far as I know… but I might be wrong!?


#8

we’ve tested 8.0.3 and 9.0.1 with dynamo and these seem to work okay. Newer versions loaded into the same app domain first seem to cause issues when using json .net attributes at runtime… we may be able to hack around this by either not using attributes or comparing attribute names as strings, but long term other solutions will be required like separate app domains, or IPC. For this specific deserialization issue - I’m hoping there is a way to unify constructors to do the right thing even if the json constructor does not get called, but it will take more research and probably a context parameter.


#9

thanks @Michael_Kirschner2
I will stay on 8.0.3 until you officially will change the recommendation then… better safe than sorry :slight_smile:


#10

Team,
Multiple DLLs can be loaded into the application when their version and signature is different. (Currently I have Newtonsoft.Json 9.0.0.0 and 12.0.0.0 loaded in my Revit 2018). The responsibility is on the calling app to make the binding specific to that version. Dynamo, as a professionally distributed application, should be specific in its bindings and reference the exact DLL version that it needs to work. Otherwise it will default on the currently loaded (in case of Newtonsoft.Json, pyRevit loads that on startup - although pyRevit loads later than Dynamo it loads all its DLLs on startup.) which could be the incorrect version.

Let me know if there is anything I need to fix or improve on my side please to make this work: https://github.com/eirannejad/pyRevit/issues