Bimorph CADLayersInUse requires Revit restart between changing documents

Hi all,

Using bimorph nodes today to speed up the process of converting a handful of DWG details downloaded from a manufacturer to Revit Detail Item Families, I ran into an issue with CAD.LayersInUse reporting an Empty List, which in turn caused CAD.DetailLinesFromCADLayers to fail:

detail lines from cad layers

The issue was resolved by restarting Revit and I am assuming it has something to do with changing documents, but I thought that restarting Dynamo would reconcile the document changes. I am hoping someone might explain to me what causes this? It isn’t entirely problematic for me given that running through several Family documents creating detail lines via Dynamo isn’t a daily task, and the time spent restarting Revit is considerably less than the time spent using Pick Lines to convert DWG details; I would just like to understand what is occurring.

Thanks in advance for any input :slight_smile:

Hmm might have spoken too soon, I believe this is the explanation:

EDIT: Might have spoken too soon again :speak_no_evil: … the Document.Current and Document.ActiveView nodes were still reporting correctly from what I could tell, but maybe this is because they have matching Element IDs between documents since it was a new Revit family from Detail Item Template

Hi @awilliams thanks for posting this, you are spot-on with the problem, I’ve managed to consistently reproduce the error, and it is the document object becoming invalid when you switch documents within the same Revit session.

The corruption is occurring in the BimorphNodes and the Document.Current and Document.ActiveView nodes (they will also throw exceptions if you refresh them by modifying their inputs for example).

I’ve since updated BimorphNodes and the issue is resolved in the up-coming v2.2 update due in January. However, you will still get corruptions in the OOTB Document nodes until this problem is fixed by the Dynamo devs (cc @Michael_Kirschner2). The good news is, once the v2.2 update is released, should you experience this exception again, you can avoid restarting Revit/Dynamo entirely by deleting the Document.Current and Document.ActiveView nodes and placing fresh ones on the graph to fix the problem while the Dynamo team investigate/update.

1 Like

Thanks for the explanation @Thomas_Mahon :+1: looking forward to the update in January

1 Like