Model.elementqualityswapedgenew#
- Model.elementqualityswapedgenew(element_id, edge_index)#
Switches the connectivity of the two elements that share the specified edge to the next legal configuration.
This function only functions between an
Model.elementqualitysetup()function and anModel.elementqualityshutdown()function.- Parameters:
element_id (int) – The element ID.
edge_index (int) – The index of the edge to swap, starting from 0.
Example#
Swap elements with ID 27 with edge with ID 3 , elements with ID 22 with edge with ID 0 , elements with ID 21 with edge with ID 2 and elements with ID 26 with edge with ID 1#import hm import hm.entities as ent model = hm.Model() collection = hm.Collection(model, ent.Element, populate=True) model.elementqualitysetup(collection=collection) model.elementqualityswapedgenew(element_id=27, edge_index=3) model.elementqualityswapedgenew(element_id=22, edge_index=0) model.elementqualityswapedgenew(element_id=21, edge_index=2) model.elementqualityswapedgenew(element_id=26, edge_index=1) model.elementqualityshutdown(dontsaveflag=1)