Modify the Scoping on a Group of Objects

Goal: Loop over the selected tree objects and remove the second item to which it is scoped. This example fixes a set of pretension bolt loads that were scoped to two faces of a split cylinder and needed to be scoped to only one face.

Code:

with Transaction():
    for obj in Tree.ActiveObjects:
        loc = obj.Location
        loc.Ids.RemoveAt(1)
        obj.Location = loc