def get_from_win_form():
    """
    Получить от пользователя значение шаблона и на что заменить

    :return: две строки
    :rtype: tuple[str, str]
    """

    components = [
        Label('Введите шаблон:'),
        TextBox('Template', Text="A"),
        Label('Заменить на:'),
        TextBox('New_text', Text="Q"),
        Separator(),
        Button('Find and Replace')
    ]
    form = FlexForm('Title', components)
    form.show()

    if 'Template' in form.values and 'New_text' in form.values:
        template = form.values['Template']
        new_text = form.values['New_text']
        logger.info('Get from user template {} and new text {}'.format(
            repr(template), repr(new_text)))
        return template, new_text

    raise ElemNotFound('User canceled form')
Exemple #2
0
 def SetFormComponents(self):
     from rpw.ui.forms import Button, CheckBox, Label, Separator, TextBox # why does this have to be inside method?
     self.components = [CheckBox("checkbox1", "VIEWS", default=False),
                        CheckBox("checkbox2", "SHEETS", default=False),
                        CheckBox("checkbox3", "ROOMS", default=False),
                        
                        Label("SEARCH TEXT"),
                        TextBox("textbox1"),
                        
                        Label("TARGET TEXT"),
                        TextBox("textbox2"),
                   
                        Separator(),
                        Button('Go')
                        ]  
Exemple #3
0
def form():
    floor_types = rpw.db.Collector(of_category='OST_Floors', is_type=True).get_elements()
    wall_types = rpw.db.Collector(of_category='Walls', is_type=True,
                                  where=lambda x: x.GetParameters('Width')).get_elements()
    components = [
                    Label('Finish floor type:'),
                    ComboBox('floor_type_id',
                            {ft.parameters['Type Name'].AsString(): ft.Id for ft in floor_types}),
                    # Label('No Floors'),
                    CheckBox('make_floors', 'make Floors'),
                    Label('Finish wall type:'),
                    ComboBox('wall_type_id',
                            {wt.parameters['Type Name'].AsString(): wt.Id for wt in wall_types}),
                    Label('Finish wall height (mm):'),
                    TextBox('wall_height', default='3000'),
                    Button('Create Finish Walls')
                  ]

    ff = FlexForm('Create Finish Walls', components)
    ff.show()
    if ff.values['wall_type_id'] and ff.values['wall_height']:
        try:
            floor_type = rpw.db.Element.from_id(ff.values['floor_type_id'])
            wall_type = rpw.db.Element.from_id(ff.values['wall_type_id'])
            wall_height = float(ff.values['wall_height'])
            make_floors = ff.values['make_floors']
            return wall_type, wall_height, floor_type, make_floors
        except:
            return
Exemple #4
0
def addFields(components, fields):
    for field in fields:
        if field == '---':
            components.append(Separator())
        else:
            key = revitron.String.sanitize(field)
            components.append(Label(field))
            components.append(TextBox(key, Text=config.get(key)))
    return components
Exemple #5
0
def main():

    try:
        elements = selection.select_objects_by_category('Windows', 'Doors')
    except:
        return
    all_beam_types = rpw.db.Collector(of_category='Structural Framing',
                                      is_type=True).get_elements(wrapped=False)
    components = [
        Label('Lintel (Beam) Type:'),
        ComboBox('beam_type', {
            b.LookupParameter('Type Name').AsString(): b
            for b in all_beam_types
        }),
        Label('L1:'),
        TextBox('l1'),
        Label('L2:'),
        TextBox('l2'),
        Button('Create Lintels')
    ]

    ff = FlexForm('Create Lintels', components)
    ff.show()

    if ff.values:
        beam_type = ff.values['beam_type']
        try:
            l1 = float(ff.values['l1'])
            l2 = float(ff.values['l2'])
        except:
            return
        if not beam_type.IsActive:
            with rpw.db.Transaction('Activate Beam Type'):
                beam_type.Activate()
        for e in elements:
            create_lintel(e, l1, l2, beam_type)
Exemple #6
0
def flex_form(combo_values = dict, default_text = str):
    """Main Window"""
    components = [Label('Select View Template:'),
                  ComboBox('template', combo_values),
                  Separator(),
                  Label('Enter Suffix:'),
                  TextBox('suffix', Text= default_text),
                  Separator(),
                  CheckBox('select_levels', 'Select Levels'),
                  CheckBox('all_levels', 'All Levels',default= True),
                  Button('Create Views')
                  ]
    form = FlexForm('Create Views', components)
    form.show()
    return form 
