小编MLH*_*H13的帖子

Spotfire IronPython脚本可滚动浏览筛选器并更新每个步骤的可视化效果(日期范围内的播放按钮)

大家早上好,

我已经在这个问题上工作了几天,但找不到解决方法。我已经研究过,但没有用谷歌搜索。任何帮助/见解将不胜感激。我正在尝试创建一个按钮,当单击该按钮时,它将自动通过日期过滤器(例如从1/1/15开始),并通过1/2 -1/5,随着新过滤的标记层逐步通过,从而更新地图功能。我已使过滤器逐步通过1 / 1-1 / 5;但是,它不会随着进度的进行而更新地图可视化效果,因此用户看到的只是从1/1到1/5的跳转,中间有一个暂停(每个步骤都有一个睡眠计时器)。我已经包含了下面的代码,我只是在学习IronPython,并且不确定刷新可视化需要调用什么。Visualization.Refresh()不起作用。非常感谢!

import Spotfire.Dxp.Application.Filters as filters
import Spotfire.Dxp.Application.Filters.ItemFilter
import time
from Spotfire.Dxp.Application.Filters import FilterTypeIdentifiers
from Spotfire.Dxp.Data import DataProperty, DataType, DataPropertyAttributes, DataPropertyClass
from Spotfire.Dxp.Application.Visuals import MarkerLayer

myPanel = Document.ActivePageReference.FilterPanel
myFilter= myPanel.TableGroups[2].GetFilter("Date (Daily)")

myFilter.FilterReference.TypeId = FilterTypeIdentifiers.ItemFilter
itemFilter = myFilter.FilterReference.As[filters.ItemFilter]()

whichCol = itemFilter.DataColumnReference
count = 0
while count < 5:

    count = count +1
    if (whichCol.Properties.PropertyExists("CurrentStep") == False):
        myProp = DataProperty.CreateCustomPrototype("CurrentStep",0,DataType.Integer,DataPropertyAttributes.IsVisible|DataPropertyAttributes.IsEditable)
        Document.Data.Properties.AddProperty(DataPropertyClass.Column, myProp)
        whichCol.Properties.SetProperty("CurrentStep",0)
        Document.Properties["DateTest"] = "1/1/15" 
        time.sleep(1)

    else:
        time.sleep(1)
        whichVal = whichCol.Properties.GetProperty("CurrentStep")
        #print whichVal
        #print itemFilter.Values.Count
        if …
Run Code Online (Sandbox Code Playgroud)

ironpython spotfire

4
推荐指数
1
解决办法
5014
查看次数

标签 统计

ironpython ×1

spotfire ×1