Skip to content

Commit

Permalink
List TitleBlocks on Sheets (#1069)
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

* Add tool to list titleblocks on sheets for review.

Co-authored-by: Ehsan Iran-Nejad <eirannejad@gmail.com>
  • Loading branch information
alexdaversa and eirannejad authored Nov 21, 2020
1 parent 581952f commit 53f2c38
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tooltip: Lists title blocks on selected sheets for review
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,30 @@
"""Select title blocks on selected sheets for batch editing."""

from pyrevit import coreutils
from pyrevit import revit, DB
from pyrevit import forms
from pyrevit import script

output = script.get_output()
logger = script.get_logger()


def get_source_sheets():
sheet_elements = forms.select_sheets(button_name='Select TitleBlocks',
use_selection=True,
include_placeholder=False)
if not sheet_elements:
script.exit()
return sheet_elements


def print_titleblocks(sheets):
for sheet in sheets:
tblocks = revit.query.get_sheet_tblocks(sheet)
for tblock in tblocks:
print('SHEET: {0} - {1}\t\tTITLEBLOCK: {2} {3}'.format(sheet.SheetNumber, sheet.Name, tblock.Name, output.linkify(tblock.Id)))


# orchestrate
sheets = get_source_sheets()
tblocks = print_titleblocks(sheets)
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ layout:
- Select Sheets
- Rename Selected Sheets
- Select TitleBlocks on Sheets
- List TitleBlocks on Sheets
- Set Crop Region To Selected Shape
- Open Selected Viewport
- View Ordering Tool
Expand Down

0 comments on commit 53f2c38

Please sign in to comment.