Thanks Berk, using the latest cvs I have problems:
from libvtkGraphicsPython import * ImportError: libvtkGraphicsPythonD.so.pv3.7: File not found I guess something is wrong with my installation? I am not sure about your scripting. I prefer doing it during import (modified reader) due to: * First reading mutliblockdataset and extracting blocks afterwards doubles memory requirements I think? * I still have all parts as a mutliblockdataset i think which I do not like (some filters do not run ...) Am I right about that? Regards BastiL Berk Geveci schrieb: > I had some fun doing this in Python. Here is a script that creates a > Python filter for each block and names it with the block name. To run > it, you need to select the Ensight reader and then run this script > using the Python Shell under the Tools menu. This requires cvs > ParaView unfortunately as I had to make some minor changes to make it > work. > > Another hint: remember that you can turn on/off the visibility of > multiple object by selecting them (using shift+click or control+click) > in the pipeline browser and clicking on the visibility icon (the eye) > of one of them. > > -berk > > > from paraview.simple import * > > def extract_block(source, outputType, name, di, idx): > if name: > pf = ProgrammableFilter(source, registrationName=name) > else: > pf = ProgrammableFilter(source) > pf.OutputDataSetType = outputType > pf.Script = """ > input = self.GetInputDataObject(0, 0) > self.GetOutputDataObject(0).ShallowCopy(input.GetBlock(%d))""" % idx > if outputType == 'vtkImageData' or outputType == > 'vtkStructuredGrid' or outputType == 'vtkRectilinearGrid': > pf.RequestInformationScript = """ > from paraview import util > util.SetOutputWholeExtent(self, %r)""" % list(di.GetExtent()) > Show(pf) > > source = GetActiveSource() > if not source: > raise RuntimeError, "This macro needs an active pipeline object" > source.UpdatePipeline() > cdi = source.GetDataInformation().GetCompositeDataInformation() > blocks = cdi.GetNumberOfChildren() > for i in range(blocks): > di = cdi.GetDataInformation(i) > eb = extract_block(source, di.GetDataClassName(), cdi.GetName(i), di, i) > Hide(source) > > > On Sun, Jun 21, 2009 at 6:17 AM, BastiL2001<bastil2...@yahoo.de> wrote: > >> A nice sunday to everybody, >> >> first of all I have to thank all the Paraview developers who made the tool >> what it is today. After some correspondence on the mailing list I am able to >> use the tool with our models today the way I like :-). >> >> One thing I am not so happy with at the moment is how our >> Ensight-Multiblock-Data gets imported. An import generates one >> Multiblock-Dataset with every Ensight-Zone as a block. I have lots of zones >> and need to extract them all by hand. Maybe this could be scripted. Another >> problem is I use filter that do not work with multiblock-datasets quite >> often (resampleWithDataset, AppendAttributes,...). So in my eyes most >> effektive way of importing would be: Not generate ONE Multiblock-Dataset but >> generate an individuell unstructered Dataset for each Part of the >> ensight-File and name them after the Ensight Part names - this will give you >> e.g. 80 Parts in the Tree if you have 80 Ensight parts instead of one. I >> would not have to extract blocks afterwards. This duplicates the whole >> model. Furthermore, if I need unstructed Datasets, I need to run mergeBlocks >> additionally, producing even more Parts. All of this would not be essential >> if we had such an import filter. >> However, I do not really know how to modify the filter. Maybe someone can >> comment on that. >> >> Regards BastiL >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the ParaView Wiki at: >> http://paraview.org/Wiki/ParaView >> >> Follow this link to subscribe/unsubscribe: >> http://www.paraview.org/mailman/listinfo/paraview >> >> > > _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview