Mark Lewis 2 Posted January 13, 2023 Share Posted January 13, 2023 Hello,I want to change interactive map layer using an Iron Pyhon script in Spotfire. However the Iron Python Spotfire online reference seems to be incomplete or lacking examples.Can someone tell me how I might change the interactive layer, with a short Iron Python example?TIA Mark Link to comment Share on other sites More sharing options...
Gaia Paolini Posted January 13, 2023 Share Posted January 13, 2023 Try this script, where mymap is the map chart Visualization and layerName is the exact name of the layer you want to make interactive.from Spotfire.Dxp.Application.Visuals.Maps import * mymap = mymap.As[MapChart]()for layer in mymap.Layers: if layer.Title==layerName: mymap.InteractiveLayerReference=layerThe complete Spotfire API is here:https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/TIB_sfire-analyst_api/?topic=html/N_Spotfire_Dxp_Framework_DocumentModel.htmAnd there are several resources here:https://community.spotfire.com/s/article/IronPython-Scripting-in-TIBCO-Spotfire Link to comment Share on other sites More sharing options...
Nik Majdan Posted August 11, 2023 Share Posted August 11, 2023 While looking for an answer to my question, I came across this post. This is very similar to what I'm trying to achieve. I use this whole loop-through-layers-and-match-on-layername process a lot. My question is, is there a way to change a layer attribute without looping? If I know the name of the layer, can I set the attribute directly? Something like "mymap.Layers("layerName").IncludeInAutoZoom=True" Link to comment Share on other sites More sharing options...
Gaia Paolini Posted August 14, 2023 Share Posted August 14, 2023 I cannot see a way to point to a layer by name, I can only find it by layer number. Layers seem to be numbered from bottom to top starting at zero.So thismylayer=mymap.Layers[1]will identify the second layer from the bottom. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now