Exemple #7
0
def form():
    wall_types = rpw.db.Collector(of_category='Walls', is_type=True,
                                  where=lambda x: x.GetParameters('Width')).get_elements()
    components = [Label('Finish wall type:'),
                  ComboBox('wall_type_id',
                           {wt.parameters['Type Name'].AsString(): wt.Id for wt in wall_types}),
                  Label('Finish wall height (mm):'),
                  TextBox('wall_height'),
                  Button('Create Finish Walls')]

    ff = FlexForm('Create Finish Walls', components)
    ff.show()
    if ff.values['wall_type_id'] and ff.values['wall_height']:
        try:
            wall_type = rpw.db.Element.from_id(ff.values['wall_type_id'])
            wall_height = float(ff.values['wall_height'])
            return wall_type, wall_height
        except:
            return
Exemple #8
0
def show_results(group, use, sprinkler, type):
    if not use:
        use = "ANY"

    height = allowable_height(group, use, sprinkler, type)
    stories = allowable_stories(group, use, sprinkler, type)
    area = allowable_area(group, use, sprinkler, type)

    text = ''

    if stories == 'NP' or area == 'NP':
        text = "This combination is not permitted"

    elif area == 'Unlimited':
        text = """Max height: {height} feet \n
Max stories above grade plane: {stories} \n
Unlimited area \n
See Section 507 for further info concerning max height for unlimited area buildings.""".format(height=height, stories=stories)

    elif sprinkler == 'S13R':
        text = """Max height: {height} feet \n
Max stories above grade plane: {stories} \n
Max area per story: {area} square feet\n
Max area total: {area} x N square feet\n
Where N = stories above grade plane, up to four""".format(height=height, stories=stories, area=area)

    else:
        text = """Max height: {height} feet \n
Max stories above grade plane: {stories} \n
Max area per story: {area} square feet \n
Max area total: {area} x N square feet \n
Where N = stories above grade plane, up to three""".format(height=height, stories=stories, area=area)

    text = text + "\n\nThis is an estimate, and not a replacement for a professional code review. There are many " \
                  "special exceptions listed in Chapter 5, especially for mixed-occupancy buildings, so please " \
                  "only use these values as a quick reference."

    components = [TextBox('textbox1', Text=text, Height=250, TextWrapping=0)]

    form = FlexForm('Results', components)
    form.show()
Exemple #9
0
    xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject('Excel.Application')
  except:
    Alert('The Excel sheet must be open (the program failed because of a problem with Excel)', title = "Failed", exit = True)

  dicWs = {}
  count = 1
  for i in xlApp.Worksheets:
      dicWs[i.Name] = i
      count += 1

  components = [Label('Select the name of Excel sheet to import :'),
            ComboBox('combobox', dicWs),
            Label('Choose the units you used in your Excel sheet :'),
            ComboBox('combobox2', {'Meters': 3.048, 'Decimeters': 30.48, 'Centimeters': 304.8, 'Millimeters': 3048}),
            Label('Enter the number of points:'),
            TextBox('textbox', Text="11"),
            Separator(),
            Button('OK')]
  form = FlexForm('Title', components)
  form.show()

  worksheet = form.values['combobox']
  rowEnd = convertStr(form.values['textbox'])
  array = []
  fails = []
  for r in range(1, rowEnd):
    try:
      x = convertStr(worksheet.Cells(r, 1).Text)/form.values['combobox2']
      y = convertStr(worksheet.Cells(r, 2).Text)/form.values['combobox2']
      z = convertStr(worksheet.Cells(r, 3).Text)/form.values['combobox2']
      array.append(XYZ(x,y,z))
Exemple #10
0
from rpw import revit, db
from rpw.ui.forms import (FlexForm, Label, ComboBox, TextBox, TextBox,
                          Separator, Button, CheckBox)
from rpw import ui
from rpw.ui.forms import select_file
from Autodesk.Revit.DB import Transaction
from Autodesk.Revit.DB.Plumbing.PlumbingUtils import BreakCurve
from rpw.db.xyz import XYZ
import csv

