Model.linescreatemidline#

Model.linescreatemidline(linelist1, trimnodelist1, linelist2, trimnodelist2)#

Creates a line that approximates the middle path between two roughly parallel, roughly planar, lines.

Parameters:
  • linelist1 (EntityList) – The list of line entities forming one side of the path.

  • trimnodelist1 (EntityList) – The list of 0 or 2 node entities that mark the endpoints to use to trim the lines in linelist1.

  • linelist2 (EntityList) – The list of line entities forming the other side of the path.

  • trimnodelist2 (EntityList) – The list of 0 or 2 node entities that mark the endpoints to use to trim the lines in linelist2.

Example#

Create a midline between lines with IDs 22 and 23#
import hm
import hm.entities as ent

model = hm.Model()

linelist1 = hm.EntityList(ent.Line.fulltype, hm.hwUIntList([22]))
trimnodelist1 = hm.EntityList(ent.Node.fulltype, hm.hwUIntList([]))
linelist2 = hm.EntityList(ent.Line.fulltype, hm.hwUIntList([23]))
trimnodelist2 = hm.EntityList(ent.Node.fulltype, hm.hwUIntList([]))
model.linescreatemidline(
    linelist1=linelist1,
    trimnodelist1=trimnodelist1,
    linelist2=linelist2,
    trimnodelist2=trimnodelist2,
)