Jump to content
We've recently updated our Privacy Statement, available here. ×
  • How to Remove Unreferenced Markings in an Analysis in Spotfire® Using IronPython Scripting


    Introduction

    Below is a sample script on removing Markings in a analysis which are not referenced by any visualizations

    Code Sample

    from Spotfire.Dxp.Application.Visuals import *
    
    listofMarkings=set()
    
    for page in Document.Pages:
    	for vis in page.Visuals:
    		if str(vis.TypeId) != "TypeIdentifier:Spotfire.HtmlTextArea":
    			visData= vis.As[VisualContent]().Data
    			if visData.MarkingReference:
    				listofMarkings.add(visData.MarkingReference.Name)
    				if visData.Filterings.Count!=0:
    					for i in visData.Filterings:
    						listofMarkings.add(i.Name)
    
    for i in Document.Data.Markings:
    	name=i.Name
    	if name not in listofMarkings:
    		Document.Data.Markings.Remove(i)
     

    References

     

    License:  TIBCO BSD-Style License

    Back to IronPython Scripting in Spotfire Examples:  https://community.spotfire.com/s/article/IronPython-Scripting-in-Spotfire

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...