Dear Joe,
Thank you for your patience.
Things are looking good.
- The development team confirmed the issue.
- They opened a new code fix issue to perform the required work, REVIT-182595 [PickPoint in external event from dockable panel does not focus active view].
- They closed the initial case REVIT-182595 [PickPoint in external event from dockable panel does not focus active view].
Best of all, they suggest a workaround, saying:
This issue is caused by the dockable pane being focused when user clicks its buttons, while the PickPoint editor needs the canvas view to be focused instead.
We cannot provide a fix for this in previous versions right away.
However, in previous versions, users can use the following workaround to activate the canvas view before PickPoint is called:
const int WM_MDIGETACTIVE = 0x0229;
const int WM_MDIACTIVATE = 0x0222;
[DllImport("User32.dll", EntryPoint = "SendMessage")]
public static extern int SendMessage(
IntPtr hWnd, int Msg, int wParam, int lParam);
private void OnClick( object sender, RoutedEventArgs e )
{
TaskDialog.Show( nameof(RevitPane),
"Raising external event...");
// Activate the current view frame window
var childHwnd = SendMessage( App.UIApp.MainWindowHandle,
WM_MDIGETACTIVE, 0, 0);
SendMessage( App.UIApp.MainWindowHandle,
WM_MDIACTIVATE, childHwnd, 0);
RevitPane.Default.ExternalEvent.Raise();
}
I hope this helps.
Best regards,
Jeremy