In your above example, the only issue on the first one is the
Document.Current Node. I outline the reason below.
The OOTB Document nodes return an element of the type,
Revit.Application.Document this works for all the out of the box nodes because it represents the current Revit document, (which is how Dynamo was always meant to run).
Custom nodes (like Rhythm) use the underlying Revit API representation of Documents,
This is by design and for 2 reasons:
- The Dynamo team gave developers no way to use the wrapper for
Revit.Application.Document on our own nodes to reveal the underlying
- By using the
Autodesk.Revit.DB.Document this allows us to use files that are opened in the background. I found out about that a few years ago when I was building family upgraders. The Revit API allows you to load a file in memory with no change in the UI visible to the user. It’s pretty neat! But dangerous and not supported in Dynamo fully.
Further adding to this complexity is the fact that some package developers (that I will not name here), decided to wrap the Document in their own versions. This makes it way more difficult as that made it to where their nodes only work with their own nodes and not anyone else’s.
Autodesk.Revit.DB.Document this allows us to “play nice together” as package developers and use the built-in Revit API mechanisms.