Model.updatefree1delements#
- Model.updatefree1delements(input_collection, output_collection, update_weight, summary_filename)#
Updates rigidlink and RBE3 elements to remove free legs and optionally update the weights. If all legs of the rigidlink or RBE3 are free, the element is deleted.
- Parameters:
input_collection (Collection) – The collection containing the element entities (RBE3 and rigidlink) to update.
output_collection (Collection) – The collection containing the element entities that have been modified.
update_weight (int) –
Flag to determine whether to update leg weights to 1.0. Valid values are:
0 - Do not update weights.
1 - Update weights.
summary_filename (hwString) –
Log file to output, containing a summary of what was modified. If not needed, use “”. Otherwise, the full path and file name must be specified.
The output of the file is:#DELETED ELEMENTS [Total # of deleted elements] [Deleted element ID 1] [Deleted element ID 2] [...] [Deleted element ID N] UPDATED ELEMENTS [Total # of updated elements] [Updated element ID 1, # of original legs, # of final legs, weighting factor before {W1, W2, ..., WN TOTAL}, weighting factor after {W1, W2, ..., WN TOTAL}] [Updated element ID 2, # of original legs, # of final legs, weighting factor before {W1, W2, ..., WN TOTAL}, weighting factor after {W1, W2, ..., WN TOTAL}] [...] [Updated element ID N, # of original legs, # of final legs, weighting factor before {W1, W2, ..., WN TOTAL}, weighting factor after {W1, W2, ..., WN TOTAL}]
Example#
Update all displayed elements , with the affected elements go to an empty collection , without update the weights , and write the summary to C:/summary.txt#import hm import hm.entities as ent model = hm.Model() # Collection that contains all the displayed elements collection_elements_disp = hm.CollectionByDisplayed(model, ent.Element) model.updatefree1delements( input_collection=collection_elements_disp, output_collection=hm.Collection(model, ent.Element, populate=False), update_weight=0, summary_filename="C:/summary.txt", )