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: 

Click on dock pane deselects elements

18 REPLIES 18
Reply
Message 1 of 19
SuperRey
3180 Views, 18 Replies

Click on dock pane deselects elements

I followed (give or take) the example from http://thebuildingcoder.typepad.com/blog/2013/05/a-simpler-dockable-panel-sample.html, planning to use the dock as a way to get a custom view of parameters of the selected elements. The problem is, when I click on the dock, every element I had selected get deselected. Is there any way to avoid this? I don't know where to start.

 

Maybe I can save a copy of the selected elements and restore it, but then I need to find the right event...

Tags (3)
18 REPLIES 18
Message 2 of 19
Scott_Wilson
in reply to: SuperRey

This also happens with my dockable pane which I use as an AutoCAD style console output window (much better than annoying the user with a message box whenever you want to tell them something 🙂 ), I implement mine in a different way to the tutorial, so I don't think it has anything to do with the way you have created it. It just seems to be a side effect of the dockable panel system. Does anyone know why this happens?

 

The behaviour is quite odd, I also have a similar system to what you propose for displaying custom information for the selected elements, except that I have it in a regular modeless winforms dialog. My system makes use of the Idling events to keep up to date with the current selection. I can click over to it and back into Revit without problem and the selection is not affected. When I click inside my dockable pane though, the selection disapears just as you say, including from my winforms dialog. The odd thing is that if I then click back into the graphical view that was previously displaying my selection, the selection re-appears and is highlighted as normal and also appears back in my dialog as if nothing happened.

 

If I was to implement my selection properties system in a dockable pane, I would again use Revit's idling event to monitor the selection, but I'd also listen for the OnMouseEnter event within the dockable pane. When OnMouseEnter is triggered I'd freeze the selection data I had cached and ignore any selection data provided by the Idling event untill I had again clicked back into Revit. This event should be triggered before the user actually clicks in the pane, so it should have no troubles catching the selection before it is cleared.

 

The trick would be when to re-enable the selection updating, you don't want to do it untill the user clicks back into Revit, else it could be cleared prematurely.

Message 3 of 19
SuperRey
in reply to: Scott_Wilson

Thanks for the heads up, I'll try to implement what you suggest! 🙂
Message 4 of 19
Revitalizer
in reply to: Scott_Wilson

+ 1 Kudos for AutoCAD style console output window 😉




Rudolf Honke
Software Developer
Mensch und Maschine





Message 5 of 19
SuperRey
in reply to: SuperRey

Implemented and working... some how... :S

 

It works, but when I restore the selection, although the selection seems to be the same, because I can see them highlighted, I lose the contextual ribbon menu, as if there was nothing selected. Anyone have a hint about this? Maybe we need to tell Revit to refresh the ribbon or something like that?

Message 6 of 19
jeremytammik
in reply to: SuperRey

Dear SuperRey, Scott and Revitalizer,

 

There is a reason for the behaviour you observe.

 

The dockable panel is modelled to behave like the project browser.

 

What you apparently would like is for it to optionally behave like the properties palette instead, which is different.

 

We now have a wish list item for that: REVIT-44416 [As an add-in developer, I would like Revit API dockable panes to be configurable to behave like the Properties Pallette, so that my application can behave in a similar manner]. 

 

Please make a note of this number for future reference.

 

I added your discussion to the notes for that item.

 

I hope this helps.

 

Cheers,

 

Jeremy



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

Message 7 of 19
eric.anastas
in reply to: jeremytammik

Jeremy,

 

I'm having a similar problem with an add-in I'm working on. The selection behavior with a dockable dialog doesn't exactly behave like the project browser either. If I have an active selection in a view, and then switch to a project browser, the selection highlighting goes away. However, if I switch back to the view the previous selection is still in effect. If I check the active selection in the Idle event the same elements are still listed as being selected

 

However, if I switch to a dockable dialog the seleted elements are no longer selected when the Idle event fires.

 

- Eric Anastas

Message 8 of 19
jeremytammik
in reply to: eric.anastas

Dear Eric,

 

Thank you for your notes.

 

Have you tried it in Revit 2015 UR4?

 

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

 

One of the API enhancements is listed as:

 

  • Improves reliability of retrieving the current selection in an API Dockable Pane.

Cheers,

 

Jeremy



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

Message 9 of 19
steve
in reply to: jeremytammik

sorry, this new UR4 still have this problem,
select some elements in documents, and activate the dockable pane, all selected elements are shown as not selected also the property pane shows that I have nothing selected.

