Hi all,
I have some problems while using the dockable pane with UI interaction with Revit.
I have buttons in the dockable pane, and these buttons are designed to raise the external events, in which the UIDocument.Selection.PickObjects() method or other methods that require the UI interation of the activeDocument are invoked. But an InvalidOperationException is thrown every time when calling the PickObjects() method, with the error message: The active view is non-graphical and does not support capture of the focus for pick operations. In the debugging, I checked the (uiDoc.ActiveView.Id.IntegerValue == uiDoc.ActiveGraphicalView.Id.IntegerValue) before the PickObjects() method, and it returned true every time.
To resolve this problem, I used the WPF Window (rather than WPF Page ) as an alternative, and raised the External Events to handle the PickObjects operation. This worked fine and no exception was thrown.
However, I still want a solution in the dockable pane, do you guys have any clues why that exception would be thrown in the dockable pane, or could you give some advise to have this exception properly handled.