Model.hm_getnodessharedbyothercomps#

Model.hm_getnodessharedbyothercomps(components, nodes, exclude)#

Returns the nodes on the input components that are shared by other components.

Parameters:
  • components (Collection) – The input collection containing the component entities with the nodes of interest.

  • nodes (Collection) – The output collection containing the identified shared node entities.

  • exclude (bool) –

    False - Do not exclude any nodes.

    True - Exclude nodes on mass, rigid and joint elements.

Returns:

Example#

Find the nodes from component with ID 100 shared by other components#
import hm
import hm.entities as ent

model = hm.Model()

component_collection = hm.Collection(model, ent.Component, [100])
out_node_collection = hm.Collection(model, ent.Node, populate=False)

model.hm_getnodessharedbyothercomps(
    components=component_collection, nodes=out_node_collection, exclude=False
)
print("Number of shared nodes", len(out_node_collection))
print("Shared nodes:", [n.id for n in out_node_collection])