ribbon
Base module to interact with Revit ribbon.
Attributes
mlogger = get_logger(__name__)
module-attribute
PYREVIT_TAB_IDENTIFIER = 'pyrevit_tab'
module-attribute
ICON_SMALL = 16
module-attribute
ICON_MEDIUM = 24
module-attribute
ICON_LARGE = 32
module-attribute
DEFAULT_DPI = 96
module-attribute
DEFAULT_TOOLTIP_IMAGE_FORMAT = '.png'
module-attribute
DEFAULT_TOOLTIP_VIDEO_FORMAT = '.swf'
module-attribute
Classes
PyRevitUIError
Bases: PyRevitException
Common base class for all pyRevit ui-related exceptions.
Attributes
msg
property
Return exception message.
ButtonIcons(image_file)
Bases: object
pyRevit ui element icon.
Upon init, this type reads the given image file into an io stream and releases the os lock on the file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_file |
str
|
image file path to be used as icon |
required |
Attributes:
Name | Type | Description |
---|---|---|
icon_file_path |
str
|
icon image file path |
filestream |
FileStream
|
io stream containing image binary data |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
Attributes
icon_file_path = image_file
instance-attribute
filestream = IO.FileStream(image_file, IO.FileMode.Open, IO.FileAccess.Read)
instance-attribute
small_bitmap
property
Resamples image and creates bitmap for size :obj:ICON_SMALL
.
Returns:
Type | Description |
---|---|
BitmapSource
|
object containing image data at given size |
medium_bitmap
property
Resamples image and creates bitmap for size :obj:ICON_MEDIUM
.
Returns:
Type | Description |
---|---|
BitmapSource
|
object containing image data at given size |
large_bitmap
property
Resamples image and creates bitmap for size :obj:ICON_LARGE
.
Returns:
Type | Description |
---|---|
BitmapSource
|
object containing image data at given size |
Functions
recolour(image_data, size, stride, color)
staticmethod
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
check_icon_size()
Verify icon size is within acceptable range.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
create_bitmap(icon_size)
Resamples image and creates bitmap for the given size.
Icons are assumed to be square.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
icon_size |
int
|
icon size (width or height) |
required |
Returns:
Type | Description |
---|---|
BitmapSource
|
object containing image data at given size |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
GenericPyRevitUIContainer()
Bases: object
Common type for all pyRevit ui containers.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
container name |
itemdata_mode |
bool
|
if container is wrapping UI.*ItemData |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
Attributes
name = ''
instance-attribute
itemdata_mode = False
instance-attribute
visible
property
writable
Is container visible.
enabled
property
writable
Is container enabled.
Functions
process_deferred()
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_rvtapi_object()
set_rvtapi_object(rvtapi_obj)
Set underlying Revit API object for this container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rvtapi_obj |
obj
|
Revit API container object |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_adwindows_object()
Return underlying AdWindows API object for this container.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_flagged_children(state=True)
Get all children with their flag equal to given state.
Flagging is a mechanism to mark certain containers. There are various reasons that container flagging might be used e.g. marking updated containers or the ones in need of an update or removal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
flag state to filter children |
True
|
Returns:
Type | Description |
---|---|
list[*]
|
list of filtered child objects |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
keys()
values()
is_native()
staticmethod
is_dirty()
Is dirty flag set.
set_dirty_flag(state=True)
Set dirty flag to given state.
See .get_flagged_children()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
state to set flag |
True
|
contains(pyrvt_cmp_name)
Check if container contains a component with given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pyrvt_cmp_name |
str
|
target component name |
required |
find_child(child_name)
Find a component with given name in children.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
child_name |
str
|
target component name |
required |
Returns:
Type | Description |
---|---|
Any
|
component object if found, otherwise None |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
activate()
Activate this container in ui.
deactivate()
Deactivate this container in ui.
get_updated_items()
get_unchanged_items()
reorder_before(item_name, ritem_name)
Reorder and place item_name before ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the right |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_beforeall(item_name)
Reorder and place item_name before all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_after(item_name, ritem_name)
Reorder and place item_name after ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the left |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_afterall(item_name)
Reorder and place item_name after all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
GenericRevitNativeUIContainer()
Bases: GenericPyRevitUIContainer
Common base type for native Revit API UI containers.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
Attributes
name = ''
instance-attribute
itemdata_mode = False
instance-attribute
visible
property
writable
Is container visible.
enabled
property
writable
Is container enabled.
Functions
process_deferred()
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_rvtapi_object()
set_rvtapi_object(rvtapi_obj)
Set underlying Revit API object for this container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rvtapi_obj |
obj
|
Revit API container object |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_adwindows_object()
Return underlying AdWindows API object for this container.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_flagged_children(state=True)
Get all children with their flag equal to given state.
Flagging is a mechanism to mark certain containers. There are various reasons that container flagging might be used e.g. marking updated containers or the ones in need of an update or removal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
flag state to filter children |
True
|
Returns:
Type | Description |
---|---|
list[*]
|
list of filtered child objects |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
keys()
values()
is_dirty()
Is dirty flag set.
set_dirty_flag(state=True)
Set dirty flag to given state.
See .get_flagged_children()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
state to set flag |
True
|
contains(pyrvt_cmp_name)
Check if container contains a component with given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pyrvt_cmp_name |
str
|
target component name |
required |
find_child(child_name)
Find a component with given name in children.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
child_name |
str
|
target component name |
required |
Returns:
Type | Description |
---|---|
Any
|
component object if found, otherwise None |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_updated_items()
get_unchanged_items()
reorder_before(item_name, ritem_name)
Reorder and place item_name before ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the right |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_beforeall(item_name)
Reorder and place item_name before all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_after(item_name, ritem_name)
Reorder and place item_name after ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the left |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_afterall(item_name)
Reorder and place item_name after all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
is_native()
staticmethod
activate()
Activate this container in ui.
Under current implementation, raises PyRevitUIError exception as native Revit API UI components should not be changed.
deactivate()
Deactivate this container in ui.
Under current implementation, raises PyRevitUIError exception as native Revit API UI components should not be changed.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
RevitNativeRibbonButton(adwnd_ribbon_button)
Bases: GenericRevitNativeUIContainer
Revit API UI native ribbon button.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
Attributes
itemdata_mode = False
instance-attribute
visible
property
writable
Is container visible.
enabled
property
writable
Is container enabled.
name = safe_strtype(adwnd_ribbon_button.AutomationName).replace('\r\n', ' ')
instance-attribute
Functions
process_deferred()
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_rvtapi_object()
set_rvtapi_object(rvtapi_obj)
Set underlying Revit API object for this container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rvtapi_obj |
obj
|
Revit API container object |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_adwindows_object()
Return underlying AdWindows API object for this container.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_flagged_children(state=True)
Get all children with their flag equal to given state.
Flagging is a mechanism to mark certain containers. There are various reasons that container flagging might be used e.g. marking updated containers or the ones in need of an update or removal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
flag state to filter children |
True
|
Returns:
Type | Description |
---|---|
list[*]
|
list of filtered child objects |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
keys()
values()
is_native()
staticmethod
is_dirty()
Is dirty flag set.
set_dirty_flag(state=True)
Set dirty flag to given state.
See .get_flagged_children()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
state to set flag |
True
|
contains(pyrvt_cmp_name)
Check if container contains a component with given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pyrvt_cmp_name |
str
|
target component name |
required |
find_child(child_name)
Find a component with given name in children.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
child_name |
str
|
target component name |
required |
Returns:
Type | Description |
---|---|
Any
|
component object if found, otherwise None |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
activate()
Activate this container in ui.
Under current implementation, raises PyRevitUIError exception as native Revit API UI components should not be changed.
deactivate()
Deactivate this container in ui.
Under current implementation, raises PyRevitUIError exception as native Revit API UI components should not be changed.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_updated_items()
get_unchanged_items()
reorder_before(item_name, ritem_name)
Reorder and place item_name before ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the right |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_beforeall(item_name)
Reorder and place item_name before all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_after(item_name, ritem_name)
Reorder and place item_name after ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the left |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_afterall(item_name)
Reorder and place item_name after all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
RevitNativeRibbonGroupItem(adwnd_ribbon_item)
Bases: GenericRevitNativeUIContainer
Revit API UI native ribbon button.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
Attributes
itemdata_mode = False
instance-attribute
visible
property
writable
Is container visible.
enabled
property
writable
Is container enabled.
name = adwnd_ribbon_item.Source.Title
instance-attribute
Functions
process_deferred()
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_rvtapi_object()
set_rvtapi_object(rvtapi_obj)
Set underlying Revit API object for this container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rvtapi_obj |
obj
|
Revit API container object |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_adwindows_object()
Return underlying AdWindows API object for this container.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_flagged_children(state=True)
Get all children with their flag equal to given state.
Flagging is a mechanism to mark certain containers. There are various reasons that container flagging might be used e.g. marking updated containers or the ones in need of an update or removal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
flag state to filter children |
True
|
Returns:
Type | Description |
---|---|
list[*]
|
list of filtered child objects |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
keys()
values()
is_native()
staticmethod
is_dirty()
Is dirty flag set.
set_dirty_flag(state=True)
Set dirty flag to given state.
See .get_flagged_children()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
state to set flag |
True
|
contains(pyrvt_cmp_name)
Check if container contains a component with given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pyrvt_cmp_name |
str
|
target component name |
required |
find_child(child_name)
Find a component with given name in children.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
child_name |
str
|
target component name |
required |
Returns:
Type | Description |
---|---|
Any
|
component object if found, otherwise None |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
activate()
Activate this container in ui.
Under current implementation, raises PyRevitUIError exception as native Revit API UI components should not be changed.
deactivate()
Deactivate this container in ui.
Under current implementation, raises PyRevitUIError exception as native Revit API UI components should not be changed.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_updated_items()
get_unchanged_items()
reorder_before(item_name, ritem_name)
Reorder and place item_name before ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the right |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_beforeall(item_name)
Reorder and place item_name before all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_after(item_name, ritem_name)
Reorder and place item_name after ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the left |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_afterall(item_name)
Reorder and place item_name after all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
button(name)
Get button item with given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
name of button item to find |
required |
Returns:
Type | Description |
---|---|
RevitNativeRibbonButton
|
button object if found |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
RevitNativeRibbonPanel(adwnd_ribbon_panel)
Bases: GenericRevitNativeUIContainer
Revit API UI native ribbon button.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
Attributes
itemdata_mode = False
instance-attribute
visible
property
writable
Is container visible.
enabled
property
writable
Is container enabled.
name = adwnd_ribbon_panel.Source.Title
instance-attribute
Functions
process_deferred()
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_rvtapi_object()
set_rvtapi_object(rvtapi_obj)
Set underlying Revit API object for this container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rvtapi_obj |
obj
|
Revit API container object |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_adwindows_object()
Return underlying AdWindows API object for this container.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_flagged_children(state=True)
Get all children with their flag equal to given state.
Flagging is a mechanism to mark certain containers. There are various reasons that container flagging might be used e.g. marking updated containers or the ones in need of an update or removal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
flag state to filter children |
True
|
Returns:
Type | Description |
---|---|
list[*]
|
list of filtered child objects |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
keys()
values()
is_native()
staticmethod
is_dirty()
Is dirty flag set.
set_dirty_flag(state=True)
Set dirty flag to given state.
See .get_flagged_children()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
state to set flag |
True
|
contains(pyrvt_cmp_name)
Check if container contains a component with given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pyrvt_cmp_name |
str
|
target component name |
required |
find_child(child_name)
Find a component with given name in children.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
child_name |
str
|
target component name |
required |
Returns:
Type | Description |
---|---|
Any
|
component object if found, otherwise None |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
activate()
Activate this container in ui.
Under current implementation, raises PyRevitUIError exception as native Revit API UI components should not be changed.
deactivate()
Deactivate this container in ui.
Under current implementation, raises PyRevitUIError exception as native Revit API UI components should not be changed.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_updated_items()
get_unchanged_items()
reorder_before(item_name, ritem_name)
Reorder and place item_name before ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the right |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_beforeall(item_name)
Reorder and place item_name before all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_after(item_name, ritem_name)
Reorder and place item_name after ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the left |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_afterall(item_name)
Reorder and place item_name after all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
ribbon_item(item_name)
Get panel item with given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of panel item to find |
required |
Returns:
Type | Description |
---|---|
object
|
panel item if found, could be :obj: |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
RevitNativeRibbonTab(adwnd_ribbon_tab)
Bases: GenericRevitNativeUIContainer
Revit API UI native ribbon tab.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
Attributes
itemdata_mode = False
instance-attribute
visible
property
writable
Is container visible.
enabled
property
writable
Is container enabled.
name = adwnd_ribbon_tab.Title
instance-attribute
Functions
process_deferred()
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_rvtapi_object()
set_rvtapi_object(rvtapi_obj)
Set underlying Revit API object for this container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rvtapi_obj |
obj
|
Revit API container object |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_adwindows_object()
Return underlying AdWindows API object for this container.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_flagged_children(state=True)
Get all children with their flag equal to given state.
Flagging is a mechanism to mark certain containers. There are various reasons that container flagging might be used e.g. marking updated containers or the ones in need of an update or removal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
flag state to filter children |
True
|
Returns:
Type | Description |
---|---|
list[*]
|
list of filtered child objects |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
keys()
values()
is_native()
staticmethod
is_dirty()
Is dirty flag set.
set_dirty_flag(state=True)
Set dirty flag to given state.
See .get_flagged_children()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
bool
|
state to set flag |
True
|
contains(pyrvt_cmp_name)
Check if container contains a component with given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pyrvt_cmp_name |
str
|
target component name |
required |
find_child(child_name)
Find a component with given name in children.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
child_name |
str
|
target component name |
required |
Returns:
Type | Description |
---|---|
Any
|
component object if found, otherwise None |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
activate()
Activate this container in ui.
Under current implementation, raises PyRevitUIError exception as native Revit API UI components should not be changed.
deactivate()
Deactivate this container in ui.
Under current implementation, raises PyRevitUIError exception as native Revit API UI components should not be changed.
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_updated_items()
get_unchanged_items()
reorder_before(item_name, ritem_name)
Reorder and place item_name before ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the right |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_beforeall(item_name)
Reorder and place item_name before all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_after(item_name, ritem_name)
Reorder and place item_name after ritem_name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
ritem_name |
str
|
name of component that should be on the left |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
reorder_afterall(item_name)
Reorder and place item_name after all others.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item_name |
str
|
name of component to be moved |
required |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
ribbon_panel(panel_name)
Get panel with given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
panel_name |
str
|
name of panel to find |
required |
Returns:
Type | Description |
---|---|
RevitNativeRibbonPanel
|
panel if found |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
Functions
argb_to_brush(argb_color)
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
load_bitmapimage(image_file)
Load given png file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_file |
str
|
image file path |
required |
Returns:
Type | Description |
---|---|
BitmapImage
|
bitmap image object |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_current_ui(all_native=False)
Revit UI Wrapper class for interacting with current pyRevit UI.
Returned class provides min required functionality for user interaction
Examples:
current_ui = pyrevit.session.current_ui()
this_script = pyrevit.session.get_this_command()
current_ui.update_button_icon(this_script, new_icon)
Returns:
Type | Description |
---|---|
_PyRevitUI
|
wrapper around active ribbon gui |
Source code in pyrevitlib/pyrevit/coreutils/ribbon.py
get_uibutton(command_unique_name)
Find and return ribbon ui button with given unique id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
command_unique_name |
str
|
unique id of pyRevit command |
required |
Returns:
Type | Description |
---|---|
_PyRevitRibbonButton
|
ui button wrapper object |