0

In my office, I have a PC that does not meet the minimum requirements to install Revit. I want to use it just for writing my API codes in VS Code, so I can use them later on another PC with Revit installed

here my settings in vscode

enter image description here

As an example, I can acces Autodesk.Revit.DB as shown below but not the classs FilteredElementCollector

enter image description here

2 Answers 2

0

You can probably achieve what you need simply by copying the Revit API .NET assembly DLLs onto your programming machine. They are installed in the same directory as Revit.exe. They are also available in various NuGet packages; search for something like NuGet Revit API to find them.

0

Yes you can! I use it in a daily basis as a RevitAPI developer!

First you need to create stubs that are dummy "objects". You can use this (https://github.com/gtalarico/ironpython-stubs or https://github.com/BIMOpenGroup/RevitAPIStubs) library to create them. If you don't have revit installed someone might help you create them.

After creating them you have to add their path to the VSCode workspace settings.json.

    "python.autoComplete.extraPaths": [
    "${workspaceFolder}\\etc\\revit-api-stubs\\common",
    "${workspaceFolder}\\etc\\revit-api-stubs\\revit\\2022",

After adding them it will show up on autocomplete.

New contributor
Mátyás Csanády is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.