Model.scalemarkwithsystem#

Model.scalemarkwithsystem(collection, scale_x, scale_y, scale_z, system_entity, origin)#

Scales a selection of entities by multiplying the coordinates.

Parameters:
  • collection (Collection) – The collection containing the entities to translate.

  • scale_x (double) – The multiplication factor for the x-axis of the system.

  • scale_y (double) – The multiplication factor for the y-axis of the system. Only used in rectangular coordinate systems.

  • scale_z (double) – The multiplication factor for the z-axis of the system. Not used in spherical coordinate systems.

  • system_entity (Entity) – The object describing the entity which the scaling is in relation to. Note that the type of system affects the scaling. For example, specifying scale_x in a cylindrical or spherical coordinate system scales the mark radially out from the origin. For scaling of rigid walls in the rigid wall local system, specify as 0.

  • origin (Entity) – If zero, the scaling is based at the origin of the system. Otherwise, it specifies a node ID whose coordinates define the base point of the scaling. For scaling of rigid walls in the rigid wall local system, specify as 0.

Examples#

Scale nodes with IDs 1 - 8 5.0 units in the x - direction of the system with ID 13 and node with ID 20 as the origin#
import hm
import hm.entities as ent

model = hm.Model()

# Creating a collection that contains the nodes to scale
filter_nodes = hm.FilterByEnumeration(ent.Node, list(range(1, 9)))
nodes_collection = hm.Collection(model, filter_nodes)

model.scalemarkwithsystem(
collection=nodes_collection,
scale_x=5.0,
scale_y=1.0,
scale_z=1.0,
system_entity=ent.System(model, 13),
origin=ent.Node(model, 20),
)
Scale the rigid wall “ rwcyl “ relative to the rigid wall local system#
import hm
import hm.entities as ent

model = hm.Model()


# Creating a collection that contains all all the rigid walls
groups = hm.Collection(model, ent.Group, "name=rwcyl")

model.scalemarkwithsystem(
collection=groups,
scale_x=3.0,
scale_y=1.0,
scale_z=1.0,
system_entity=None,
origin=None,
)