This article explains how to read the active pages of all other views (i.e. windows) and set the last occurrence on the active view using IronPython script in Spotfire®.
Introduction
Script that allows to read the active pages of all other views (i.e. windows) and set the last occurrence on the active view (the window from where the python script was triggered).
DocumentView.ForEach will iterate over all existing views and call DocumentView.BeginUse for each view. In the callback action the view is available via the DocumentView.Current property. This is the only way to get all document views.
Code sample
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. import clr from System import Action from Spotfire.Dxp.Framework.DocumentModel import DocumentView currentView = DocumentView.Current global page page = None def readOtherView(): global page if DocumentView.Current <> currentView: page = Document.ActivePageReference DocumentView.ForEach(Document, readOtherView) if page <> None: Document.ActivePageReference = page
References
- TIBCO Spotfire API References
- API Reference: DocumentView Class
- API Reference: DocumentView. ForEach Method
- API Reference: DocumentView. Current Property
License: TIBCO BSD-Style License
Recommended Comments
There are no comments to display.