Model.hm_plotshape_byentity#

Model.hm_plotshape_byentity(id, shape, height=1.0, L1=1.0, L2=1.0, L3=1.0, r1=3.0, r2=3.0, r3=3.0, color=1, drawmode=1, transparency=0.0, system=0)#

Creates a graphical shape.

Parameters:
  • id (Entity) – The entity object to create the shape on.

  • shape (hwString) – The shape to create. Valid values are box, cone, cylinder, ellipsoid, frustum and sphere.

  • height (double) – The height for shape set to cone, cylinder, or frustum.

  • L1 (double) – The x-component for shape="box".

  • L2 (double) – The y-component for shape="box".

  • L3 (double) – The z-component for shape="box".

  • r1 (double) – The radius for shape set to cone, cylinder, or sphere. The x-component for shape="ellipsoid". The top radius for shape="frustum".

  • r2 (double) – The y-component for shape="ellipsoid". The bottom radius for shape="frustum".

  • r3 (double) – The z-component for shape="ellipsoid".

  • color (int) – The color to use for the shape. Valid values are 1-64.

  • drawmode (int) –

    The draw mode.

    0 - Wireframe

    1 - Line with mesh

    2 - Only mesh

  • transparency (double) – The transparency of the shape. If not specified, no transparency is used.

  • system (int) – The coordinate system to which the shape must be oriented. Default is global system.

Returns:

Example#

Create a box shape with dimensions 10x15x20 on node 5#
import hm
import hm.entities as ent

model = hm.Model()

node = ent.Node(model,5)

model.hm_plotshape_byentity(node,"box",L1=10.0,L2=15.0,L3=20.0)