MicroStation 2024 Python Python Development for MicroStation Programming Examples |
Search LA Solutions for articles about Python …
MicroStation Python was introduced with MicroStation 2024.
MicroStation 2024 provides the Python Manager. You'll find it in the Utilities tool box.
Although it's not mentioned in Python help, the maximum length of a MicroStation Python file name is 48 characters, including the file extension.
A Python file name having more than 48 characters will crash MicroStation without warning.
Bentley Programming Wiki Python Programming Wiki
Title | Link | Comments |
---|---|---|
Bentley Programming Wiki | Python Programming Wiki | Examples by mostly Bentley Systems staff |
DGN Utilities | DGN Utilities | Utilities for Analysing DGN objects |
Title | Link | Comments |
---|---|---|
Get Line Vertices | Get Line Vertices | |
Get Zero-Length Lines | Get Zero-Length Lines | Shows how to build a list of elements with a list comprehension |
Get Element at Offset | Get Element at Offset | |
Count Elements by Type | Count Elements by Type | |
Count Elements by Level | Count Elements on Level | |
ChildElemIter | Enumerate the contents of a complex element | |
Export Text | Export Text Elements to a file | Demonstrates pandas to create an Excel file |
Export Text Table | Export Text Table contents to a file | Demonstrates pandas to create an Excel file |
Import Text | Import Text Elements from a file | Demonstrates pandas to read an Excel file |
Replace Text | Replace Text Elements from Excel | Demonstrates pandas to read an Excel file |
PointElementInfo class | PointElementInfo | Data class used to convey point element information (e.g. Text origin, Cell origin) |
Title | Link | Comments |
---|---|---|
BeFileName Class | BeFileName | Demonstrates MicroStation Python file and folder manipulation |
Class Selector | Choose a class by name | Demonstrates Python match , case and __qualname__ |
Title | Link | Comments |
---|---|---|
Command Table Diagnostics | Test an XML Command Table | |
MicroStation Window Title | Set MicroStation Window Title | |
MicroStation Clock | MicroStation clock using PyQt | See PyQt |
Hello World! | Hello World using PyQt | |
Hello World Version 2 | Hello World using PyQt: Version 2 | |
Hello World Version 3 | Hello World using PyQt: Version 3 | |
Hello World Version 4 | Hello World using PyQt: Version 4 |
Title | Link | Comments |
---|---|---|
Configuration Manager Example | Shows how to use Python Configuration Manager | Demonstrates Python ConfigurationManager |
Get Report Folder | Get Report Folder fom MS_REPORT_OUT |
Title | Link | Comments |
---|---|---|
Get Text Style | Get Units-of-Resolution | Get UORs from a DGN model |
MicroStation 2024 installs Python for you. As with VBA, you don't need to install anything else. MicroStation provides the Python Manager, which you will find in the Utilities tool set.
Install Python | MicroStation 2024 installs Python for you. Python Manager appears in the Utilities menu |
MicroStation installs additional Python modules | See Python help for details |
Fluent Python | O'Reilly Media | A thorough guide to the mechanics of Python |
Geometry for Programmers | Manning Publications | A great introduction to the maths of vectors, matrices and some dedicated Python modules |
Math for Programmers | Manning Publications | Takes an alternative way to CAD to analyse multi-dimensional data |
Title | Article Location | Comments |
---|---|---|
Visual Studio Code | Visual Studio Code | Microsoft freeware |
Jupyter | Jupyter | Interactive development environment for notebooks |
Message Center for Developers | MicroStation Message Center | See examples provided with MicroStation Python |
User Interface: PyQt vs. Tkinter | Comparing PyQt with Tkinter | Two different GUI toolkits: see examples provided with MicroStation Python |
There is a huge range of packages that enhance the Python ecosphere. Python.org provides a search tool to help you find a package.
Some packages are installed by MicroStation, so you don't have to. They are mentioned in the help section API Versions.
To see a full list of the modules delivered with MicroStation …
C:\ProgramData\Bentley\PowerPlatformPython\python
python -m pydoc modules