Model.hm_gettargetentitiesfromset#

Model.hm_gettargetentitiesfromset(setcollection, targettype, directflag=0)#

Gets the list of entities of a particular entity selected by the marked sets.

Parameters:
  • setcollection (Collection) – The collection containing the sets.

  • targettype (EntityFullType) – The type of entity to be extracted from the set. Valid values are components, nodes, assemblies, solversubmodels, sets, elements, box, segment, plane, and ellipse.

  • directflag (int) – Flag to fetch only direct entities extracted out of set. Valid values are 0 and 1.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • entitylist (EntityList) - The list of entity objects.

Example#

Extract box entities and node entities from all set#
import hm
import hm.entities as ent

model = hm.Model()

set_col = hm.Collection(model,ent.Set)

_,result = model.hm_gettargetentitiesfromset(
    setcollection=set_col,
    targettype=ent.Box
)

_,result = model.hm_gettargetentitiesfromset(
    setcollection=set_col,
    targettype=ent.Node
)