Skip to content

Commit

Permalink
add compatible view types and change text of create button when unabl…
Browse files Browse the repository at this point in the history
…e to create pattern
  • Loading branch information
alexdaversa committed Dec 30, 2022
1 parent f092548 commit 5faf951
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
DB.DisplayUnitType.DUT_CENTIMETERS,
DB.DisplayUnitType.DUT_MILLIMETERS]

acceptable_viewtypes = [DB.ViewType.FloorPlan,
DB.ViewType.CeilingPlan,
DB.ViewType.Elevation,
DB.ViewType.DraftingView,
DB.ViewType.EngineeringPlan,
DB.ViewType.AreaPlan,
DB.ViewType.Section,
DB.ViewType.Detail]
acceptable_viewtypes = ['FloorPlan',
'CeilingPlan',
'Elevation',
'DraftingView',
'EngineeringPlan',
'AreaPlan',
'Section',
'Detail']

# type in lower case
readonly_patterns = ['solid fill']
Expand All @@ -75,7 +75,7 @@ def __init__(self, xaml_file_name, rvt_elements=None):
self._export_only = True
self.prompt_lb.Content = "Select Pattern to Export"

if revit.active_view.ViewType not in acceptable_viewtypes:
if revit.active_view.ViewType.ToString() not in acceptable_viewtypes:
self.resolver_ops.IsEnabled = False
self.create_b.Content = "Incompatible View Type"
self.create_b.IsEnabled = False
Expand Down

0 comments on commit 5faf951

Please sign in to comment.