[Paraview] How to extract one face from an hexa in python ?

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Sep 8 15:51:44 EDT 2015


Selection extraction isn't supported yet (well not gracefully anyways)
through the Python API. However, you can use the following for similar
effect:

OpenDataFIle(...)
ExtractSurface()
GenerateIds()

threshold1 = Threshold()
threshold1.Scalars = ['CELLS', 'Ids']
threshold1.ThresholdRange = [4.5, 5.5] # to extract cell with Id 5.





On Tue, Sep 8, 2015 at 11:22 AM, houssen <houssen at ipgp.fr> wrote:

> No idea ? No known python example / code snippet ?
>
> Franck
>
>
> Le 2015-09-07 9:42, houssen a écrit :
>
>> How to extract one face from an hexa in python ?
>>
>> I have an hexa read from an xmd file. In the ParaView GUI, I use the
>> ExtractSurface filter to get the skin of it. Then I select one face.
>> Then I use the ExtractSelection filter : I get the face extracted as I
>> need (without error message).
>>
>> OK, now I need to do that with python scripting : if somebody has the
>> corresponding code snippet I'd appreciate to get it (filter creation
>> is OK. What I don't know is how to select a face from the hexa surface
>> in python). I activated "tools / start trace (+ general option : all
>> properties)" to get an idea of the python code. When I create the
>> ExtractSurface filter, I get :
>> Traceback (most recent call last):
>>   File
>>
>>
>> "/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/site-packages/paraview/smtrace.py",
>> line 1212, in _create_trace_item_internal
>>   File
>>
>>
>> "/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/site-packages/paraview/smtrace.py",
>> line 881, in __init__
>>   File
>>
>>
>> "/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/site-packages/paraview/smtrace.py",
>> line 162, in get_accessor
>>   File
>>
>>
>> "/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/site-packages/paraview/smtrace.py",
>> line 183, in create_accessor
>>   File
>>
>>
>> "/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/site-packages/paraview/simple.py",
>> line 680, in GetActiveSource
>>   File
>>
>>
>> "/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/site-packages/paraview/simple.py",
>> line 1690, in get_source
>>   File
>>
>>
>> "/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/site-packages/paraview/simple.py",
>> line 1684, in __convert_proxy
>>     servermanager._getPyProxy(px.GetSourceProxy()),
>> AttributeError: GetSourceProxy
>> Then, I select a face and I create an ExtractSelection filter, I get
>> another error and ParaView crashes :
>> Traceback (most recent call last):
>>   File
>>
>>
>> "/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/site-packages/paraview/smtrace.py",
>> line 1212, in _create_trace_item_internal
>>   File
>>
>>
>> "/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/site-packages/paraview/smtrace.py",
>> line 1063, in __init__
>>   File
>>
>>
>> "/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/site-packages/paraview/servermanager.py",
>> line 2418, in _getPyProxy
>>     xmlName = smproxy.GetXMLName()
>> AttributeError: GetXMLName
>> *** Error in
>>
>>
>> `/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/paraview':
>> free(): invalid pointer: 0x00007efcddf97240 ***
>> Abandon (core dumped)
>>
>> This crash is maybe related to the ParaView build ? I run
>> Ubuntu-14.04, ParaView-4.3.1 has been built from source without any
>> specific / triky option (or some basic options like cmake
>> -DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON
>> -DModule_vtkIOXdmf3:BOOL=ON) : do I have to turn on some option(s) at
>> build time to avoid the crash ? I attached the CMakeCache file.
>>
>> Franck
>>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150908/0ddafb42/attachment.html>


More information about the ParaView mailing list