Model.createdynamicdataname#

Model.createdynamicdataname(collection, dataname, basictype=0, displayname='', defaultvalue='', visible=True, editable=True)#

Creates a dynamic data name on an entity. The entity must support dynamic data names.

Parameters:
  • collection (Collection) – The collection containing the entities containing the data name on.

  • dataname (hwString) – The name of the dataname.

  • basictype (int) –

    The basic type of the dataname.

    4 - Integer

    5 - Unsigned integer

    11 - Double

    12 - String

  • displayname (hwString) – The display name of the dataname.

  • defaultvalue (hwString) – The default value of the dataname.

  • visible (bool) –

    Defines the visibility of the dynamic data name.

    False - Off

    True - On

  • editable (bool) –

    Defines whether the dynamic data name is editable.

    False - Disabled

    True - Enabled

Example#

Create dynamic data name for “structuralproperty2” and “structuralproperty3” property entities with the name and display name “Buckling_constant”, the basic type double and the default value 0.272#
import hm
import hm.entities as ent

model = hm.Model()

model.createdynamicdataname(
    collection=hm.Collection(
        model, ent.Property, "Name=structuralproperty2 OR Name=structuralproperty3"
    ),
    dataname="Buckling_constant",
    basictype=11,
    defaultvalue="0.272",
)