The problem in general is- the script calls Show() and depending on the dataset, paraview creates either a "GeometryRepresentation" or a "UnstructuredGridRepresentation". The script expects one type of display to be created, but when it is executed with a different dataset (or possibly the same dataset but different blocks toggled) a different type of display is created. The different display types have different properties. The script tries to set properties on the display that do not exist and fails.<br>
<br>I think it would be worth making a bug report for this and maybe we can come up with a solution to avoid this in future versions of paraview.<br><br>Pat<br><br><div class="gmail_quote">On Wed, May 11, 2011 at 4:28 PM, Fabian Braennstroem <span dir="ltr"><<a href="mailto:f.braennstroem@gmx.de">f.braennstroem@gmx.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello Pat,<div class="im"><br>
<br>
<br>
On 05/11/2011 10:12 PM, pat marion wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Fabian,<br>
<br>
Does the answer provided in the last paragraph of this email help?<br>
<br>
<a href="http://markmail.org/message/sq7dafegnrh7exth" target="_blank">http://markmail.org/message/sq7dafegnrh7exth</a><br>
</blockquote></div>
This was obviously a similar problem, but now it is not the trace, but the state file in 3.10.1.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Could you let me know, for each .foam file, what data types the<br>
multiblock dataset contains? Are the blocks unstructured grid,<br>
polydata, other? You should be able to avoid the problem by commenting<br>
line 186 in your plot.py file, where ScalarOpacityUnitDistance is assigned.<br>
</blockquote>
<br></div>
Both .foam files are bascically the same geometry calculated with just a different equation solver... so the structure should be quite similar.<br>
Just commenting outhe the line 186 gives same error for other variables:<div class="im"><br>
<br>
[ceplx049] 01__56T_SST_1.7 > pvpython plot.py<br>
vtkPOpenFOAMReader : [ ...........]<br>
Traceback (most recent call last):<br></div>
File "plot.py", line 194, in <module><br>
DataRepresentation1.ScalarOpacityFunction = a1_p_PiecewiseFunction<div class="im"><br>
File "/home/gcae504/Desktop/ParaView-3.10.1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/servermanager.py", line 207, in __setattr__<br>
"to add this attribute.")<br></div>
AttributeError: Attribute ScalarOpacityFunction does not exist. This class does not allow addition of new attributes to avoid mistakes due to typos. Use add_attribute() if you really want to add this attribute.<div class="im">
<br>
[ceplx049] 01__56T_SST_1.7 > pvpython plot.py<br>
vtkPOpenFOAMReader : [ ...........]<br>
Traceback (most recent call last):<br></div>
File "plot.py", line 200, in <module><br>
DataRepresentation1.SelectMapper = 'Projected tetra'<div class="im"><br>
File "/home/gcae504/Desktop/ParaView-3.10.1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/servermanager.py", line 207, in __setattr__<br>
"to add this attribute.")<br></div>
AttributeError: Attribute SelectMapper does not exist. This class does not allow addition of new attributes to avoid mistakes due to typos. Use add_attribute() if you really want to add this attribute.<div class="im"><br>
[ceplx049] 01__56T_SST_1.7 ><br>
<br></div>
Thanks for your help!<br>
Fabian<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
Pat<br>
<br>
On Wed, May 11, 2011 at 3:40 PM, Fabian Braennstroem<br></div><div><div></div><div class="h5">
<<a href="mailto:f.braennstroem@gmx.de" target="_blank">f.braennstroem@gmx.de</a> <mailto:<a href="mailto:f.braennstroem@gmx.de" target="_blank">f.braennstroem@gmx.de</a>>> wrote:<br>
<br>
Hello,<br>
<br>
I am trying to adjust the filename of the python state file when<br>
using the openfoam reader.<br>
<br>
<br>
I adjusted the FileName entry to read the declared FILE:<br>
<br>
FILE="/home/gcae504/HOME/scr/ceplx049/scr2/gcae504/Dissertation/3D_Nielsen/OpenFoam/01_SAS_SSTF_URANS/01__56T_SST_1.7/.foam"<br>
<br>
<br>
<br>
a_foam = OpenFOAMReader( guiName=".foam", Decomposepolyhedra=1,<br>
CaseType='Decomposed Case', MeshRegions=['internalMesh'],<br>
Createcelltopointfiltereddata=1, Cachemesh=1, FileName=FILE,<br>
LagrangianArrays=[], CellArrays=['k', 'nut', 'omega', 'p', 'U'],<br>
LagrangianpositionsareinOF13binaryformat=0, PointArrays=[],<br>
Readzones=0, Adddimensionalunitstoarraynames=0,<br>
ListtimestepsaccordingtocontrolDict=0 )<br>
<br>
This works so fine well, but as soon as I set it to a different path<br>
like:<br>
<br>
FILE="/home/gcae504/HOME/scr/ceplx049/scr2/gcae504/Dissertation/3D_Nielsen/OpenFoam/01_SAS_SSTF_URANS/01__56T_SST_HRV0/Hrv.foam"<br>
<br>
I get this error message:<br>
<br>
<br>
[ceplx049] 01__56T_SST_1.7 > pvpython plot.py<br>
vtkPOpenFOAMReader : [ ...........]<br>
Traceback (most recent call last):<br>
File "plot.py", line 186, in <module><br>
DataRepresentation1.ScalarOpacityUnitDistance = 0.33228207747036353<br>
File<br>
"/home/gcae504/Desktop/ParaView-3.10.1-Linux-x86_64/lib/paraview-3.10/site-packages/paraview/servermanager.py",<br>
line 207, in __setattr__<br>
"to add this attribute.")<br>
AttributeError: Attribute ScalarOpacityUnitDistance does not exist.<br>
This class does not allow addition of new attributes to avoid<br>
mistakes due to typos. Use add_attribute() if you really want to add<br>
this attribute.<br>
<br>
I get the 'same' error message with a script which executes the<br>
python state file and resets the FileName (the FileName is set using<br>
sys.argv), when I do not define the complete path....<br>
<br>
Does anyone know, what I am doing wrong!?<br>
<br>
Best Regards!<br>
Fabian<br>
_______________________________________________<br></div></div>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> <<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>><div class="im"><br>
<br>
Visit other Kitware open-source projects at<br>
<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:<br>
<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>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br>