Model.shapevarupdate_xproduct#
- Model.shapevarupdate_xproduct(collection, basenode, shape_variable_a, shape_variable_b, magnitude, baseflag, directionflag)#
Updates a shape variable (vector) created from the cross product of two other shape variables.
- Parameters:
collection (Collection) – The collection containing the shape variable entities to update.
basenode (Entity) – The ID of the node where the base of the result is located after it is updated.
shape_variable_a (Entity) – The object describing the first shape variable entity in the cross product.
shape_variable_b (Entity) – The object describing the second shape variable entity in the cross product.
magnitude (double) – Magnitude of vectors.
baseflag (int) – A flag (0,1) to update the base node of the shape variable.
directionflag (int) – A flag (0,1) to update the direction and magnitude of the shape variable.
Example#
Update the shape variable (vector) with ID 8, by updating its basenode with node with ID 10 and magnitude 4.0 by using the direction that comes from the cross product of vectors with IDs 2, 3#import hm import hm.entities as ent model = hm.Model() basenode_entity = ent.Node(model, 10) vector_a = ent.Vector(model, 2) vector_b = ent.Vector(model, 3) model.shapevarupdate_xproduct( collection=hm.Collection(model, ent.Vector, [8]), basenode=basenode_entity, shape_variable_a=vector_a, shape_variable_b=vector_b, magnitude=4.0, baseflag=1, directionflag=1, )