Queue - Customization toolbars

I’m making some plugin shortcuts in a custom window in Revit (MyTools), and due to the large amount of plugins I would like to hide the unnecessary plugin bars, but I noticed that when using the MinifyUI command, the hidden plugin commands are no longer executed .

as an example of a shortcut: CropView

-- encoding: utf-8 --

title = “”“Crop
View”“”
helpurl = “”
doc = “”“Shortcut”“”

from pyrevit import HOST_APP, UI

uiapp = HOST_APP.uiapp

uiapp.PostCommand(UI.RevitCommandId.LookupCommandId(“CustomCtrl_%CustomCtrl_%Alpha BIM%General Add-ins%CropViewCmd”))

when I turn off MinifyUI it goes back to working the shortcut / plugin icon / shortcut of the pyrevit toolbar.

  • is there any way to make MinifyUI not “delete” the plugin temporarily?

here is the PYREVIT shortcut working (without activating the MinifyUI)

’ [Jrn.Tooltip] Rvt.Attr.Tooltip.CommandID: CustomCtrl_%CustomCtrl_%MyTools%Plugins%pl_icon2 Rvt.Attr.Tooltip.ElapsedTime: 0,9545151 Rvt.Attr.Tooltip.Enabled: True Rvt.Attr.Tooltip.IsFirst: True Rvt.Attr.Tooltip.Key: CustomCtrl_%CustomCtrl_%MyTools%Plugins%pl_icon2 Rvt.Attr.Tooltip.Progressive: True Rvt.Attr.Tooltip.Progressive.Delay: 2
'E 24-Jun-2023 11:42:04.915; 0:<
Jrn.RibbonEvent “Execute external command:CustomCtrl_%CustomCtrl_%MyTools%Plugins%pl_icon2:mytool-mytools-plugins-plundersicon2”
’ 1:< ::89:: Delta VM: Avail 134143895 MB, Used +17 → 1397 MB; RAM: Avail -17 → 19390 MB, Used +17 → 1502 MB, Peak +15 → 1502 MB
’ 1:< GUI Resource Usage GDI: Avail 8563, Used 1437, User: Used 579
’ 1:< Muted: Jrn.Directive IdleTimeTaskSymbol
’ 1.042260 1:<<<API External Command Time
'H 24-Jun-2023 11:42:05.981; 0:<
Jrn.Data _
“APIStringStringMapJournalData” , 0
'E 24-Jun-2023 11:42:06.034; 0:<
Jrn.MouseMove 0 , 328 , 369
'H 24-Jun-2023 11:42:06.034; 0:<
Jrn.Directive _
“IdleTimeTaskInvocation” , “2.PostCommandTask” , 0 _
, “{}”
'E 24-Jun-2023 11:42:06.042; 0:<
Jrn.RibbonEvent “Execute external command:CustomCtrl_%CustomCtrl_%Alpha BIM%General Add-ins%CropViewCmd:AlphaBIM.CropViewCmd”
’ 1:< API_ERROR { : Assembly version conflict in some references in CropView.dll assembly
'Addin’s module RevitAPIUI of version 19.0.0.0 conflicts with same preloaded module of version 24.0.0.0
'Addin’s module RevitAPI of version 19.0.0.0 conflicts with same preloaded module of version 24.0.0.0
'Addin’s module Newtonsoft.Json of version 9.0.0.0 conflicts with same preloaded module of version 13.0.0.0
'Addin’s module ControlzEx of version 4.0.0.0 conflicts with same preloaded module of version 3.0.2.4
'Addin’s module RevitAPIIFC of version 19.0.0.0 conflicts with same preloaded module of version 24.0.0.0 }
’ 1:< ::91:: Delta VM: Avail -18 → 134143877 MB, Used +6 → 1403 MB, Peak +5 → 1404 MB; RAM: Avail -12 → 19379 MB, Used +7 → 1509 MB, Peak +7 → 1509 MB
’ 1:< GUI Resource Usage GDI: Avail 8574, Used 1426, User: Used 572

here is the non working PYREVIT shortcut (active MinifyUI)

’ [Jrn.Tooltip] Rvt.Attr.Tooltip.CommandID: CustomCtrl_%CustomCtrl_%pyRevit%Toggles%MinifyUI Rvt.Attr.Tooltip.ElapsedTime: 1,9631725 Rvt.Attr.Tooltip.Enabled: True Rvt.Attr.Tooltip.IsFirst: True Rvt.Attr.Tooltip.Key: CustomCtrl_%CustomCtrl_%pyRevit%Toggles%MinifyUI Rvt.Attr.Tooltip.Progressive: True Rvt.Attr.Tooltip.Progressive.Delay: 2
'E 24-Jun-2023 11:42:16.211; 0:<
Jrn.RibbonEvent “Execute external command:CustomCtrl_%CustomCtrl_%pyRevit%Toggles%MinifyUI:pyrevittools-pyrevit-toggles-toggles1-minifyui”
’ 0:< ::106:: Delta VM: Avail +1 → 134143883 MB, Used +27 → 1410 MB; RAM: Avail -26 → 19352 MB, Used +27 → 1543 MB, Peak +38 → 1561 MB
’ 0:< GUI Resource Usage GDI: Avail 8562, Used 1438, User: Used 577
’ 2.751060 1:<<<API External Command Time
'H 24-Jun-2023 11:42:18.965; 0:<
Jrn.Data _
“APIStringStringMapJournalData” , 0
’ 0:< ::106:: Delta VM: Avail +7 → 134143891 MB, Used +1 → 1411 MB; RAM: Avail +11 → 19364 MB, Used +1 → 1544 MB
’ 0:< GUI Resource Usage GDI: Avail 8564, Used 1436, User: Used 576
'E 24-Jun-2023 11:42:21.978; 0:<
Jrn.MouseMove 0 , 721 , 1
'E 24-Jun-2023 11:42:21.979; 0:<
Jrn.RibbonEvent “Execute external command:CustomCtrl_%CustomCtrl_%MyTools%Plugins%pl_icon2:mytool-mytools-plugins-plundersicon2”
’ 1:< ::108:: Delta VM: Avail 134143891 MB, Used +18 → 1429 MB; RAM: Avail -16 → 19348 MB, Used +18 → 1562 MB, Peak +1 → 1562 MB
’ 1:< GUI Resource Usage GDI: Avail 8564, Used 1436, User: Used 576
’ 1:< Muted: Jrn.Directive IdleTimeTaskSymbol
’ 1.117191 1:<<<API External Command Time
'H 24-Jun-2023 11:42:23.097; 0:<
Jrn.Data _
“APIStringStringMapJournalData” , 0
’ 0:< ::108:: Delta VM: Avail -8 → 134143883 MB, Used +0 → 1430 MB; RAM: Avail +10 → 19358 MB, Used +0 → 1563 MB, Peak +0 → 1563 MB
’ 0:< GUI Resource Usage GDI: Avail 8564, Used 1436, User: Used 579
'E 24-Jun-2023 11:42:23.201; 0:<
Jrn.MouseMove 0 , 584 , 454
'H 24-Jun-2023 11:42:23.202; 0:<
Jrn.Directive _
“IdleTimeTaskInvocation” , “3.PostCommandTask” , 1 _
, “{}”
’ 0:< API_SUCCESS { API queue command CustomCtrl_%CustomCtrl_%Alpha BIM%General Add-ins%CropViewCmd cannot be invoked in this context. }
'H 24-Jun-2023 11:42:23.204; 0:<
Jrn.Directive _
“IdleTimeTaskInvocation” , “3.PostCommandTask” , 1 _
, “end”

Revit 2024.0.2
PyRevit: 4.8.13.23170

Hi @victorab
Welcome to the pyrevit forum!

Can you please reformat your message putting the code and the journal between triple backticks (```)?
That way it will be more readable to everyone.

As per your question, it might be that a button in a invisible tab could not be called via postcommand, but I never tried it.

This is taken from the API reference:

Note: Even a postable command may not execute when using PostCommand(). […] Another reason a posted command may not execute is if the command to be executed is not accessible at the time. Whether it is accessible is determined only at the point where Revit returns from the API context, so a failure to execute for this reason will not be reported directly back to the application that posted the command.

The first reason is when you post multiple commands in the same session, but this doesn’t seem to be the case.

Just to make sure I understood correctly: the code you posted is a pushbutton in your custom revit tab?