try:
    components = [
        Label('Codes in selected pipes:'),
        Label('Code parameter:'),
        TextBox('textbox1', Text="AR - CODIGO"),
        Label('Description parameter:'),
        TextBox('textbox2', Text="AR - DESCRICAO"),
        Button('Search base', on_click=ButtonClass.Importarbase),
        Separator(),
        Button('Process')
    ]
    form = FlexForm('Insert code in selected pipes', components)
    form.show()

    #Tubos = db.Collector(of_category='OST_PipeCurves',is_not_type=True)
    #ConexoesTubo = db.Collector(of_category='OST_PipeFitting',is_not_type=True)
    #AcessoriosTubo = db.Collector(of_category='OST_PipeAccessory',is_not_type=True)
    #Equipamentos = db.Collector(of_category='OST_PlumbingFixtures',is_not_type=True)

    Tubos = ui.Selection()
Exemple #11
0
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

import rpw
from rpw import revit, db, ui,DB,UI
from rpw.ui.forms import FlexForm, Label, ComboBox, TextBox, TextBox,Separator, Button, Alert
import json

from MyLib import Helper
doc = __revit__.ActiveUIDocument.Document
uidoc = __revit__.ActiveUIDocument
# 参数输入
components = [
Label('曲面偏移距离'),
TextBox('OffsetDistance', Text="500"),
Label('构件名称'),
TextBox('FamilyName', Text="HB200*100"),
Button('确定')
]
form = FlexForm('根据曲面与垂直线创建结构', components)
form.show()
Value=form.values
OffsetDistance=Value["OffsetDistance"]
FamilyName=Value['FamilyName']
Alert('请选择基础面', title=__doc__)

#pick Surface
Picked= uidoc.Selection.PickObject(UI.Selection.ObjectType.Face,"选择面")
PickedElementId=Picked.ElementId
Picked_Selection=doc.GetElement(PickedElementId)
Exemple #12
0
sorted_fillreg = OrderedDict(sorted(unsorted_dict.items(), key=lambda t: t[1]))

# get all text styles to choose from
txt_types = DB.FilteredElementCollector(revit.doc).OfClass(DB.TextNoteType)
text_style_dict = {
    txt_t.get_Parameter(DB.BuiltInParameter.SYMBOL_NAME_PARAM).AsString():
    txt_t
    for txt_t in txt_types
}

# construct rwp UI
components = [
    Label("Pick Text Style"),
    ComboBox(name="textstyle_combobox", options=text_style_dict),
    Label("Box Width [mm]"),
    TextBox(name="box_width", Text="800"),
    Label("Box Height [mm]"),
    TextBox(name="box_height", Text="300"),
    Label("Offset [mm]"),
    TextBox(name="box_offset", Text="100"),
    Button("Select")
]
form = FlexForm("Select", components)
ok = form.show()
if ok:
    # assign chosen values
    text_style = form.values["textstyle_combobox"]
    box_width = int(form.values["box_width"])
    box_height = int(form.values["box_height"])
    box_offset = int(form.values["box_offset"])
else:
Exemple #13
0
]
if not selected_rooms:
    UI.TaskDialog.Show('MakeWalls', 'You need to select at lest one Room.')
    sys.exit()

#Get wall_types
wall_types = rpw.db.Collector(of_category='OST_Walls',
                              is_type=True).get_elements(wrapped=False)
#Select wall type
wall_type_options = {DB.Element.Name.GetValue(t): t for t in wall_types}
#Select wall types UI
components = [
    Label('Выберите тип отделки стен:'),
    ComboBox('wl_type', wall_type_options),
    Label('Введите высоту стены:'),
    TextBox('h_offset', wall_custom_height="50.0"),
    CheckBox('checkbox1', 'Брать высоту стены из помещений'),
    Button('Select')
]
form = FlexForm('Создать отделку стен', components)
win = form.show()

#Get the ID of wall type
if win == True:
    wall_type = form.values['wl_type']
    wall_type_id = wall_type.Id
else:
    sys.exit()


# Duplicating wall type creating the same layer set with double width
Exemple #14
0
__author__ = 'André Rodrigues da Silva'

from rpw import revit, db
from rpw.ui.forms import (FlexForm, Label, ComboBox, TextBox, TextBox,
                          Separator, Button, CheckBox)
