Perfect, thanks Eric. I&#39;ve added a couple of examples from this to the wiki.<br><br clear="all">Thanks,<br><br>David<br>
<br><br><div class="gmail_quote">On Tue, May 5, 2009 at 11:15 AM, Eric E. Monson <span dir="ltr">&lt;<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">Hey David,<div><br></div><div>1.) When you create a new source, to get it to render you also need to create a &quot;Representation&quot; for it in the &quot;View&quot;. If you&#39;re running from the python shell inside the paraview gui, you need to do something like this:</div>
<div class="im"><div><br></div><div>sphere = servermanager.sources.Sphere()</div> <div>pm = servermanager.ProxyManager()</div> <div>pm.RegisterProxy(&#39;sources&#39;,&#39;mysource&#39;,sphere)</div> </div><div>view = servermanager.GetRenderView()</div>
 <div>sphereRep = servermanager.CreateRepresentation(sphere,view)</div> <div>pm.RegisterProxy(&#39;representations&#39;,&#39;mysourceRep&#39;,sphereRep)</div> <div><br></div><div>After that last step the &quot;eye&quot; should show up (and the sphere should show up in the main render view.</div>
<div><br></div><div>2.) I&#39;m not sure why the arrows don&#39;t work any more for the command history. In PV 3.4 it works for me, but not in CVS. It&#39;s very irritating...</div><div><br></div><div>3.) It&#39;s the Representation Proxy that contains things like visibility, not the source proxy itself. dir(sphereRep) will show you the options.</div>
<div><br></div><div>sphereRep.Visibility = 0</div><div><br></div><div>To iterate through all the representations you can do something like this:</div><div><br></div><div>for k, v in pm.GetProxiesInGroup(&#39;representations&#39;).iteritems():</div>
<div>    v.Visibility = 0</div><div><br></div><div>Hope this helps,</div><div>-Eric</div><div><br></div><div><div> <span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="">
<div>------------------------------------------------------</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><br></div></div></span> </div><br><div><div><div></div><div class="h5"><div>On May 2, 2009, at 5:01 PM, David Doria wrote:</div>
<br></div></div><blockquote type="cite"><div><div></div><div class="h5">1) Adding a view after adding a source with python<br>I have the following script which adds a sphere to the pipeline browser<br><br>#!/usr/bin/pvpython<br>
#must be run from inside paraview!<br><br>from paraview import servermanager<br> <br>sphere = servermanager.sources.Sphere()<br>pm=servermanager.ProxyManager()<br>pm.RegisterProxy(&quot;sources&quot;,&quot;mysource&quot;,sphere)<br>
<br>This adds &quot;mysource&quot; to the pipeline browser. According to the wiki, it sounds like the default visibility should be off, but you should just be able to click the &quot;eye&quot; next to it to actually display the object. However, I am not seeing an eye at all, not even a disabled one. (<a href="http://rpi.edu/%7Edoriad/NoEye.jpg" target="_blank">http://rpi.edu/~doriad/NoEye.jpg</a>)<br>
 <br>2) The command history (ie. pressing the up arrow to get to previous commands) does not seem to work in the python shell inside paraview. Can it be enabled?<br><br>3) I can access all of the open sources with this: <div style="margin: 0px; text-indent: 0px;">
<span style="font-family: &#39;Courier&#39;; font-size: 10pt; color: rgb(0, 0, 0);">p=pm.GetProxiesInGroup(&quot;sources&quot;).items()</span></div>then get a single source with <br> a=p[0] #up to p[len(p)-1]<br><br>When I dir(a), there are no properties (such as visibility) listed. How do you change that type of property? (the idea would be to something such as iterate through all of the open items one at a time and save screen shots).<br>
 <br>Any help would be great!<br><br clear="all">Thanks,<br><br>David<br></div></div> _______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br></blockquote></div><br></div></div></blockquote>
</div><br>