Jump to content
  • 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®.


    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

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...