from rpw.ui.forms import select_file
from Autodesk.Revit.DB import Transaction
from Autodesk.Revit.DB.Plumbing.PlumbingUtils import BreakCurve
from rpw.db.xyz import XYZ
import csv

try:
    components = [
        Label('Clear Mark Parameter:'),
        Label('Mark Parameter:'),
        TextBox('textbox1', Text="Mark"),
        Separator(),
        Button('Process')
    ]
    form = FlexForm('Clear Mark Parameter', components)
    form.show()

    #Tubos = db.Collector(of_category='OST_PipeCurves',is_not_type=True)
    ConexoesTubo = db.Collector(of_category='OST_PipeFitting',
                                is_not_type=True)
    AcessoriosTubo = db.Collector(of_category='OST_PipeAccessory',
                                  is_not_type=True)
    Equipamentos = db.Collector(of_category='OST_PlumbingFixtures',
                                is_not_type=True)
    ConexoesDuto = db.Collector(of_category='OST_DuctFitting',
                                is_not_type=True)
from revitron import _
from rpw.ui.forms import FlexForm, TextBox, Button, Label, Separator, ComboBox, CheckBox
import System.Windows

defaultParameter = False
parameters = revitron.ParameterNameList().get()
selection = revitron.Selection.get()

if 'Family and Type' in parameters:
    defaultParameter = 'Family and Type'

components = [
    Label('Parameter Name'),
    ComboBox('parameter', parameters, default=defaultParameter),
    Label('Search String'),
    TextBox('search'),
    Separator(),
    CheckBox('invert', 'Invert Selection', default=False)
]

if selection:
    components.append(
        CheckBox('selection', 'Search in selection only', default=True))
else:
    components.append(
        CheckBox('viewOnly', 'Search in this view only', default=False))

components.append(
    Button('Select',
           Width=100,
           HorizontalAlignment=System.Windows.HorizontalAlignment.Right))
Exemple #16
0
# -*- coding: utf-8 -*-
__title__ = 'Select Elements\nBy UDIC Name'
__author__ = 'htl'
import clr
clr.AddReference('RevitAPI')
import Autodesk

import rpw
from rpw import doc, uidoc
from rpw.ui.forms import Label, TextBox, Button, FlexForm

from System.Collections.Generic import List

workset_table = doc.GetWorksetTable()
active_ws_id = workset_table.GetActiveWorksetId()

components = [Label('UDIC Name:'), TextBox('name'), Button('Select All')]

ff = FlexForm('Select by Name', components)
ff.show()

if ff.values:
    s = rpw.db.Collector(is_type=False, view=doc.ActiveView,
                         where=lambda x: x.WorksetId==active_ws_id \
                                         and x.LookupParameter('UDIC_Name') \
                                         and x.LookupParameter('UDIC_Name').AsString()==ff.values['name'])
    sids = List[rpw.DB.ElementId](s.element_ids)
    uidoc.Selection.SetElementIds(sids)
Materials = rpw.db.Collector(of_category='OST_Materials',
                             is_type=False).get_elements(wrapped=False)
Materials_options = {t.Name: t for t in Materials}
CategoryID_options = {
    "常规模型": DB.BuiltInCategory.OST_GenericModel,
    "墙": DB.BuiltInCategory.OST_Walls
}

#信息输入部分
components = [
    Label('材质'),
    ComboBox('Material', Materials_options),
    Label('类型'),
    ComboBox('Category', CategoryID_options),
    Label('Rhino图层'),
    TextBox('Layer', Text="Default"),
    Button('确定')
]
form = FlexForm('结构', components)
form.show()
Value = form.values

Mat = Value['Material'].Id

Category = Value['Category']

RhinoFile = rc.FileIO.File3dm.Read(finlename)


def GetOBjectByLayer(RehinoFile, LayerName):
    Objects = RehinoFile.Objects.FindByLayer(LayerName)
Exemple #18
0
    Label("Titleblock"),
    ComboBox("combobox3",
             list_to_dict_2(title_blocks),
             default="SSG_TB_8.5x11_PDF: Empty"),
    Label("View Template"),
    ComboBox("combobox4",
             list_to_dict(view_templates),
             default="SSG_Plan - Swatch"),
    Label("Header Text Style"),
    ComboBox(
        "combobox5",
        list_to_dict(all_text),
        default='SSG_1/8" - Segoe UI Semibold - Dark Blue',
    ),
    Label("Sheet Header"),
    TextBox("textbox1", Text="Finish Options"),
    Button("Continue"),
]

