Welcome to the world of MicroStation Python! In this wiki, we will enable IntelliSense for MicroStation Python APIs in Visual Studio Code editor. IntelliSense provides context for the objects you are using and displays available functions as you type.
Here are the steps to install the PyLance extension in Visual Studio Code for IntelliSense to work for MicroStation Python APIs, enhancing your coding experience:
Furthermore, the settings.json file should reference the directories containing the .PYI files. Follow these steps:
Alternatively, type "Preferences: Open User Settings (JSON)" in the Command Palette search bar.
{ "explorer.confirmDelete": false "python.languageServer": "Default", "python.analysis.stubPath": "C:/ProgramData/Bentley/PowerPlatformPython/Examples/MicroStation/Intellisense", "python.analysis.extraPaths": ["C:/Program Files/Bentley/MicroStation 2024/MicroStation/"], }
Adding the following folders to the system environment variable PYTHONPATH will enable IntelliSense in Visual Studio Code. The function stubs required for IntelliSense are in the following directories.
C:/ProgramData/Bentley/PowerPlatformPython/Examples/MicroStation/Intellisense/
C:/Program Files/Bentley/MicroStation 2024/MicroStation/
By following these steps, you will have IntelliSense set up for MicroStation Python APIs in Visual Studio Code editor, providing context and suggestions as you code.
Python: Documentation | API Presentations | FAQs | GitHub | Samples | Wikis | Blogs