Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems in dockable pane with UI interaction with Revit

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
362 Views, 0 Replies

Problems in dockable pane with UI interaction with Revit

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.

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report