Exemplo n.º 1
0
    def _ask_for_titleblock(self):
        tblock = forms.select_titleblocks(doc=revit.doc)
        if tblock is not None:
            self._titleblock_id = tblock
            return True

        return False
Exemplo n.º 2
0
            data1.append(a1)
            data2.append(a2)
    sheets = {"sheetNumbers" : data1, "sheetNames" : data2}
    return sheets

# Function to create sheets
def createSheet(number, name, titleBlockId):
    sheet = DB.ViewSheet.Create(doc, titleBlockId)
    sheet.SheetNumber = number
    sheet.Name = name

# Prompt user to specify file path
pathFile = forms.pick_file(files_filter='Excel Workbook (*.xlsx)|*.xlsx|''Excel 97-2003 Workbook|*.xls')       

# Prompt user to select titleblock
titleBlock = forms.select_titleblocks(doc=doc)

# Create Excel object
excel = Excel.ApplicationClass()
excel = Marshal.GetActiveObject("Excel.Application")
workbook = excel.Workbooks.Open(pathFile)
ws = workbook.Worksheets[1]

# Read data
sNumber = ws.Range["A1", "A1000"]
sName = ws.Range["B1", "B1000"]
sheetNumbers = [str(x) for x in retData(sNumber.Value2, sName.Value2)["sheetNumbers"][1:]]
sheetNames = [str(x) for x in retData(sNumber.Value2, sName.Value2)["sheetNames"][1:]]

# Create progress bar
count = 1
Exemplo n.º 3
0
top_left = XYZ(0.125, 0.65, 0)
bottom_left = XYZ(0.125, 0.25, 0)
top_right = XYZ(0.7, 0.65, 0)
bottom_right = XYZ(0.7, 0.25, 0)

# locs = [top_left, top_right, bottom_left, bottom_right]

# locs_cycle = cycle(locs)

# def next_loc():
#     return next(locs_cycle)

logger = script.get_logger()

selected_titleblocks = forms.select_titleblocks()
if selected_titleblocks:
    area_param_id = ElementId(BuiltInParameter.ROOM_AREA)
    area_param_prov = ParameterValueProvider(area_param_id)
    param_greater = FilterNumericGreater()
    filt = ElementParameterFilter(
        FilterDoubleRule(area_param_prov, param_greater, 0, 1e-6))
    # rooms = []
    rooms = FilteredElementCollector(revit.doc).WherePasses(filt).ToElements()
    # for c in col1:
    #     if c.Area != 0:
    #         rooms.append(c)

    views = []
    keys = []
    groups = []
Exemplo n.º 4
0
"""
from pyrevit.userconfig import PyRevitConfig
import os

this_folder = os.path.dirname(os.path.abspath(__file__))
init_file = os.path.join(this_folder, 'config.ini')

cfg = PyRevitConfig(init_file)

cfg.add_section('Settings')
cfg.Settings.font = 'Courier'

cfg.save_changes()
"""

from pyrevit import forms
import time

forms.select_titleblocks()
Exemplo n.º 5
0
def _ask_for_titleblock():
    """Asks for title block"""
    tblock = forms.select_titleblocks(doc=doc)
    if tblock is not None:
        _titleblock_id = tblock
        return _titleblock_id