Model.nodesassociatetogeometry#

Model.nodesassociatetogeometry(collection, entity, tolerance)#

This function is used to associate nodes to points, lines, surfaces and solids. Association also moves/positions the nodes onto that geometric entity.

Parameters:
  • collection (Collection) – The collection containing the node entities to position and associate.

  • entity (Entity) – The object describing the entity to use for assocation. Valid entities are points, lines, surfaces and solids. When surface entity is used, surface edges are also considered for the association.

  • tolerance (double) – The search tolerance to use for the association. Any nodes on collection that are further than tolerance away from the specified entity are not associated.

Example#

Associatin the nodes with IDs 1-100 to surface with ID 5 using a tolerance of 0.01#
import hm
import hm.entities as ent

model = hm.Model()

# Creating a collection that contains the nodes with IDs 1-100
filter_nodes = hm.FilterByEnumeration(ent.Node, list(range(1, 101)))
nodes_collection = hm.Collection(model, filter_nodes)

model.nodesassociatetogeometry(
    collection=nodes_collection, entity=ent.Surface(model, 5), tolerance=0.01
)