Model.marknotintersection#

Model.marknotintersection(collectiona, collectionb)#

Determines the intersection between two marks and stores everything but the intersection in the first collection.

Parameters:
  • collectiona (Collection) – The collection containing the first element entities.

  • collectionb (Collection) – The collection containing the second element entities.

Example#

Delete the elements not shared by collectiona and collectionb#
import hm
import hm.entities as ent

model = hm.Model()

elems1 = hm.Collection(model, ent.Element, [1, 2, 3, 4])
elems2 = hm.Collection(model, ent.Element, [4, 5, 6, 7])

model.marknotintersection(collectiona=elems1, collectionb=elems2)
model.deletemark(elems1)

Note

This will delete elements with IDs 1,2,3,5,6 and 7.