-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
8593144
commit 5ecc37d
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...ons/pyRevitTools.extension/pyRevit.tab/Selection.panel/Close Views.pushbutton/bundle.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Binary file added
BIN
+3.98 KB
...evitTools.extension/pyRevit.tab/Selection.panel/Close Views.pushbutton/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
...sions/pyRevitTools.extension/pyRevit.tab/Selection.panel/Close Views.pushbutton/script.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
3 changes: 2 additions & 1 deletion
3
extensions/pyRevitTools.extension/pyRevit.tab/Selection.panel/bundle.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
layout: | ||
- Pick | ||
- Close Tabs | ||
- Set Workset | ||
- select | ||
- mema | ||
- memo | ||
- memo |