and also select some elements in a dockable pane, the property pane shows that I already have some elements selected, because I can set the parameter value for those selected elements, but the document window shows nothing selected.

This is really wired behavior.
Message 10 of 19
jeremytammik
in reply to: steve

The dockable panels created using the API currently behave like the Project Browser panel, where selected elements do not show as selected when the focus is moved to ProjectBrowser panel. The elements are in fact still selected, as you can see if you click back on the title of the view window after the focus has been on the dockable panel. The Properties Palette has a different behavior in which the elements still show up as selected when focus is on it. We have a wish list item REVIT-44416 to enable dockable panels to be configured either way.


The fix in UR4 was for the ability to access the selected element ids from the dockable panel, which work in Revit 2014 and failed in Revit 2015 R1.


I hope this clarifies.

 

Best regards,

 

Jeremy



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

Message 11 of 19
steve
in reply to: SuperRey

I know that select something in DockablePane is working, but the real problem is that any document view didn't show the selected objects as highlighted,

 

also activate the DockablePane will deselect any selected elements in active document.

 

So I hope in future version of revit, this behavior can be controlled by DockablePane. For now I have to use the Modeless window to do my job.

Message 12 of 19
jeremytammik
in reply to: steve

Dear All,

 

It is my pleasure to inform you that the wish list item REVIT-44416 [As an add-in developer, I would like Revit API dockable panes to be configurable to behave like the Properties Pallette, so that my application can behave in a similar manner.] has been marked as resolved and is scheduled for release in the next major release of Revit. 

 

If you have access to the Autodesk beta forum, please try it out in the pre-release right now and use the beta forum to communicate directly with the development team if you encounter any problems or limitations.

 

Thank you!

 

Cheers,

 

Jeremy



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

Message 13 of 19
SuperRey
in reply to: jeremytammik

Thanks Jeremy, I will have a look at it as soon as I can.
Message 14 of 19

Hi Jermey,

 

I am using Revit 2016 and I have created dockable wpf window and I am having exactly same issue. When I click on the my dockpane the elements gets deselected (it is behaving as Project Explorer). I have searched quite lot to change the behavior as Properties Palette but could not get any clue.

 

Can you please let me now how to configure the Docakable pane to behave like Properties Palette?

 

Thanks in advance.

Gangadhar

 

Tags (1)
Message 15 of 19

Hi Jeremy,

 

Just to clarify re Gangadhar's question above. He is working for a company that is engaged with the Consulting on some joint development for their applications. I explained to him that based on the date of your post is looks like the issue has been fixed in Revit 2017. We have just tested it all and indeed it works fine in 2017 while the issue shows in 2016 that is our "current" baseline 😞 I'm 99% the answer is no, but can someone pls confirm that there is No 2016 version where this subtle issue is fixed?

 

Thanks!

 

Miro

 

Miroslav Schonauer

Senior Solutions Architect / Software Architect
Autodesk Consulting

Message 16 of 19

Same here, I would like to know how to configure the Docakable pane to behave like Properties Palette?

I'm using the Revit API 2018 and I experiment still the same issue.

 

 

--
Jonathan
Message 17 of 19
Revitalizer
in reply to: maisoui

Hi,

 

when deriving your panel from IDockablePaneProvider, add:

 

public void SetupDockablePane(Autodesk.Revit.UI.DockablePaneProviderData data)
{
    [...]
    data.EditorInteraction = new EditorInteraction(EditorInteractionType.KeepAlive);
}

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 18 of 19
jeremytammik
in reply to: Revitalizer

Thank you, @Revitalizer

 

For the clarification.

 

Indeed, the closing comments on the development issue, now named REVIT-44416 [As an add-in developer, I would like Revit API dockable panes to be configurable to behave like the Properties Pallette, so that my application can behave in a similar manner.], state:

 

Specification of EditiorActionType of "KeepALive" or "Dismiss" added.

 

Cheers,

 

Jeremy



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

Message 19 of 19
maisoui
in reply to: jeremytammik

Thank you for your replies. It seems to improve the dockable pane behaviour, but I still have an "issue" (in case of floating pane).

When I show the (floating) pane, the focus is set to the palette and kept. I want to have an "unfocusable pane" or set focus back to Revit's main window (just after the show).

 

revit_pane_focus.png

 

PS: Dockable pane is shown when current selection change

 

Regards

--
Jonathan

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