Hi!
I'm trying to run PickObject from a DockablePane using ExternalEvent. I'm receiving the following error.
"The active view is non-graphical and does not support capture of the focus for pick operations."
Runnnig the same code on the same View from an ExternalCommand is no problem.
What are my options? Is it possible to focus the ActiveView?
Thanks!
Annse
Dear Annse,
Please have a look at my answer just a day or two ago on a similar question involving a dockable panel:
Please also let us know whether this helps you.
If so, I might promote this to a blog post to make it easier to find.
Thank you!
Cheers,
Jeremy
Hi Jeremy!
Thank you for your quick response. I did read your suggested entry before I posted.
The CanBePrinted property returns true.
The app.ActiveUIDocument.ActiveGraphicalView and the app.ActiveUIDocument.ActiveView are the same.
I've also tried things like app.ActiveUIDocument.RefreshActiveView().
public class MyExternalEvent : IExternalEventHandler
{
public void Execute(UIApplication app)
{
Reference elementRef = app.ActiveUIDocument.Selection.PickObject(ObjectType.Element, "Select element.");
Element element = app.ActiveUIDocument.Document.GetElement(elementRef.ElementId);
}
public string GetName()
{
return "My External Event";
}
}
Thanks!
Annse
Dear Annse,
Have you tried installing Revit 2015 UR4?
Look at the list of API enhancements:
Cheers,
Jeremy
Dear Frode,
Sorry to hear that.
Can you provide a reproducible case for the development team to take a closer look at, please?
http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Thank you!
Cheers,
Jeremy
Dear Frode,
Thank you for your appreciation It is a pleasure. I am always glad to impress 🙂
Thank you for submitting your sample to ADN, which I received in case 10824043 [PickObject gives exception in dockable dialog].
I logged the issue REVIT-68861 [PickObject gives exception in dockable dialog -- 10824043] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.
I hope this helps.
I will be on vacation next week, so don't expect to hear anything more from me until afterwards.
Happy weekend and following week!
Best regards,
Hi!
Good to know this issue has been submitted.
I ended up with reversing the order of the pick operation by implementing a selection watcher.
/Annse
Hi annse.
I have Revit 2015 R2 upgrade 8 installed and have an exactly same issue you have. Looks like you have a way to work around the issue by "reversing the order of the pick operation by implementing a selection watcher." Would you please explain in detail? Very appreciate if you can share the code.
Mark