Model.hm_getduplicateelements#
- Model.hm_getduplicateelements(elements, outputCollection, options=0)#
Returns a list of duplicate elements as a list of lists. The duplicate elements are determined per the options argument. The format of the returned values is a list of lists, sorted from lowest to highest ID. Each list corresponds to the duplicate elements at that “location”.
- Parameters:
elements (Collection) – The collection containing the element entities to consider for use for finding duplicates.
outputCollection (Collection) – The collection containing the duplicated element entities to put on.
options (int) – Currently unsupported. Must be set to 0.
- Returns:
hwReturnStatus- Status objectHmQueryResultList- Result list object containingHmQueryResultobjects with the following output data:duplicateElements (EntityList)
Example#
Find duplicates for the displayed elements and put all of them on output collection#import hm import hm.entities as ent model = hm.Model() elems = hm.CollectionByDisplayed(model, ent.Element) output = hm.Collection(model, ent.Element, populate=False) _, resultlist = model.hm_getduplicateelements(elements=elems, outputCollection=output, options=0) for result in resultlist: print("duplicateElements", result.duplicateElements)