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: 

Tile UIViews API?

5 REPLIES 5
Reply
Message 1 of 6
DanielKP2Z9V
463 Views, 5 Replies

Tile UIViews API?

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?

5 REPLIES 5
Message 2 of 6

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:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 6
DanielKP2Z9V
in reply to: DanielKP2Z9V

That probably puts an end to the dream of a Revit-based tiling window manager then 😓

Message 4 of 6

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.

 

Message 5 of 6
DanielKP2Z9V
in reply to: DanielKP2Z9V

@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?

Message 6 of 6

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.

Post to forums  

Forma Design Contest


Rail Community