Model.collectormarkmove#

Model.collectormarkmove(collection, move_to_front, sort)#

Moves and/or sorts the entities of a collection within browser/advanced entity selecetion menus.

Parameters:
  • collection (Collection) – The collection containing the entities to move. Valid entities are the ones from Reorder Tool (parts(assemblies), components, groups, load collectors, load steps, materials, output blocks, properties, sets, system collectors, tables and titles).

  • move_to_front (int) –

    A flag that indicates if the selected entities should be moved to the front of the list. Valid values are:

    0 - Move the entities of the collection to the end of the list.

    1 - Move the entities of the collection to the front of the list.

  • sort (int) –

    A flag that indicates how the entities will be sorted. Valid values are:

    0 - The entities of the collection are not to be sorted.

    1 - The entities of the collection are sorted by name.

    2 - The entities of the collection are sorted by ID.

Example#

Move the displayed components to the top of the list in the browser with no sorting#
import hm
import hm.entities as ent

model = hm.Model()

comps_collection = hm.CollectionByDisplayed(model, ent.Component)

model.collectormarkmove(collection=comps_collection, move_to_front=1, sort=0)