Passing Document.Current to a DLL import

Hi all,

I’m just scratching the surface of writing a C# dll to contain various customized functions to support my office. I ran into a snag quite early! Why can’t the dynamo Revit.Application.Document object be passed to C# API Revit.Application.DB.Document? This seemed like a no-brainer…but there’s a lot I don’t know about dynamo yet.

I’ve heard you’re supposed to used a Dictionary object for output, and I understand the reason, so ignore my output data type for now.

Any advice would be appreciated,
James

There is no default wrapper for Document if memory serves.

You’re passing a Dynamo reference to the document, not the document itself. Try getting the path and checking if you have an open document with that property.

Hi @funkitect

here an example to convert Dynamo document to Revit document