GRAPHISOFT®

Python APIVersion: 0.23 Beta

UndoScope

Represents an undoable scope.

class UndoScope

 

Members

The structure does not have any members.

 

Methods

__enter__
__exit__

 

Remarks

This class encapsulates a (series of) undoable steps. Those database modifier commands which were defined inside will be executed only when exiting from the scope.
By using an undoable scope for creating/modifying multiple objects better performance can be achieved.

Nested undoable scopes are not allowed.

 

Example

wallFavoriteList = GetFavorites(API_WallID)

if len(wallFavoriteList) == 0:
    sys.exit("There isn't any wall favorite!")

walls = GetElementList(API_WallID)
lastWallFavorite = wallFavoriteList[-1]

with UndoScope ("Apply Favorite"):
    for w in walls:
        ApplyFavorite(lastWallFavorite, w)

 

Requirements

Version: Python API 0.2 or Later
Module: GS

 

See Also

All types