Revit API Autocomplete not working properly in VS code

Hi All,

I’ve installed VS Code 1.90.2 and Python 3.12.3 on my computer. After setting up Python as an interpreter, I added Revit API stubs for path extension as shown below

I tested the API autocomplete, and it works the first time when I access Revit DB, as shown in the example below. However, it does not work the second time when I try to filter using FilteredCollector!?

Any suggestions to solve this issue ?

Thanks.

Place the location of the stubs folder in python.autoComplete.extraPaths and python.analysis.extraPaths

Your folder structure (part view) should look something like this (I have stubs for other software also)
image

Try reloading the window after changing settings <ctrl + shift + p> reload window

1 Like

Hi @Mike.Buttery

I would first like to clarify that I don’t have any version of Revit installed on this PC. I just want to write my codes so I can use them later on another PC where I have Revit 2023 installed.

The subs settings are as indicated in the post above. Are they correct, or should I add other things?

I can’t see any folder when I click on view tab?

Note: I’ve installed ironpython 2.7 before installing vs code and here my settings in vscode:

I reloaded the windows after changing the settings and my issue still no resolved!?

Should I set ironpython 2.7 as interpreter or add other extensions to solve this issue?

Thanks.

Pylance which is the language server (linting, autocompletion etc) for Python on VS Code requires Python 3
I have my interpreter for development to be same as current Dynamo CPython3 which is 3.9

You could downgrade your python extension to use 2.7 for the workspace - details on Stack Overflow here. You may find your settings.json file may have issues and need review