<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1"><font face="Droid Serif">Hi.<br>
<br>
I have a ParaView macro which sets up a CSVReader, and a
PlotData of that. The variable names and legend names and
series colors are all filled in automatically by ParaView.<br>
<br>
What I would like to do is, from the python macro, iterate
through all series in a chart and make specific ones visible or
invisible. Recording a python trace of this gives:<br>
<br>
</font></font>
<style type="text/css">p, li { white-space: pre-wrap; }</style>
<p style="margin: 0px; text-indent: 0px;"> try: paraview.simple</p>
<p style="margin: 0px; text-indent: 0px;"> except: from
paraview.simple import *</p>
<p style="margin: 0px; text-indent: 0px;">
paraview.simple._DisableFirstRenderCameraReset()</p>
<p style="margin: 0px; text-indent: 0px;"> PlotData1 =
GetActiveSource()</p>
<p style="margin: 0px; text-indent: 0px;"> my_representation0 =
GetDisplayProperties(PlotData1)</p>
<p style="margin: 0px; text-indent: 0px;">
my_representation0.SeriesColor = ['A(0,0)', '0', '1', '0']</p>
<p style="margin: 0px; text-indent: 0px;">
my_representation0.SeriesVisibility = ['A(0,0)', '0']</p>
<p style="margin: 0px; text-indent: 0px;"> Render()</p>
<br>
<font size="+1"><font face="Droid Serif">When I go the python shell
after doing this, and I do this:<br>
<br>
p = FindSource("PlotData1")<br>
d = GetDisplayProperties(p)<br>
print d.SeriesVisibility<br>
<br>
it gives me<br>
<br>
['A(0,0)', '0']<br>
<br>
but doesn't say anything about the other series ('A(0,1)' ...
'A(5,5)).<br>
<br>
How do I get at the names of the other series? <br>
<br>
If I had them, how would I use them? Like the following?<br>
<br>
Thanks.<br>
<br>
Greg<br>
<br>
new_visibility = []<br>
For i in xrange(len(series_names)):<br>
new_visibility.append(series_names[i])<br>
if series_names[i] == 'A(1,3)': # for example<br>
new_visibility.append('1')<br>
else:<br>
new_visibility.append('0')<br>
<br>
d.SeriesVisibility = new_visibility<br>
<br>
Render()<br>
<br>
</font></font>
</body>
</html>