Skip to content

Commit

Permalink
New tool - close tabs (#1173)
Browse files Browse the repository at this point in the history
* fixed host adder and added 2020.2.3

* added 2020.1.1 to hosts

* Adding a new tool to selection "Close Views"

* Description

* Uploading script and icon

Adding script fixing this issue: #1160
The python script is by: https://github.com/thumDer
The icon is by me.

* Changing "Close Views" to "Close Tabs"

* Changing "Close Views" to "Close Tabs"

Co-authored-by: Ehsan Iran-Nejad <eirannejad@gmail.com>
  • Loading branch information
monsieurhannes and eirannejad authored Feb 28, 2021
1 parent 8593144 commit 5ecc37d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tooltip: Close everything but the selected views.
title: >-
Close
Tabs
authors:
- thumDer
- Johannes Domeier
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Close selected views."""
from pyrevit import forms, revit

doc = revit.doc
uidoc = revit.uidoc

uiviews = uidoc.GetOpenUIViews()
views = [doc.GetElement(uiview.ViewId) for uiview in uiviews]

list_items = [forms.ViewOption(view) for view in views]

views_to_keep = forms.SelectFromList.show(list_items,
multiselect=True,
title='Select views to keep open')

if not views_to_keep:
script.exit()

uiviews_to_close = filter(
lambda x: x.ViewId.IntegerValue not in \
[view.Id.IntegerValue for view in views_to_keep],
uiviews)

for uiview in uiviews_to_close:
uiview.Close()
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
layout:
- Pick
- Close Tabs
- Set Workset
- select
- mema
- memo
- memo

0 comments on commit 5ecc37d

Please sign in to comment.