Model.hm_getgeometrynodes#

Model.hm_getgeometrynodes(geometry_list, association='', node_query=hwStringList(), query_type='')#

Gets a list of associated nodes from the set of geometric entities.

Parameters:
  • geometry_list (hwEntityListList) – Geometric entities description list. The types of entities can be surfs, lines, points or solids.

  • association (hwString) –

    The association type of the nodes to query. Valid values are:

    initial - Return nodes whose initial geometry is same as the input geometry list. (default)

    current - Return nodes whose current geometry is same as the input geometry list.

  • node_query (hwStringList) –

    Use this parameter to return boundary nodes which are associated with boundary geometries. By default, when querying lines, surfaces or solids, only internal nodes are returned. Multiple values can be provided in a form of a list. Valid values are:

    points - Include nodes associated to boundary points

    lines - Include nodes associated to boundary lines

    surfaces - Include nodes associated to boundary surface

  • query_type (hwString) – The type of geometry to query. Default query type is CAD only. fegeometry - Include FE geometry to query.

Returns:

Examples#

Get nodes associated to the surface with ID 12#
import hm
import hm.entities as ent

model = hm.Model()

entitylist_list = hm.hwEntityListList(
        [
            hm.EntityList(ent.Surface.fulltype, hm.hwUIntList([12])),
        ]
)
_, result = model.hm_getgeometrynodes(geometry_list=entitylist_list, association="current")

print("nodeList", result.nodeList)
Get nodes associated to the surface with ID 4 and 12 include boundary nodes :#
import hm
import hm.entities as ent

model = hm.Model()

entitylist_list = hm.hwEntityListList(
        [
            hm.EntityList(ent.Surface.fulltype, hm.hwUIntList([4, 12])),
        ]
)
_, result = model.hm_getgeometrynodes(geometry_list=entitylist_list, association="initial", node_query=["points", "lines"])

print("nodeList", result.nodeList)
Get nodes associated to the line with ID 13#
import hm
import hm.entities as ent

model = hm.Model()

entitylist_list = hm.hwEntityListList(
        [
            hm.EntityList(ent.Line.fulltype, hm.hwUIntList([13])),
        ]
)
_, result = model.hm_getgeometrynodes(geometry_list=entitylist_list)

print("nodeList", result.nodeList)
Get nodes associated to the line with ID 13 , include its endpoints#
import hm
import hm.entities as ent

model = hm.Model()

entitylist_list = hm.hwEntityListList(
        [
            hm.EntityList(ent.Line.fulltype, hm.hwUIntList([13])),
        ]
)
_, result = model.hm_getgeometrynodes(geometry_list=entitylist_list, node_query=["points"])

print("nodeList", result.nodeList)

Note

Parameters specifying the type of entities can appear any place in the parameter list. They define the type for all entities that follow in the list, until the next occurrence of type parameter.

If no type parameter is specified at the beginning of the parameter list, surfs type is assumed for all parameters until the first occurring type parameter.

Geometric entities can be duplicated in the input list but associated node IDs are unique in the output.