Model.barelement#
- Model.barelement(node1, node2, vector, orientation_node, y_dir, pin_flags_a, pin_flags_b, property_name)#
Creates a bar element.
- Parameters:
node1 (Entity) – The first node ID (end a).
node2 (Entity) – The second node ID (end b).
vector (hwTriple) – The hwTriple object defining the vector components. User can also supply a Python list of three doubles.
orientation_node (Entity) – The orientation node ID. If set to None, then
vectoris used. If non-zero, then y_dir specifies whether this node defines the local y- or local z-axis.y_dir (int) – If set to 1, then
orientation_nodedefines the local y-axis of the bar. Otherwise,orientation_nodedefines the local z-axis.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.
property_name (hwString) – The name of the property collector assigned to the bar.
Example#
Create a bar3 element between nodes with IDs 101 and 102 with its local y-axis defined by the vector (1, 0, and 0) and assigned property prop1#import hm import hm.entities as ent model = hm.Model() model.barelement( node1=ent.Node(model, 101), node2=ent.Node(model, 102), vector=(1, 0, 0), orientation_node=None, y_dir=0, pin_flags_a=None, pin_flags_b=None, property_name="prop1" )