Model.nodelistbypath#
- Model.nodelistbypath(node_entity1, node_entity2, entitylist)#
Creates a node path from the starting node to the ending node. If both
node_entity1andnode_entity2lie on free edges, the path will follow free edges where possible. Otherwise, the shortest path is returned.- Parameters:
node_entity1 (Entity) – The object describing the first node entity.
node_entity2 (Entity) – The object describing the second node entity.
entitylist (EntityList) – The list containing the entity nodes objects to populate.
Example#
Determine the path between the nodes with IDs 33 and 136#import hm import hm.entities as ent model = hm.Model() node_entity1 = ent.Node(model, 33) node_entity2 = ent.Node(model, 136) entitylist = hm.EntityList(ent.Node, hm.hwUIntList([])) model.nodelistbypath(node_entity1=node_entity1, node_entity2=node_entity2, list=list)