Hiding Context toolbar

Programming and macros
JeromeP
Posts: 12
Joined: Wed Mar 24, 2021 12:40 pm
Answers: 0
x 1
x 2

Hiding Context toolbar

Unread post 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?
User avatar
josh
Posts: 295
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 508

Re: Hiding Context toolbar

Unread post 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?
JeromeP
Posts: 12
Joined: Wed Mar 24, 2021 12:40 pm
Answers: 0
x 1
x 2

Re: Hiding Context toolbar

Unread post 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
User avatar
JSculley
Posts: 648
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 881

Re: Hiding Context toolbar

Unread post by JSculley »

Why would you want to do that? What are you actually trying to accomplish?
JeromeP
Posts: 12
Joined: Wed Mar 24, 2021 12:40 pm
Answers: 0
x 1
x 2

Re: Hiding Context toolbar

Unread post 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.
JeromeP
Posts: 12
Joined: Wed Mar 24, 2021 12:40 pm
Answers: 0
x 1
x 2

Re: Hiding Context toolbar

Unread post 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
User avatar
josh
Posts: 295
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 508

Re: Hiding Context toolbar

Unread post by josh »

Pretty sure SW doesn't have any way to block right-clicks.

Did you even look at Tools-Customize?
image.png
JeromeP
Posts: 12
Joined: Wed Mar 24, 2021 12:40 pm
Answers: 0
x 1
x 2

Re: Hiding Context toolbar

Unread post by JeromeP »

Yeah. I've tried all those ones. That doesn't do it.
No worries, InputHelper does the job.
Post Reply