ui
UI functions.
Attributes
Functions
get_mainwindow_hwnd()
Get the handle of the main window.
Returns:
Type | Description |
---|---|
intptr
|
The handle of the main window. |
get_mainwindow()
Get the main window of the application.
Returns:
Type | Description |
---|---|
MainWindow
|
The root visual of the main window. |
Source code in pyrevitlib/pyrevit/revit/ui.py
get_statusbar_hwnd()
Retrieves the handle of the status bar control belonging to the main window.
Returns:
Type | Description |
---|---|
IntPtr
|
The handle of the status bar control. |
Source code in pyrevitlib/pyrevit/revit/ui.py
set_statusbar_text(text)
Sets the text of the status bar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str
|
The text to be displayed in the status bar. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the text was successfully set, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/ui.py
get_window_rectangle()
Get the rectangle coordinates of the main window.
Returns:
Type | Description |
---|---|
Tuple[int, int, int, int]
|
The left, top, right, and bottom coordinates of the window rectangle. |
Source code in pyrevitlib/pyrevit/revit/ui.py
is_infocenter_visible()
Check if the InfoCenter toolbar is visible.
Returns:
Type | Description |
---|---|
bool
|
True if the InfoCenter toolbar is visible, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/ui.py
toggle_infocenter()
Toggles the visibility of the InfoCenter toolbar.
This function retrieves the current visibility state of the InfoCenter toolbar and toggles it to the opposite state. If the toolbar is currently collapsed, it will be set to visible, and if it is currently visible, it will be set to collapsed. The function then returns the visibility state of the InfoCenter toolbar after the toggle operation.
Returns:
Type | Description |
---|---|
bool
|
True if the InfoCenter toolbar is visible, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/ui.py
get_ribbon_roottype()
Get the type of the ribbon root.
Returns:
Type | Description |
---|---|
type
|
type of the ribbon root |
Source code in pyrevitlib/pyrevit/revit/ui.py
get_current_theme()
Get the current UI theme.
Returns:
Name | Type | Description |
---|---|---|
UITheme |
UITheme
|
The current UI theme. |
set_current_theme(theme='Dark')
Sets the current UI theme to either 'Dark' or 'Light'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theme |
str
|
The theme to set. Defaults to 'Dark'. |
'Dark'
|
Source code in pyrevitlib/pyrevit/revit/ui.py
resolve_icon_file(directory, icon_name)
Resolves the icon file path based on the current UI theme.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
directory |
str
|
The directory where the icon file is located. |
required |
icon_name |
str
|
The name of the icon file. |
required |
Returns:
Name | Type | Description |
---|---|---|
full_file_path |
str
|
The full file path of the icon file. |