Skip to content

Commit

Permalink
Update document.py
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Oct 30, 2020
1 parent 8594c28 commit f2cdd80
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions revitron/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Document:
path = revitron.Document().getPath()
if revitron.Document().isFamily():
pass
pass
"""

def __init__(self, doc = None):
Expand All @@ -36,16 +36,22 @@ def getDuplicateInstances(self, preferOlderElement = False):
Returns a list of duplicate family instances.
By default, the list contains always the younger more recently created duplicate instance.
Note:
This method requires **Revit 2018** or newer!
Args:
preferOlderElement (bool, optional): Optionally return the list with the older instances. Defaults to False.
Returns:
list: A list with duplicate instances, either the younger or the older ones.
"""
import revitron
if revitron.REVIT_VERSION < 2018:
revitron.Log().error('Method revitron.Document.getDuplicateInstances() is not supported by this Revit version!')
return []
index = 1
if preferOlderElement:
index = 0
import revitron
of = revitron.DB.BuiltInFailures.OverlapFailures
duplicates = []
for warning in self.doc.GetWarnings():
Expand Down

0 comments on commit f2cdd80

Please sign in to comment.