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: 

PickObject from DockablePane

10 REPLIES 10
Reply
Message 1 of 11
annse
1352 Views, 10 Replies

PickObject from DockablePane

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

10 REPLIES 10
Message 2 of 11
jeremytammik
in reply to: annse

Dear Annse,

 

Please have a look at my answer just a day or two ago on a similar question involving a dockable panel:

 

http://forums.autodesk.com/t5/revit-api/dockable-dialog-and-promptforfamilyinstanceplacement/m-p/541...

 

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 11
annse
in reply to: jeremytammik

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

Message 4 of 11
jeremytammik
in reply to: annse

Dear Annse,

 

Have you tried installing Revit 2015 UR4?

 

http://thebuildingcoder.typepad.com/blog/2014/09/revit-2015-r2-ur4-and-dimension-prefix-suffix.html#...

 

Look at the list of API enhancements:

 

  • Improves stability when the Pick Points API was invoked from within a Dockable Frame.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 11
annse
in reply to: jeremytammik

Yes, I'm updated.

 

Thanks!

Annse

Message 6 of 11
FrodeTo
in reply to: annse

Was there ever a solution to this? I have exactly the same problem.

I have the Revit 2015 version mentioned above, but the PickObject still gives the non-graphical exception.
Message 7 of 11
jeremytammik
in reply to: FrodeTo

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 8 of 11
FrodeTo
in reply to: jeremytammik

I will make an example and send it to the ADN. I'll post a note here if when I know more.

BTW, that's an impressively quick reply!

Frode
Message 9 of 11
jeremytammik
in reply to: FrodeTo

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,



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 10 of 11
annse
in reply to: FrodeTo

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

Message 11 of 11
mccadsw
in reply to: 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

 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community