Is there anything in Revit API that would let you tile specific views? For example, could you make UIView called "foo" to tile to the right?
Is there anything in Revit API that would let you tile specific views? For example, could you make UIView called "foo" to tile to the right?
The methods I see on the UIView allow you to zoom within the view, modifying what you see of the model, and query its window rectangle, but no methods to set the window rectangle:
The methods I see on the UIView allow you to zoom within the view, modifying what you see of the model, and query its window rectangle, but no methods to set the window rectangle:
That probably puts an end to the dream of a Revit-based tiling window manager then 😓
That probably puts an end to the dream of a Revit-based tiling window manager then 😓
Hi @DanielKP2Z9V ,
The Revit UI uses the AvalonDock, Revit assembly Xceed.Wpf.AvalonDock.dll
Maybe with that you can figure out how to change the tile arrangement and apply it to the Revit UI?
I used the reference to manipulate the ViewTab colors.
Hi @DanielKP2Z9V ,
The Revit UI uses the AvalonDock, Revit assembly Xceed.Wpf.AvalonDock.dll
Maybe with that you can figure out how to change the tile arrangement and apply it to the Revit UI?
I used the reference to manipulate the ViewTab colors.
@TripleM-Dev.net Interesting, thank you - I didn't know that. I will need to read up a bit on this - first attempt at prompting chatgpt "using Xceed.Wpf.AvalonDock in Revit c# tile current window to the right" gave a rather intimidating reply. How would you get access to the current window in focus or if and where it's tiled?
@TripleM-Dev.net Interesting, thank you - I didn't know that. I will need to read up a bit on this - first attempt at prompting chatgpt "using Xceed.Wpf.AvalonDock in Revit c# tile current window to the right" gave a rather intimidating reply. How would you get access to the current window in focus or if and where it's tiled?
I don't think Chatgpt can solve this, it will try to solve things from AvalonDock side of things and not how Revit's using it.
For getting to the Tab's views I use (simplified):
// Get the Visual from the MainWindowHandle
Visual tryVisual = HwndSource.FromHwnd(this._iUICApp.MainWindowHandle).RootVisual;
if (tryVisual is MainWindow)
{
// Cast the Visual to MainWindow
MainWindow uiRvtWindowRoot = (MainWindow)tryVisual;
// Find the DockingManager, for subscribing to it's events like: LayoutUpdated, LayoutChanging etc if needed
DockingManager tabDockManager = MainWindow.FindFirstChild<DockingManager>(uiRvtWindowRoot);
LayoutDocumentPaneGroupControl paneTabGroup = MainWindow.FindFirstChild<LayoutDocumentPaneGroupControl>(uiRvtWindowRoot);
Dim tabItems = PaneTabGroup.FindVisualChildren(Of TabItem)()
}
_iUICApp = UIControlledApplication
Tabitems = Tabview controls
tabDockManager = Dockingmanager control.
With this I can get access to the tabs change their style, the dockingmanager is used to update the style if the active one changed.
Note that the TabItem is a control inside the tabcontrol, and there can be multiple tabcontrols!
For changing the docking / position of tabviews a style would need to be changed which one and how the style need to be formatted I don't know. But as this is by now the AvalonDock the answer should/might be in their documentation.
I think in the Avalondock's "LayoutDocumentPaneGroupControl" or the "Dockingmanager" could be a start..
But this will be unsupported and may yield unexpected results in Revit.
I don't think Chatgpt can solve this, it will try to solve things from AvalonDock side of things and not how Revit's using it.
For getting to the Tab's views I use (simplified):
// Get the Visual from the MainWindowHandle
Visual tryVisual = HwndSource.FromHwnd(this._iUICApp.MainWindowHandle).RootVisual;
if (tryVisual is MainWindow)
{
// Cast the Visual to MainWindow
MainWindow uiRvtWindowRoot = (MainWindow)tryVisual;
// Find the DockingManager, for subscribing to it's events like: LayoutUpdated, LayoutChanging etc if needed
DockingManager tabDockManager = MainWindow.FindFirstChild<DockingManager>(uiRvtWindowRoot);
LayoutDocumentPaneGroupControl paneTabGroup = MainWindow.FindFirstChild<LayoutDocumentPaneGroupControl>(uiRvtWindowRoot);
Dim tabItems = PaneTabGroup.FindVisualChildren(Of TabItem)()
}
_iUICApp = UIControlledApplication
Tabitems = Tabview controls
tabDockManager = Dockingmanager control.
With this I can get access to the tabs change their style, the dockingmanager is used to update the style if the active one changed.
Note that the TabItem is a control inside the tabcontrol, and there can be multiple tabcontrols!
For changing the docking / position of tabviews a style would need to be changed which one and how the style need to be formatted I don't know. But as this is by now the AvalonDock the answer should/might be in their documentation.
I think in the Avalondock's "LayoutDocumentPaneGroupControl" or the "Dockingmanager" could be a start..
But this will be unsupported and may yield unexpected results in Revit.
Can't find what you're looking for? Ask the community or share your knowledge.