Get a visualization reference from current page using GUID


# Different approach to get a visualization from current page
# To get a complete visualization types to use (such as TablePlot), check the 
# Spotfire.Application.Visuals Namespace 
http://stn.spotfire.com/dxp/html/N_Spotfire_Dxp_Application_Visuals.htm

from System import Guid
from Spotfire.Dxp.Application.Visuals import TablePlot

guid = Guid("2d18db91-e5ac-472d-9cf7-e7c664567d32")
cTable = Application.Document.ActivePageReference.Visuals.TryGetVisual(guid)[1].As[TablePlot]()
print cTable.Title


#To get the the visualization GUID for the previous example
for vis in Application.Document.ActivePageReference.Visuals:
  print vis.Title + '(' + str(vis.Id) + ')'

No comments: