Hello,
Please try to get workspaces by productType and then it should work.
This was our mistake how to design the API. One workspace might belong to multiple products and multiple workspaces might associate to one product. We need users' input which workspace of product they want to add toolbar item into. Unfortunately we cannot do cleanup for old design to keep backward compatibility.
We will do improvement to prompt users with meaningful message once users run into the kind of issue in future releases.
Thanks,
Marshal
auto workspaces = ui->workspacesByProductType("SimStudiesProductType");
auto workspace = workspaces->itemById("SimulationEnviroment");
auto toolbarPanels = workspace->toolbarPanels();
auto panel = toolbarPanels->add("NewPanelID", "NewPanel");
auto panelCtrl = panel->controls();
Marshal Tu
Fusion Developer
>