Model.linecreatedragnodealongvector#

Model.linecreatedragnodealongvector(collection, vector, distance)#

Creates straight segment lines by dragging nodes or points a user specified distance along a vector.

Parameters:
  • collection (Collection) – The collection containing the input entities to create straight segment lines. Valid entities are points and nodes.

  • vector (hwTriple) – The temporary vector.

  • distance (double) – The distance to drag the input points.

Example#

Create 4 straight segments with endpoints at nodes with IDs 2 , 4 , 6 and 8 , oriented parallel to the x - axis , with lengths of 1.5#
import hm
import hm.entities as ent

model = hm.Model()

model.linecreatedragnodealongvector(
    collection=hm.Collection(model, ent.Node, [2, 4, 6, 8]),
    vector=[1.0, 0.0, 0.0],
    distance=1.5,
)