Now in Revit 2017.1 revit is equiped with a dynamo player, so apperently someone at autodesk knows how to run dynamo scripts in the revit api.
Does anybody know how I can make my own button in reivt (or the ribbon) that runs a specific dynamo script.