Good morning,
We recently extended the functionality of our dock pane to include the ability to execute Revit commands.
All seemed to be working well until we hit commands like Move and Rotate. The commands execute just fine, CanPostCommand returns true, and the command actually executes (you can tell because the cursor changes).
However, it will not let you complete the command.
I have attempted many different ways to try and correct this, such as using SendKeys or the WinApi to send the keyboard shortcuts to execute instead of PostCommand to no avail. I even went so far as to send the keystrokes directly to the main window handle, or setting the main window to foreground before executing and nothing. Those didn't work at all. I found that sendkeys is a known issue in 2019, but it did not work for me in any version.
PostCommand works, it just won't let you finish.
I have created a bare bones dock pane example to show this. And this issue appears to happen on any command that involves rotation or movement, i'm not sure how to explain it, but it does not affect commands like Create Similar or the like.
This test plugin will add a tab to the ribbon called "Test Dock Pane Issue", with one button to show or hide the pane if it disappears. But it should pop right up the first time it is registered.
Then, click on any element, use Move from the dock pane, and you will see that you cannot complete the Move command.
Attached are the solution, and the plugin files for 2018-2020 if you just want to test it without looking at the code first.
Help! I hope i have not stumbled upon an issue with the API.
I know AdWindows is not supported, and although i tried that route this example does not use that so i should be able to get support for this issue with PostCommand.
Thanks