Dynamo python code to Revit Plugin



Hi, some time ago i made a Dynamo custom node to automatically join intersecting stuff stuff (walls, floors, beams, etc.).
Now i want to make a Revit plugin with this code, so i can actually share it the easy way.

Everything is fine, except when i’m trying to convert a “Autodesk.Revit.DB.Solid” to “Autodesk.DesignScript.Geometry.Solid” using ToProtoType()

I get a DLL not found exception (LibG.dll)

I found this DLL inside C:\Program Files\Dynamo\Dynamo Core\1.2\libg_223\ LibG.dll
but for some reason i can’t load it into Visual Studio

Can someone help me?


I’m not a plugin coder, so I may be wrong here, but I don’t believe that the libraries for designscript can just be used in a plugin without loading them first. You will likely have to share all of the code for someone to help you here.

Also, why do you feel that a plugin with dll and installation requirements is easier to share than a dyn which can be run via Dynamo player? Not saying you are wrong more curious really.


The libraries for Dynamo and the library for making a Revit plug-in are totally different. You might wanna refer to http://thebuildingcoder.typepad.com/ . They might be of some help to you.



I believe you should reference ProtoGeometry.dll, not LibG… but if you are writing an addin you should probably stick to using just revit api dlls in the case that Dynamo is not around or another version is installed etc.


The way that I found is using RevitPythonShell.
You can save a python script as *.py file. Then using “Deploy RpsAddin” feature of the RevitPythonShell to create the needed .dll. To do that you will need RpsAddin manifest. After you create the .dll files using the RpsAddin manifest file through RevitPythonShell you will need to create standard Revit addin manifest and you are done =)

More information here - https://daren-thomas.gitbooks.io/scripting-autodesk-revit-with-revitpythonshell/content/deploying_rpsaddins/what_happens_when_deploying_an_rpsaddin.html


did you solve your problem?
i get exactly the same error!!!