Flyouts do not fully show until clicked

Does anybody else have this problem? When I create a toolbar with flyouts, the flyout text is not fully visible until you click on that item, change to a different toolbar and come back.

Drew toolbar right after loading solidworks. Note that the third button says “Add bo…”

Then you click on it to expand. Our code now adds the items to the flyout, that does not work if you do it on startup.

Now you activate another toolbar and come back to the Drew toolbar. Now it shows the full text “Add body sheets”:

image

Any idea what causes this text to expand?

Hi Peter,

just to confirm this behavior:

I’m using an addin without soliddna for testing: it get the button with truncated text. when i go to another tab and come back, it is still truncated,.. SolidWorks keeps moving in mysterious ways…

if you only have 2 or 3 options, I would prefer to put them one below the other. it makes the UI easier to navigate.

or

keep the text short < 7 tokens :face_with_tongue:

or

use swCommandTabButton_TextHorizontal : it shows the complete text in that case. as a bonus you can fill the space below it for other buttons

_ttt

Happy coding

Perfect!

Can you share a video or a couple of screenshots of your results? Can also be in private. For me, it expands after clicking the flyout the first time and going back and forth between tabs.

SolidDNA adds the items to the flyout on the first click because it didn’t work otherwise. Do you see that same behavior?

Flyouts are full of bugs, I’ve reported another one last year regarding disabling/hiding buttons when you use callbacks to determine the state. Three of the five enum values showed different behavior than documented.

here it is:

SLDWORKS_FARrKwpeiC

The complet text you should see is in my previous answer.

feel free to ask more

Eddy

Great, thank you. Too bad it doesn’t expand at all. Which solidworks version is this?

My own PC crashes when I open a flyout and switch tabs, but only for SW2024 and older. I thought I botched a Drew update, but it’s also in previous Drew versions :thinking:

When do you add the flyout items? In my testing, it doesn’t work when we add items during startup when we create the menu, only after clicking the flyout for the first time.

I tested 2023 2024 and 2025: all exactly the same.

For what it is worth: I used an old default addin template provided by solidworks.

where do I add the flyout? in ConnectToSW :

cmdGroup = iCmdMgr.CreateCommandGroup2

iCmdMgr.CreateFlyoutGroup

cmdGroup.Activate();

I’m curious : in what order does soliddna do it?

What we do on startup:

  1. commandManager.CreateFlyoutGroup2
  2. commandManager.CreateCommandGroup2
  3. commandGroup..AddCommandItem2 for each item that is not a flyout
  4. commandGroup.Activate
  5. Get or create a command tab: commandManager.GetCommandTab
  6. commandTab.AddCommandTabBox for each group of items, split by separators
  7. tabBox.AddCommands for each tab box item

On first flyout click:

  1. flyoutGroup.RemoveAllCommandItems
  2. flyoutGroup.AddCommandItem for each item