Model.barelementupdate#

Model.barelementupdate(collection, update_vector, vector, update_pins, pin_flags_a, pin_flags_b, update_property, property_name)#

Updates the vector (global system), pin flags and property for multiple bar and/or bar3 elements.

Parameters:
  • collection (Collection) – The collection containing the the bar and/or bar3 element entities to update.

  • update_vector (int) – If non-zero, vector is used to update the local y-axis.

  • vector (hwTriple) – The hwTriple object defining the vector components. User can also supply a Python list of three doubles.

  • update_pins (int) – If non-zero, pin_flags_a and pin_flags_b are used to update the pin flags.

  • pin_flags_a (hwBoolList) – The pin flags at end a. A pin flag of None passes forces in all degrees of freedom.

  • pin_flags_b (hwBoolList) – The pin flags at end b. A pin flag of None passes force in all degrees of freedom.

  • update_property (int) – If non-zero, property_name is used to update the property.

  • property_name (hwString) – The name of the property collector assigned to the bar.

Example#

Update bar elements with IDs 10 and 12 with local y-axis defined by (1.0, 0.0, 0.0) and property “crossmem”#
import hm
import hm.entities as ent

model = hm.Model()

elems = hm.Collection(model, ent.Element, [10, 12])

model.barelementupdate(
    collection=elems,
    update_vector=1,
    vector=(1, 0, 0),
    update_pins=0,
    pin_flags_a=None,
    pin_flags_b=None,
    update_property=1,
    property_name="crossmem"
)