Page 1 of 1

Hiding Context toolbar

Posted: Wed Dec 20, 2023 10:58 am
by JeromeP
Is there an API command to hide or disable the context toolbar (the one that appears when right clicking on a face) for parts?

Re: Hiding Context toolbar

Posted: Wed Dec 20, 2023 6:00 pm
by josh
Do you mean an API command to change the setting under Tools-Customize such that it doesn't appear, or a command to dismiss it if it's currently shown on screen?

Re: Hiding Context toolbar

Posted: Wed Dec 20, 2023 6:11 pm
by JeromeP
Correct me if I'm wrong, but I don't think this menu has a setting in Tool>Customize so it doesn't appear.
But if there is, either way would be great.

Image

I've found this link that can be used to hide the menu specific to the selection,
but there is still a menu that appears on right click (the one on the right on the above picture)
https://help.solidworks.com/2022/englis ... ple_vb.htm

I guess I could use an event like doc_UserSelectionPostNotify
to do a SendKeys "{ESC}" but that's a bit clunky

Re: Hiding Context toolbar

Posted: Wed Dec 20, 2023 6:30 pm
by JSculley
Why would you want to do that? What are you actually trying to accomplish?

Re: Hiding Context toolbar

Posted: Wed Dec 20, 2023 6:42 pm
by JeromeP
I'm working on a macro feature that display custom information in OpenGL,
and can be used to interact in a specific manner with the mouse.
But this menu is in the way.
I would like to disable it while the macro feature is in edit mode.

Re: Hiding Context toolbar

Posted: Wed Dec 20, 2023 10:04 pm
by JeromeP
I've manage to block the right click command, and thus the menu, with the InputHelper library. https://github.com/Visual-Vincent/InputHelper
Although I would love to learn a better way to do it with Solidworks commands.

Code: Select all

Private Sub MouseHook_MouseDown(sender As Object, e As InputHelper.EventArgs.MouseHookEventArgs) Handles MouseHook.MouseDown
	If e.Button = MouseButtons.Right Then e.Block = True
End Sub

Re: Hiding Context toolbar

Posted: Thu Dec 21, 2023 2:32 pm
by josh
Pretty sure SW doesn't have any way to block right-clicks.

Did you even look at Tools-Customize?
image.png

Re: Hiding Context toolbar

Posted: Thu Dec 21, 2023 4:21 pm
by JeromeP
Yeah. I've tried all those ones. That doesn't do it.
No worries, InputHelper does the job.