Jump to content
  • How to execute a custom tool from an IronPython script in Spotfire®


    This article describes how to execute a custom tool from an IronPython script.

    Introduction

    This article describes how to execute a custom tool from an IronPython script.

    All registered tools are accessible using Application.Toolbox.TryGetTool(). You can then launch the tool using its Execute() method.

    Code sample

     # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
     
     import clr
     clr.AddReference("SpotfireDeveloper.CustomToolsExample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4d95002c27fab778")  
     
     import Spotfire.Dxp.Application
     from SpotfireDeveloper.CustomToolsExample import PageTool
     
     found, tool = Application.Toolbox.TryGetTool[PageTool]()
     
     if found:
         tool.Execute(Document.ActivePageReference)
     

    You can find the version and public key token numbers in the module.xml file of the appropriate extension.

    Note

    Spotfire built-in tools cannot be executed via the API.

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...