Thanks to everyone that helped me figure out how to delete registered objects from paraview. The below code is an example on how to properly delete items from paraview with the python interface. Hopefully this helps somebody else out, since the current servermanager pdf skipped this problem.
<br><br><br><br><br><br>pxm = servermanager.ProxyManager()<br>view = servermanager.GetRenderView()<br><br>object = servermanager.SphereSource(registrationGroup='sources', registrationName='sphere') #create and register the sphere
<br>display = paraview.servermanager.CreateRepresentation(object, view, registrationGroup='representations') #register the display of the sphere<br><br>pxm.UnRegisterProxy('sources', 'sphere', object) #delete the source reference to the sphere
<br>pxm.UnRegisterProxy('representations', 'sphere', object) #delete the representation ref of the sphere (do not pass the display object to this, it will cause paraview to crash on the next manual source creation)
<br> <br><br>rep = self.view.Representations #save some typing<br>size = range(len(rep)) #need to keep track of the length since .index() is not aviable<br><br>#need to delete the view representation copy, or else the sphere will stay on the render window
<br>for item, index in zip(rep,size):<br> if (self.display == item):<br> del rep[index]<br><br>del object<br>del display <br><br><br><div><span class="gmail_quote">On 10/23/07, <b class="gmail_sendername">Milan Frank
</b> <<a href="mailto:milan.frank@gmail.com">milan.frank@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">What would happened if I create the sphere without registration name and group?
<br><br>sphere = servermanager.sources.SphereSource()<br><br>What is the correct way to dispose such object?<br><br>Thanks,<br>Milan.<br><br>On 22/10/2007, Robert Maynard <<a href="mailto:RobertJMaynard@gmail.com">RobertJMaynard@gmail.com
</a>> wrote:<br>> Where can I find the Displays property, I have been unable to find exactly<br>> where the property is.<br>><br>> On 10/15/07, Utkarsh Ayachit < <a href="mailto:utkarsh.ayachit@kitware.com">
utkarsh.ayachit@kitware.com</a>> wrote:<br>> > Don't forget to unregister the dataDisplay as well, and remove the it<br>> > from the view's "Displays" property, otherwise the sphere isn't going
<br>> > anywhere :).<br>> ><br>> > Utkarsh<br>> ><br>> ><br>> > Berk Geveci wrote:<br>> > > You have to unregister the object from the proxy manager:<br>> > ><br>> > > pm =
servermanager.ProxyManager()<br>> > > pm.UnRegisterProxy("sources", "del")<br>> > ><br>> > > -berk<br>> > ><br>> > ><br>> > > On 10/15/07, *Robert Maynard* <
<a href="mailto:RobertJMaynard@gmail.com">RobertJMaynard@gmail.com</a><br>> > > <mailto:<a href="mailto:RobertJMaynard@gmail.com">RobertJMaynard@gmail.com</a>>> wrote:<br>> > ><br>> > > What is the syntax to delete an object that has been created in
<br>> > > python, and than been registered with ParaView?<br>> > ><br>> > > For example I create a sphere like this:<br>> > > view = servermanager.GetRenderView()<br>> > > sphere =
servermanager.sources.SphereSource<br>> > > (registrationGroup='sources', registrationName='del')<br>> > > dataDisplay =<br>> servermanager.CreateRepresentation(sphere, view,
<br>> > > registrationGroup='representations')<br>> > ><br>> > > Than trying to delete it by using the del command (del sphere, etc)<br>> > > does not work.<br>> > >
<br>> > > _______________________________________________<br>> > > ParaView mailing list<br>> > > <a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a> <mailto:<a href="mailto:ParaView@paraview.org">
ParaView@paraview.org</a>><br>> > > <a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><br>> > ><br>> > ><br>> > ><br>
> > ><br>> ------------------------------------------------------------------------<br>> > ><br>> > > _______________________________________________<br>> > > ParaView mailing list<br>
> > > <a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a><br>> > > <a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><br>> >
<br>><br>><br>> _______________________________________________<br>> ParaView mailing list<br>> <a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a><br>> <a href="http://www.paraview.org/mailman/listinfo/paraview">
http://www.paraview.org/mailman/listinfo/paraview</a><br>><br>><br></blockquote></div><br>