Skip to content

Commit

Permalink
re PR #619 - Cleaned up db.query for cat comparison consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
eirannejad committed Jun 2, 2019
1 parent 73d547e commit 110fa20
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions pyrevitlib/pyrevit/revit/db/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,28 @@
DB.ViewType.PanelSchedule,
DB.ViewType.Walkthrough,
DB.ViewType.Rendering
]
]


DETAIL_CURVES = (DB.DetailLine,
DB.DetailArc,
DB.DetailEllipse,
DB.DetailNurbSpline)
DETAIL_CURVES = (
DB.DetailLine,
DB.DetailArc,
DB.DetailEllipse,
DB.DetailNurbSpline
)

MODEL_CURVES = (DB.ModelLine,
DB.ModelArc,
DB.ModelEllipse,
DB.ModelNurbSpline)
MODEL_CURVES = (
DB.ModelLine,
DB.ModelArc,
DB.ModelEllipse,
DB.ModelNurbSpline
)

BUILTINCATEGORIES_VIEW = [
int(DB.BuiltInCategory.OST_Views),
int(DB.BuiltInCategory.OST_ReferenceViewer),
int(DB.BuiltInCategory.OST_Viewers)
]
DB.BuiltInCategory.OST_Views,
DB.BuiltInCategory.OST_ReferenceViewer,
DB.BuiltInCategory.OST_Viewers
]

GridPoint = namedtuple('GridPoint', ['point', 'grids'])

Expand Down Expand Up @@ -601,8 +605,7 @@ def get_all_referencing_elements(doc=None):
.ToElements():
if el.Category \
and isinstance(el, DB.Element) \
and el.Category \
and el.Category.Id.IntegerValue in BUILTINCATEGORIES_VIEW:
and get_builtincategory(el.Category) in BUILTINCATEGORIES_VIEW:
all_referencing_elements.append(el.Id)
return all_referencing_elements

Expand All @@ -614,8 +617,7 @@ def get_all_referencing_elements_in_view(view):
.ToElements():
if el.Category \
and isinstance(el, DB.Element) \
and el.Category \
and el.Category.Id.IntegerValue in BUILTINCATEGORIES_VIEW:
and get_builtincategory(el.Category) in BUILTINCATEGORIES_VIEW:
all_referencing_elements_in_view.append(el.Id)
return all_referencing_elements_in_view

Expand Down

0 comments on commit 110fa20

Please sign in to comment.