Hello, I attempted to dynamically add a panel so that I don't need to register it when Revit starts. I have obtained the Visual Tree for Revit, specifically the DockManager used by Revit from AvalonDock. It works if I add a LayoutAnchorable with the content being a TextBlock or other basic WPF controls. However, if I set the content to a customized Window, Page, etc., Revit crashes. Do you konw the reson or have some advice?
@ricaun2 ай бұрын
Interesting, usually is a bad idea to mess with the Revit UI like that. Why you need to dynamic add a dockable pane? Do you have some sample code with a simple implementation, I have a ideia how is done but never tried to implement. The only way to know what is wrong is enabling debug in your Revit to check what exception is happening.
@MingchenXing2 ай бұрын
@@ricaun I have replied with a link to the code. But it seems that link is not allowd or have you seen it?
@ricaun2 ай бұрын
I believe link is not allowed to prevent span, you could send to ricaun@gmail.com or reach me in the Instagram @ricaun.io I did some experiments using some methods in the MainWindow class in Revit. Works to create a dockable on the fly but have a lot of limitations.
@MingchenXing2 ай бұрын
Thanks a lot. I have tried it again and it works if I set the content of Dockablepanel as a UserControl. Now I don't need to regist er it.
@ricaun2 ай бұрын
Nice! The only problem is the location of the dockable is no saved correctly, at least I was not able to make Revit remember the location.
@andid95024 ай бұрын
Just by curiosity, how can i "map" my property window to this "dock able" panel? f.e. I select a door i want only to filter a certain Parameters (f.e. reed contact related)? I can imagine that you can not answer that in a one liner... but do have a ruff idea? or maybe examples.
@ricaun4 ай бұрын
Using WPF binding I guess, I would start with a basic window that is easier to work, dockable could be annoying to work. Add some events in Revit to update a ViewModel that is binded in a Page, and adding some Revit ExternalEvent to something in the WPF to update Revit.