Skip to content

Commit c12302c

Browse files
author
EF
committed
Cleaned up code following @jmcouffins suggestions
1 parent d838db4 commit c12302c

File tree

3 files changed

+21
-32
lines changed

3 files changed

+21
-32
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
title:
2+
ru: Получить отверстия
3+
fr_fr: Obtenir les ouvertures
4+
en_us: Get Openings
5+
de_de: Öffnungen ermitteln
6+
tooltip: >
7+
en_us: |
8+
Scans through the project for openings. A list with clickable links will be presented. Open a 3D view to access and see the selected openings. A selection filter will be created or updated to select all openings with one click.
9+
de_de: |
10+
Durchsucht das Projekt nach Öffnungen. Eine Liste mit anklickbaren Links wird angezeigt. Öffnen Sie eine 3D-Ansicht, um auf die ausgewählten Öffnungen zuzugreifen und diese zu sehen. Es wird ein Auswahlfilter erstellt oder aktualisiert, um alle Öffnungen mit einem Klick auszuwählen.
11+
fr_fr: |
12+
Examine le projet à la recherche d'ouvertures. Une liste avec des liens cliquables sera présentée. Ouvrez une vue 3D pour accéder et voir les ouvertures sélectionnées. Un filtre de sélection sera créé ou mis à jour pour sélectionner toutes les ouvertures en un seul clic.
13+
authors: Jakob Steiner, inspired by the initial work of Andreas Draxl, Mohamed Bedair, special thanks to Erik Frits

extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/Tools.stack/Analyse.pulldown/Get Openings.pushbutton/script.py

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,17 @@
11
# -*- coding: utf-8 -*-
22

3-
__title__ = "Get Openings"
4-
__author__ = "Jakob Steiner"
5-
__doc__ = """Version = 1.1
6-
Date = 24.03.2024
7-
_____________________________________________________________________
8-
Scans trough the project for openings. A list with clickable
9-
links will be presented. Open a 3D view to acces and see the
10-
selected openings. A selection Filter will be created or
11-
update to select all openings with one click.
12-
13-
Inspired by the initial work of Mohamed Bedair and Andreas Draxl.
14-
Special thanks to Erik Frits for his help.
15-
_____________________________________________________________________
16-
REQUIREMENTS:
17-
_____________________________________________________________________
18-
[24.03.2024] - Added selection Filter
19-
[23.03.2024] - 1.0 First Release"""
20-
21-
# IMPORTS
22-
23-
# .NET
24-
import clr
25-
clr.AddReference('System')
26-
from System.Collections.Generic import List
3+
"""Lists all openings in the project and creates
4+
a selection filter for them."""
5+
6+
# Sytem
277
import time
288

299
# Revit
30-
from Autodesk.Revit.UI.Selection import *
31-
from Autodesk.Revit.DB import *
10+
from Autodesk.Revit.DB import BuiltInCategory, ElementMulticategoryFilter, FilteredElementCollector, Opening, SelectionFilterElement, Transaction, ElementId
3211

3312
# pyRevit
34-
from pyrevit import *
3513
from pyrevit import script
36-
14+
from pyrevit.framework import List
3715
doc =__revit__.ActiveUIDocument.Document
3816
uidoc =__revit__.ActiveUIDocument
3917
output = script.get_output()
@@ -103,10 +81,8 @@
10381
if t.HasStarted():
10482
t.RollBack()
10583
script.exit(str(ex))
106-
# ╦═╗╔═╗╔═╗╔═╗╦═╗╔╦╗╔═╗
107-
# ╠╦╝║╣ ╠═╝║ ║╠╦╝ ║ ╚═╗
108-
# ╩╚═╚═╝╩ ╚═╝╩╚═ ╩ ╚═╝
109-
#==================================================
84+
85+
# Report
11086

11187
output.print_md("#### There are {} openings (floor, wall, shaft, roof) in the project.".format(len(all_elements))) # TO DO Output link for all.
11288
if data:

0 commit comments

Comments
 (0)