uimaker
UI maker.
Attributes
mlogger = get_logger(__name__)
module-attribute
CONFIG_SCRIPT_TITLE_POSTFIX = '●'
module-attribute
current_ui = ribbon.get_current_ui()
module-attribute
Classes
UIMakerParams(par_ui, par_cmp, cmp_item, asm_info, create_beta=False)
UI maker parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
par_ui
|
_PyRevitUI
|
Parent UI item |
required |
par_cmp
|
GenericUIComponent
|
Parent UI component |
required |
cmp_item
|
GenericUIComponent
|
UI component item |
required |
asm_info
|
AssemblyInfo
|
Assembly info |
required |
create_beta
|
bool
|
Create beta button. Defaults to False |
False
|
Source code in pyrevitlib/pyrevit/loader/uimaker.py
Attributes
parent_ui = par_ui
instance-attribute
parent_cmp = par_cmp
instance-attribute
component = cmp_item
instance-attribute
asm_info = asm_info
instance-attribute
create_beta_cmds = create_beta
instance-attribute
Functions
setup_combobox(combobox, ui_item, uiapp, script_globals)
Set up ComboBox event handlers from script globals.
This function looks for special global variables in the script and wires them up as event handlers for the ComboBox.
Recognized global variables
- selfinit(component, ui_item, uiapp): Called for initialization
- cmb_on_change(sender, args, ctx): Called when selection changes
- cmb_dropdown_close(sender, args, ctx): Called when dropdown closes
- cmb_dropdown_open(sender, args, ctx): Called when dropdown opens
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
combobox
|
The parsed component metadata |
required | |
ui_item
|
The pyRevit UI wrapper for the ComboBox |
required | |
uiapp
|
The Revit UIApplication instance |
required | |
script_globals
|
dict
|
The globals() dict from the script |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if setup succeeded, False otherwise |
Source code in pyrevitlib/pyrevit/loader/uimaker.py
643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 | |
get_combobox_context(ui_item)
Get the ComboBoxContext for a UI item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ui_item
|
The pyRevit UI wrapper for the ComboBox |
required |
Returns:
| Type | Description |
|---|---|
ComboBoxContext
|
The context object or None |
Source code in pyrevitlib/pyrevit/loader/uimaker.py
update_pyrevit_ui(ui_ext, ext_asm_info, create_beta=False)
Updates/Creates pyRevit ui for the extension and assembly dll address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ui_ext
|
GenericUIContainer
|
UI container. |
required |
ext_asm_info
|
AssemblyInfo
|
Assembly info. |
required |
create_beta
|
bool
|
Create beta ui. Defaults to False. |
False
|
Source code in pyrevitlib/pyrevit/loader/uimaker.py
sort_pyrevit_ui(ui_ext)
Sorts pyRevit UI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ui_ext
|
GenericUIContainer
|
UI container. |
required |
Source code in pyrevitlib/pyrevit/loader/uimaker.py
cleanup_pyrevit_ui()
Cleanup the pyrevit UI.
Hide all items that were not touched after a reload meaning they have been removed in extension folder structure and thus are not updated.
Source code in pyrevitlib/pyrevit/loader/uimaker.py
reflow_pyrevit_ui(direction=applocales.DEFAULT_LANG_DIR)
Set the flow direction of the tabs.