form = FlexForm("Finish Options 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["combobox5"]
    short_descript = form.values["textbox1"]

    all_mats = DB.FilteredElementCollector(revit.doc).OfCategory(
        DB.BuiltInCategory.OST_Materials)
Exemple #19
0
    # assign chosen parameters
    cat_name = form.values["cat_combobox"].Name
except:
    forms.alert_ifnot(cat_name, "No selection", exitscript=True)

cat = GetBICFromCat(form.values["cat_combobox"])  #BuiltInCategory
param_dict1 = GetInstanceParameters(cat)

# construct rwp UI for Parameter and Prefix
components = [
    Label("Pick Parameter:"),
    ComboBox(name="param_combobox", options=param_dict1, sorted=True),
    Label("Prefix"),
    TextBox(
        name="prefix_box",
        Text="X00_",
        description=
        "Any prefix that you would like your numbering to have, such as 'ID_' for Interior Door"
    ),
    Label("Leading zeroes"),
    TextBox(name="leading_box", Text="3"),
    Label("Starting element number"),
    TextBox(name="count_start", Text="1"),
    Button("Select")
]
form = FlexForm("Select", components)
form.show()

parameter = None
prefix = None
leading = None
start_count = None
Exemple #20
0
if not selected_rooms:
    UI.TaskDialog.Show('Создать отделку потолка', 'Необходимо выбрать помещение.')
    sys.exit()



#Get ceiling_types
ceiling_types = rpw.db.Collector(of_category='OST_Roofs', is_type=True).get_elements(wrapped=False)
#Select ceiling type
ceiling_type_options = {DB.Element.Name.GetValue(t): t for t in ceiling_types}
#Select ceiling types UI

components = [Label('Выберите тип потолка:'),
              ComboBox('cl_type', ceiling_type_options),
              Label('Введите привязку потолка к уровню :'),
              TextBox('h_offset', ceiling_offset="50.0"),
              CheckBox('checkbox1', 'Из помещения'),
              Button('Select')]
form = FlexForm('Создать отделку потолка',components)
win = form.show()

if win == False:
    sys.exit()

#Get the ID of ceiling ( NewFootPrintRoof )
ceiling_type_id = form.values['cl_type'].Id
if form.values['h_offset'] != "":
    offset3 = float(form.values['h_offset'])
else:
    offset3 = 2000
Exemple #21
0
                .ToElements()

level_collector = FilteredElementCollector(doc)\
            .OfCategory(BuiltInCategory.OST_Levels)\
            .WhereElementIsNotElementType()\
            .ToElements()

levels = {}
for level in level_collector:
    levels[level.Name] = level

components = [
    Label('Select the floor\'s level :'),
    ComboBox('floor_level', levels),
    Label('Enter the height required under the beams:'),
    TextBox('height_required', Text="2.80"),
    Separator(),
    Button('OK')
]
form = FlexForm('Title', components)
form.show()

floor_level = round(form.values["floor_level"].Elevation / 3.2808399, 3)
height_required = float(form.values["height_required"])

t = Transaction(doc, 'Tag beam')
t.Start()

for beam in beam_collector:
    z_max = (beam.get_Geometry(options).GetBoundingBox().Max.Z +
             beam.LookupParameter("Valeur de d" + e_a + "calage" +
Exemple #22
0
floor_plan_type = [
    vt for vt in col_view_types if database.get_name(vt) == "Floor Plan"
][0]
view_scale = 50

# get units for Crop Offset variable
if units.is_metric(revit.doc):
    unit_sym = "Crop Offset [mm]"
    default_crop_offset = 350
else:
    unit_sym = "Crop Offset [decimal inches]"
    default_crop_offset = 9.0

components = [
    Label(unit_sym),
    TextBox("crop_offset", Text=str(default_crop_offset)),
    Label("View Template for Plans"),
    ComboBox(name="vt_plans", options=sorted(viewplan_dict), default="<None>"),
    Separator(),
    Button("Select"),
]

form = FlexForm("View Settings", components)
form.show()
# match the variables with user input
chosen_vt_plan = viewplan_dict[form.values["vt_plans"]]
chosen_crop_offset = units.correct_input_units(form.values["crop_offset"])

for room in selection:
    with revit.Transaction("Create Plan", revit.doc):
        level = room.Level
Exemple #23
0
Picked_Selection = db.Element.from_id(PickedElementId)
# 信息输入部分
Framing_types = rpw.db.Collector(of_category='OST_StructuralFraming',
                                 is_type=True).elements

Framing_type_options = {
    t.FamilyName + DB.Element.Name.GetValue(t): t
    for t in Framing_types
}

Level_type = db.Collector(of_category='Levels', is_type=False).elements
Level_type_options = {DB.Element.Name.GetValue(t): t for t in Level_type}

components = [
    Label('输入图层名称'),
    TextBox('图层名称', Text="S-STEL-BEAM"),
    Label('构件名称'),
    ComboBox('FamilyName', Framing_type_options),
    Label('标高'),
    ComboBox('Level', Level_type_options),
    Label('偏移标高'),
    TextBox('Offset', Text="-300"),
    Button('确定')
]
form = FlexForm('结构', components)
form.show()
Value = form.values

LayerName = Value['图层名称']
FamilyName = Value['FamilyName']
Level = Value['Level']
Exemple #24
0
# get the PrintManger from the current document 
printman = doc.PrintManager 
	# When this is run, a dialog pops up: Freepdf cannot be used with 95x90 print
	# settings. The "in-session print settings will be used" 
	# - This dialog can not be dissabled. 

# set this PrintManager to use the "Selected Views/Sheets" option
printman.PrintRange = PrintRange.Select  # PrintRange is a different class
	
# get the ViewSheetSetting which manages the view/sheet set information of current document 
viewshsetting = printman.ViewSheetSetting  # returns ViewsheetSetting object, 

# textin Dialog:FlexForm from rpw, 
components = [Label('Enter Name: '),
		TextBox('textbox1', Text=""),
		CheckBox('checkbox1', 'Overwrite, if name exists', default=True),
		Button('OK')]
textin = FlexForm('New ViewSheetSet', components)
textin.show() 

print(textin.values) 

# with Transaction(doc, 'Created Print Set'): 
	
#vsexist = True if textin.values["textbox1"] in allviewss.keys() 
#			else 3 if len(textin.values) == 0  else False

try:
	if textin.values["textbox1"] in allviewss.keys() : 
		vsexist = True	
    sys.exit()

#Get floor_types
floor_types = rpw.db.Collector(of_category='OST_Floors',
                               is_type=True).get_elements(wrapped=False)
#Select floor type
floor_type_options = {DB.Element.Name.GetValue(t): t for t in floor_types}
#Select floor types UI

floor_type_id = ""

components = [
    Label('Выберите тип отделки:'),
    ComboBox('fl_type', floor_type_options),
    Label('Введите привязку пола к уровню :'),
    TextBox('h_offset', base_offset="50.0"),
    CheckBox('checkbox1', 'Брать смещение пола из свойств помещения'),
    CheckBox('checkbox2', 'Вырезать отверстия'),
    Label('Вырезание отверстий работает корректно'),
    Label('при выборе только одного помещения'),
    Button('Select')
]
form = FlexForm('Создать отделку пола', components)
win = form.show()

if win == False:
    sys.exit()

#Get the ID of floor type
floor_type_id = form.values['fl_type'].Id
if form.values['h_offset'] != "":
Exemple #26
0
             list_to_dict_2(title_blocks),
             default="SSG_TB_8.5x11_PDF: Empty"),
    Label("View Template"),
    ComboBox("combobox4",
             list_to_dict(view_templates),
             default="SSG_Elevation - Legend"),
    Label("Separator Line Style"),
    ComboBox(
        "combobox6",
        list_to_dict(all_text),
        default='SSG_3/32" - Segoe UI Semibold - Dark Blue',
    ),
    Label("Sheet Header"),
    ComboBox("combobox5", list_to_dict(gsCat), default="06"),
    Label("Header Text Style"),
    TextBox("textbox1", Text="Legend"),
    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
Exemple #27
0
clr.AddReference('RevitAPIUI')
clr.AddReference("RevitNodes")

from pyrevitnvn.units import (Convert_length,
                              Convert_Display_length_To_Internal)
from pyrevitnvn.reauto import (get_edges_lines_corners_main,
                               plot_design_cordninates)

doc = __revit__.ActiveUIDocument.Document
tt = Transaction(doc, "Retail Automation")

#UI form organization
components_1 = [
    Label('SUITE EXTENTS'),
    Label('Bays Length'),
    TextBox('textbox1', Text="7000, 8000, 6000, 9000, 5000, 5000, 7000"),
    Label('Bays Width'),
    TextBox('textbox2', Text="7000,7000,7000,7000,7000"),
    Label('Wall Heights'),
    TextBox('textbox3', Text="7000"),
    Label('Ceiling Heights'),
    TextBox('textbox4', Text="7000"),
    Label('Storefront Distance From Front'),
    TextBox('textbox5', Text="1000"),
    CheckBox('checkbox1', 'Rear Left Door'),
    CheckBox('checkbox2', 'Rear Right Door'),
    Separator(),
    Button('Go')
]

components_2 = [
Exemple #28
0
    rpw.ui.forms.Alert('Finished creating foundation, saved at {}'.format(foundation_rfa_path))
    os.startfile(foundation_rfa_path)




foundations = rpw.db.Collector(of_class='Family',
                               where=lambda x: x.FamilyCategory.Name=='Structural Foundations')

components = [Label('Select Pile Cap:'),
            ComboBox('foundation_id', {f.Name: f.Id for f in foundations}),
            Label('Select Rectangular Pile:'),
            ComboBox('pile_id', {f.Name: f.Id for f in foundations}),
            Label('Pile width (D):'),
            TextBox('pile_width'),
            Label('Number of piles along Length:'),
            TextBox('piles_along_length'),
            Label('Number of piles along Width:'),
            TextBox('piles_along_width'),
            Label('Pile spacing along Length:'),
            TextBox('pile_spacing_along_length'),
            Label('Pile spacing along Width:'),
            TextBox('pile_spacing_along_width'),
            Label('Length cover:'),
            TextBox('length_cover'),
            Label('Width cover:'),
            TextBox('width_cover'),
            Label('Foundation Thickness:'),
            TextBox('thickness'),
            Label('Pile Cut-off:'),
Exemple #29
0
    for i in xlApp.Worksheets:
        dicWs[i.Name] = i
        count += 1

    components = [
        Label('Pick a category:'),
        ComboBox('combobox2', {
            'Doors': 0,
            'Rooms': 1
        }),
        Label('Select the name of Excel sheet to import:'),
        ComboBox('combobox', dicWs),
        Label(
            'Enter the number of rows in Excel you want to integrate to Revit:'
        ),
        TextBox('textbox', Text="60"),
        Label(
            'Enter the number of colones in Excel you want to integrate to Revit:'
        ),
        TextBox('textbox2', Text="2"),
        Separator(),
        Button('OK')
    ]
    form = FlexForm('Title', components)
    form.show()

    worksheet = form.values['combobox']
    rowEnd = convertStr(form.values['textbox'])
    colEnd = convertStr(form.values['textbox2'])
    category = form.values['combobox2']
Exemple #30
0
#sec_types = rpw.db.Collector(of_category='OST_Walls', is_type=True).get_elements(wrapped=False)
view_types = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements()
for types in view_types:
    #if types.ViewFamily.ToString() == "Section" or types.ViewFamily.ToString() == "Detail":
    if types.ViewFamily.ToString() == "Section":
        sec_types.append(types)

#Select section type
sec_type_options = {DB.Element.Name.GetValue(t): t for t in sec_types}

components = [
    Label('Выберите тип разреза:'),
    ComboBox('s_type', sec_type_options),
    Label('Введите привязку разреза к стене, мм'),
    Label('(по умолчанию 50мм):'),
    TextBox('s_offset', sec_offset="50.0"),
    CheckBox('flip', 'Развернуть разрез на 180'),
    Button('Start')
]
form = FlexForm('Создать развёртку стены', components)
win = form.show()

if win == False:
    sys.exit()

# user offset (crop region = far clip)
if form.values['s_offset'] != "":
    offset = units(float(form.values['s_offset']))
else:
    offset = units(50)