Model.barelementupdatewithoffsets#
- Model.barelementupdatewithoffsets(collection, update_vector, vector_option, vector, update_pins, pin_flags_a, pin_flags_b, update_property, property_name, update_orientation, orientation_node, y_dir, update_offset_a, offset_system_a, offset_x_a, offset_y_a, offset_z_a, update_offset_b, offset_system_b, offset_x_b, offset_y_b, offset_z_b)#
Updates the vector, pin flags, property, direction node and offset for multiple bar and/orbar3 elements.
- Parameters:
collection (Collection) – The collection containing the the bar and/or bar3 element entities to update.
update_vector (int) – If non-zero,
vectoris used to update the local y-axis.vector_option (int) –
0 - Vector is defined by using global coordinate system.
1 - Vector is defined by using local coordinate system.
2 - Vector will be calculated by aligning element y-axis parallel to global XY plane.
3 - Vector will be calculated by aligning element y-xis parallel to global YZ plane.
4 - Vector will be calculated by aligning element y-axis parallel to global ZX plane.
5 - Vector will be calculated by aligning element z-axis parallel to global XY plane.
6 - Vector will be calculated by aligning element z-axis parallel to global YZ plane.
7 - Vector will be calculated by aligning element z-axis parallel to global ZX plane.
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_aandpin_flags_bare 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_nameis used to update the property.property_name (hwString) – The name of the property collector assigned to the bar.
update_orientation (int) – If non-zero, the direction node will be updated.
orientation_node (int) – The orientation node ID.
y_dirspecifies whether this node defines the local y- or local z-axis.y_dir (int) – If set to 1, then orientation_node defines the local y-axis of the bar. Otherwise,
orientation_nodedefines the local z-axis.update_offset_a (int) – If non-zero, the offsets at end a are updated.
offset_system_a (int) –
The system used to define the offsets at end a. Valid values are:
0 - Offsets given in global coordinate system.
1 - Offsets given in local coordinate system of node1.
2 - Offsets given in elemental coordinate system.
offset_x_a (double) – The offset in the x-direction at end a.
offset_y_a (double) – The offset in the y-direction at end a.
offset_z_a (double) – The offset in the z-direction at end a.
update_offset_b (int) – If non-zero, the offsets at end b are updated.
offset_system_b (int) –
The system used to define the offsets at end b. Valid values are:
0 - Offsets given in global coordinate system.
1 - Offsets given in local coordinate system of node1.
2 - Offsets given in elemental coordinate system.
offset_x_b (double) – The offset in the x-direction at end b.
offset_y_b (double) – The offset in the y-direction at end b.
offset_z_b (double) – The offset in the z-direction at end b.
Examples#
Update the elements on collection with y-axis defined by vector (0.0, 1.0, and 0.0)#import hm import hm.entities as ent model = hm.Model() elems = hm.Collection(model, ent.Element, [101, 102, 103]) model.barelementupdatewithoffsets( collection=elems, update_vector=1, vector_option=0, vector=(1, 0, 0), update_pins=0, pin_flags_a=None, pin_flags_b=None, update_property=0, property_name="", update_orientation=0, orientation_node=0, y_dir=0, update_offset_a=0, offset_system_a=0, offset_x_a=0.0, offset=0.0, y_a=0.0, offset_z_a=0, update_offset_b=0, offset_system_b=0.0, offset_x_b=0.0, offset_y_b=0.0 )
Update the elements on collection with y-axis oriented in global XY plane#import hm import hm.entities as ent model = hm.Model() elems = hm.Collection(model, ent.Element, [101, 102, 103]) model.barelementupdatewithoffsets( collection=elems, update_vector=1, vector_option=2, vector=(1, 0, 0), update_pins=0, pin_flags_a=None, pin_flags_b=None, update_property=0, property_name="", update_orientation=0, orientation_node=0, y_dir=0, update_offset_a=0, offset_system_a=0, offset_x_a=0.0, offset=0.0, y_a=0.0, offset_z_a=0, update_offset_b=0, offset_system_b=0.0, offset_x_b=0.0, offset_y_b=0.0 )
Update the elements on collection with orientation node 3 in y-direction#import hm import hm.entities as ent model = hm.Model() elems = hm.Collection(model, ent.Element, [101, 102, 103]) model.barelementupdatewithoffsets( collection=elems, update_vector=0, vector_option=0, vector=(1, 0, 0), update_pins=0, pin_flags_a=None, pin_flags_b=None, update_property=0, property_name="", update_orientation=1, orientation_node=3, y_dir=0, update_offset_a=0, offset_system_a=0, offset_x_a=0.0, offset=0.0, y_a=0.0, offset_z_a=0, update_offset_b=0, offset_system_b=0.0, offset_x_b=0.0, offset_y_b=0.0 )
Update the elements on collection with offsets a defined in global system having offset vector (0.2, 0.2, and 0.2) and offsets b defined in global system having offset vector (0.3, 0.3, and 0.3)#import hm import hm.entities as ent model = hm.Model() elems = hm.Collection(model, ent.Element, [101, 102, 103]) model.barelementupdatewithoffsets( collection=elems, update_vector=0, vector_option=0, vector=(1, 0, 0), update_pins=0, pin_flags_a=None, pin_flags_b=None, update_property=0, property_name="", update_orientation=0, orientation_node=0, y_dir=0, update_offset_a=1, offset_system_a=0, offset_x_a=0.2, offset=0.0, y_a=0.2, offset_z_a=0.2, update_offset_b=1, offset_system_b=0.3, offset_x_b=0.3, offset_y_b=0.3 )