Model.linelistbypath#

Model.linelistbypath(line_entity1, line_entity2, entitylist, flag)#

Creates a line path from the starting line to the ending line.

Parameters:
  • line_entity1 (Entity) – The object describing the first line entity.

  • line_entity2 (Entity) – The object describing the second line entity.

  • entitylist (EntityList) – A list to be populated containing the line entity objects.

  • flag (int) –

    0 - If both line_entity1 and line_entity2 lie are free edges, the path will follow free edges where possible. Otherwise, the shortest path is returned.

    1 - Always return the shortest path.

Example#

Determine the path between lines with IDs 100 and 110 use the shortest path#
import hm
import hm.entities as ent

model = hm.Model()

list_populate = []

model.linelistbypath(
    line_entity1=ent.Line(model, 100),
    line_entity2=ent.Line(model, 110),
    entitylist=list_populate,
    flag=1,
)