Thanks @wmayer

Thanks @wmayer
Hi. I can get every command by using this code. But some commands are command groups. How can I get the commnds of command group?wmayer wrote: ↑Sat Apr 04, 2020 9:49 amgit commit 8663e724f
Code: Select all
wb=Gui.activeWorkbench() wb.getToolbarItems()
Code: Select all
workbenches = Gui.listWorkbenches()
for wb_name in workbenches:
Gui.activateWorkbench(wb_name)
wb = Gui.getWorkbench(wb_name)
items = wb.getToolbarItems()
for i in items:
#if i in pass_list: pass
tb_name = i
toolbar = items[i]
for cmd in toolbar:
command = Gui.Command.get(cmd)
print(command)
I see. This is currently not possible. What we need is a way to check if a QAction has a QMenu and if yes also list its items.HakanSeven12 wrote: ↑Sun Nov 22, 2020 7:21 pmHi. I can get every command by using this code. But some commands are command groups. How can I get the commnds of command group?
For example I want to get this commands.
command group.png
Code: Select all
cmd = Gui.Command.get("Sketcher_CompCreateRegularPolygon")
cmd.getAction()
Code: Select all
cmd = Gui.Command.get("Sketcher_CreatePoint")
cmd.getAction()
I think there must be an UI api for python which UI developers can reach, edit or disable UI objects. Then we can talk about a documentation. Otherwise there is just some code that can reach wbs and their commands.