Example #1
0
    Button("Continue"),
]

form = FlexForm("Legend PDF", components)

if form.show():
    border_size = form.values["combobox1"]
    tag = form.values["combobox2"]
    pdf_tb = form.values["combobox3"]
    view_temp = form.values["combobox4"]
    text = form.values["combobox6"]
    line_style = form.values["combobox5"]
    short_descript = form.values["textbox1"]

    plan_view = revit.doc.ActiveView
    forms.check_viewtype(plan_view, DB.ViewType.FloorPlan, exitscript=True)
    today = date.today()
    today = today.strftime("%m/%d/%Y")

    with forms.WarningBar(title="Pick instances to add to legend:"):
        source_elements = revit.pick_elements()

    values = []
    if source_elements:

        # Filtering for current sheets to get highest sheet number
        current_sheets = []
        all_sheets = (DB.FilteredElementCollector(revit.doc).OfCategory(
            DB.BuiltInCategory.OST_Sheets).ToElements())
        for s in all_sheets:
            try:
Example #2
0
from pyrevit import HOST_APP
from pyrevit import revit, DB, UI
from pyrevit import forms
from pyrevit import script

cursheet = revit.active_view
forms.check_viewtype(cursheet, DB.ViewType.DrawingSheet, exitscript=True)

dest_sheet = forms.select_sheets(title='Select Target Sheets',
                                 button_name='Select Sheets',
                                 multiple=False,
                                 include_placeholder=False,
                                 use_selection=True)

selected_vports = []
if dest_sheet:
    sel = revit.pick_elements()
    for el in sel:
        selected_vports.append(el)

    if len(selected_vports) > 0:
        with revit.Transaction('Move Viewports'):
            for vp in selected_vports:
                if isinstance(vp, DB.Viewport):
                    viewId = vp.ViewId
                    vpCenter = vp.GetBoxCenter()
                    vpTypeId = vp.GetTypeId()
                    cursheet.DeleteViewport(vp)
                    nvp = DB.Viewport.Create(revit.doc, dest_sheet.Id, viewId,
                                             vpCenter)
                    nvp.ChangeTypeId(vpTypeId)
Example #3
0
    "SSG_Product Code": "SSG_Spec Current Config",
    "Keynote": "SSG_Spec Masterformat",
    "Assembly Code": "SSG_Spec Uniformat",
    "OmniClass Number": "SSG_Spec Omniclass",
}

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

# view locations for placement
top_left = DB.XYZ(2.56640625 / 12, 7.578125 / 12, 0)
mid_right = DB.XYZ(4.81640625 / 12, 8.08984375 / 12, 0)
sched_loc = DB.XYZ(0.81640625 / 12, 10.08984375 / 12, 0)

threeD_view = revit.doc.ActiveView
forms.check_viewtype(threeD_view, DB.ViewType.ThreeD, exitscript=True)
viewTypeId = threeD_view.GetTypeId()

today = date.today()
today = today.strftime("%m/%d/%Y")

with forms.WarningBar(title="Pick source object:"):
    source_elements = revit.pick_elements()

values = []
if source_elements:

    # Get all SSG Families
    mfg_param_id = DB.ElementId(DB.BuiltInParameter.ALL_MODEL_MANUFACTURER)
    mfg_param_prov = DB.ParameterValueProvider(mfg_param_id)
    param_contains = DB.FilterStringContains()