|
1 | 1 | # -*- coding: utf-8 -*-
|
2 | 2 |
|
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 |
27 | 7 | import time
|
28 | 8 |
|
29 | 9 | # 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 |
32 | 11 |
|
33 | 12 | # pyRevit
|
34 |
| -from pyrevit import * |
35 | 13 | from pyrevit import script
|
36 |
| - |
| 14 | +from pyrevit.framework import List |
37 | 15 | doc =__revit__.ActiveUIDocument.Document
|
38 | 16 | uidoc =__revit__.ActiveUIDocument
|
39 | 17 | output = script.get_output()
|
|
103 | 81 | if t.HasStarted():
|
104 | 82 | t.RollBack()
|
105 | 83 | script.exit(str(ex))
|
106 |
| -# ╦═╗╔═╗╔═╗╔═╗╦═╗╔╦╗╔═╗ |
107 |
| -# ╠╦╝║╣ ╠═╝║ ║╠╦╝ ║ ╚═╗ |
108 |
| -# ╩╚═╚═╝╩ ╚═╝╩╚═ ╩ ╚═╝ |
109 |
| -#================================================== |
| 84 | + |
| 85 | +# Report |
110 | 86 |
|
111 | 87 | output.print_md("#### There are {} openings (floor, wall, shaft, roof) in the project.".format(len(all_elements))) # TO DO Output link for all.
|
112 | 88 | if data:
|
|
0 commit comments