Bring focus to graphical view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
This question is very similar to this one from 2015.
I was hoping there would be a solution to this problem by now.
The problem is gone in Revit 2019 as Autodesk seems to have changed the way dockable panes behave, but it's still there in previous version which my company still uses.
The problem is that I have a dockable pane that users can use to place families in their project.
This all works seamlessly now, but there is one thing that I get annoyed about and that's when people click in the pane but don't place anything in their project. If they do so, the dockable pane is focused and they can't click anything on the ribbon until they click in the main graphical window first. I want to set focus to that view myself by code but I can't seem to get it working.
I tried to use the P/Invoke SetForegroundWindow function with both the Process.GetCurrentProcess().MainWindowHandle and the handle for the graphical view itself.
Also I tried to set the uidoc.ActiveView to the same view that is open but that doesn't do anything.
It does work if you open a new view but that's not what I want to do. And opening a new view and switching back works but looks stupid (user can see it, it's not instant).
Is there something else I can try? Maybe some way to 'unfocus' my dockable pane?