Hello All,
Can we Raise external events from dockable pane via Revit API 2017 API?
Please suggest.
Thanks,
Nitin J.
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Yes, you can.
You can raise an external event from anywhere at all.
Please take a look at the relevant SDK samples: ModelessDialog/ModelessForm_ExternalEvent and DockableDialogs.
They demonstrate all you need to know.
hello jeremy,
I have some problems while using the dockable pane.
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 raised 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 i t returned true every time.
To resolve this problem, I used the WPF Window as an alternative, and raised the External Events to handle the PickObjects operation. This worked fine and no exception was raised.
However, I still want a solution in the dockable pane, do you have any clues why that exception would be raised in the dockable pane, or you could give me some advise to have this exception skipped.
Can't find what you're looking for? Ask the community or share your knowledge.