Goal: Retrieve and suppress the bodies contained in a named selection.
Code:
ns = Model.NamedSelections.Children[0] # selected a named selection containing bodies
bodyIds = ns.Location.Ids
with Transaction():
for bodyId in bodyIds:
geoBody = DataModel.GeoData.GeoEntityById(bodyId)
body = Model.Geometry.GetBody(geoBody)
body.Suppressed = True
print "Done with Macro"