Pyrevit stubs builder doesn't work

I’m trying to install the pyrevit stubs builder for the revitAPI.dll according to the Macro4BIM tutorial.
I don’t get the correct result though.
This is what’s supposed to happen:

But this happens to me:

It doesn’t run, I just get the help screen again. What am I doing wrong? I can’t find the issue myself :sweat_smile:

Syntax is

pystubsbuilder --dest="your path" --search="search path" "dllname.dll"

So this:

same result…

No.
Try again…
There are exactly 3 arguments possible:

  • Destination path, a folder path
  • Search path, a folder path
  • Dll name, a string with the dll name
1 Like

Aha yess, finally got it to work. Thanks!

Please @PieterL_TM
Would you be kind enough to paste the command that worked for you in the end so that other will have a solution if they hit the same wall.

keeping it simple,
this worked for me:
pyrevit-stubsbuilder "C:\Program Files\Autodesk\Revit 2024\RevitAPI.dll"

This worked for me:

pyrevit-stubsbuilder.exe --dest "C:\Users\piete\Documents\Autodesk Revit Python Stubs" --search "C:\Program Files\Autodesk\Revit 2024" "C:\Program Files\Autodesk\Revit 2024\RevitAPI.dll"

However, now I still don’t have the UI API. Doing the analog thing for the APIUI.dll doesn’t work for me. When trying this:

pyrevit-stubsbuilder.exe --dest "C:\Users\piete\Documents\Autodesk Revit Python Stubs UI" --search "C:\Program Files\Autodesk\Revit 2024" "C:\Program Files\Autodesk\Revit 2024\RevitAPIUI.dll"
error: failed generating stubs | Could not load file or assembly 'RevitAPIUI.dll' or one of its dependencies. The specified module could not be found.

It works for many DLLs, I am trying to make one for RevitNodes.dll (Which I assume these are for Revit Nodes portion of Design Script) can anyone try getting these stubs built?

“C:\Program Files\Autodesk\Revit 2024\AddIns\DynamoForRevit\Revit\RevitNodes.dll”