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

2015-09-08 Thread Utkarsh Ayachit
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  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: 0x7efcddf97240 ***
>> 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
>
___
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


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

2015-09-08 Thread houssen

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: 0x7efcddf97240 ***
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