Summary:
The following code samples demonstrate how to Add, Apply and Remove Bookmarks using IronPython in Spotfire:
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
#Add a new Bookmark:
from Spotfire.Dxp.Application.AnalyticItems import BookmarkManager
from Spotfire.Dxp.Application import BookmarkComponentFlags
# Get the Bookmark Manager as a service
bookmarkManager = Application.GetService(BookmarkManager)
# Create a new Bookmark:
bookmarkManager.AddNew("NewBookmark", BookmarkComponentFlags.All)
# Apply a Bookmark:
from Spotfire.Dxp.Application.AnalyticItems import BookmarkManager
bookmarkManager = Application.GetService(BookmarkManager)
# Search the BookmarkManager service for a bookamrk matching our name
bookMark = bookmarkManager.Search('name::"Reset Filters (To B)"')
if bookMark.Count == 1:
bookmarkManager.Apply(bookMark[0])
# Remove all the Bookmarks:
from Spotfire.Dxp.Application import BookmarkComponentFlags
from Spotfire.Dxp.Application.AnalyticItems import BookmarkManager
bookmarkManager = Application.Document.Context.GetService(BookmarkManager)
for b in bookmarkManager.GetBookmarks():
bookmarkManager.Remove(b);
References:
API Reference: Spotfire Analyst
API Reference: BookmarkManager Class
Comments
0 comments
Article is closed for comments.