Create views and group them together in tabs

Create views and group them together in tabs

lutz.kaiser
Observer Observer
869 Views
1 Reply
Message 1 of 2

Create views and group them together in tabs

lutz.kaiser
Observer
Observer

Hi there!

I want to use a macro to open specific views. Let's
say the start view is Level 0 and I want to open Level 1 in a new tab
and add Level 2 to this newly created tab. At the end I should have two tabs: Tab 1
with Level 0 View and tab 2 with the views of Level 1 + 2.

But there is nothing like:

View.open( new_tab = false, add_to_tabgroup = tab_nbr, *args)

in the UIDocument, in the Document or in the UIApp - so how can I do this?

 

In the next step the size of the view-window should be changed (not of the zoom).

 

Thanks!

0 Likes
870 Views
1 Reply
Reply (1)
Message 2 of 2

lutz.kaiser
Observer
Observer

I got somewhat forward.

Activating Views is through uiDoc.RequestViewChange(view) 😅

But the grouping of the tabs, especially the grouping and resizing of tabs is just a workaround, because I wanted to restore the last active session with all the viewwindow position and sizes. Now it's more a template for activating the views.

However, here is what I have done so far:

# First Macro

1. Create a List with the Names of the views I first want to open

2. Create a Dict with the above viewnames as keys and the viewnames I want to open in the same tab as values

3. Open the views from 1. and tile them through the postableCommand

# Second Macro

4. Iterate over all views, activate those from 1. again and by that I open the views which names stored as values in the Dict.

 

Because the postableCommand is not excecuted until Revit gets the control back from Macro, I need those two macros.

0 Likes