Beispiel #1
0
__window__.Close()

import sys
import os
from collections import namedtuple

from Autodesk.Revit.DB.Architecture import Room

import rpw
from rpw import doc, uidoc, DB, UI, platform

DEFAULT_CROP = '0.75'  # About 9"

# Validate + Filter Selection
selection = rpw.Selection()
selected_rooms = [e for e in selection.elements if isinstance(e, Room)]

if not selected_rooms:
    UI.TaskDialog.Show('MakeViews', 'You need to select at lest one Room.')
    sys.exit()

# Get View Types and Prompt User
plan_types = rpw.Collector(of_class='ViewFamilyType', is_type=True).elements

# Filter all view types that are FloorPlan or CeilingPlan
plan_types_options = {
    DB.Element.Name.GetValue(t): t
    for t in plan_types if t.ViewFamily == DB.ViewFamily.FloorPlan
    or t.ViewFamily == DB.ViewFamily.CeilingPlan
}
Beispiel #2
0
 def test_selection_clear(self):
     self.selection.clear()
     self.assertEqual(len(self.selection), 0)
     self.selection = rpw.Selection([wall_int])
Beispiel #3
0
 def test_selection_add(self):
     selection = rpw.Selection()
     selection.add([wall_int])
     self.assertIsInstance(selection[0], DB.Wall)
Beispiel #4
0
 def setUp(self):
     self.selection = rpw.Selection([wall_int])