Model.titlecreate#

Model.titlecreate(name, entity, pointindex, color, font, anchorpoint, x, y)#

Creates a title.

Parameters:
  • name (hwString) – The name of the title.

  • entity (Entity) – The object describing the entity the title should be attached to.

  • pointindex (int) – The point index.

  • color (int) – The color of the title.

  • font (int) – The font to be used to display the title.

  • anchorpoint (int) – The anchor point of the title.

  • x (double) – The x location of the anchor point (0.0 - 1.0).

  • y (double) – The y location of the anchor point (0.0 - 1.0).

Note

This function should be followed by Model.titlemodify() in order to define the title text.

Example#

Create the title Hood for “hood” part with text “Significant”#
import hm
import hm.entities as ent

model = hm.Model()

model.titlecreate(
    name="Hood",
    entity=ent.Part(model, "hood"),
    pointindex=0,
    anchorpoint=2,
    color=1,
    font=12,
    x=0.5,
    y=0.5,
)

model.titlemodify(
    titlename="Hood",
    itemname="titletext",
    string="Significant",
    value=0,
    plot=1
)