The Bulk Updater is a useful Scripting API utility to efficiently execute one action over a collection of entities, such as Zone, Panel, Beam, DesignLoad, and PlateElement entities. While the same result can be achieved using a for loop, the Bulk Update class is often significantly more efficient for large collections of entities.
To use a Bulk Updater, define a function that accepts one entity as the parameter and performs actions on that entity. Obtain a Bulk Updater using the collection class for the entity of interest (e.g. ZoneCol.GetBulkUpdater() to update Zone entities). Finally, call the Update() method on the Bulk Updater with the function as the parameter.
Tip
All available Bulk Updater classes are listed in the Scripting API documentation.
# Define a function that will modify each Zone in the bulk operation
def zero_fea_curvature_and_set_thermal_help(zone) -> None:
zone.IsZeroOutCurvature = True
zone.ThermalHelp = 0
# Obtain a Bulk Updater
zones = project.Zones
zone_bulk_updater = zones.GetBulkUpdater()
# Update all Zones in bulk
zone_bulk_updater.Update(zero_fea_curvature_and_set_thermal_help)
# Equivalent (but slower) functionality
for zone in zones:
zero_fea_curvature_and_set_thermal_help(zone)