ApplyFavorite
Applies the given favorite to the specified element.
def ApplyFavorite (favoriteName, elemGuid) -> String
Parameters
- favoriteName
- [in] Name of an existing favorite.
- elemGuid
- [in] Identifier of an existing element instance.
Return Values
This function returns the GUID of the modified element.
Remarks
This function is a wrapper of the following C++ API functions:
- ACAPI_Favorite_Get
- ACAPI_Element_ChangeParameters
- ACAPI_Element_AddClassificationItem
- ACAPI_Element_SetCategoryValue
- ACAPI_Element_SetProperties
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