Hi Alan,

You get the array object from the source/reader/filter's point data. for example

   w = Wavelet()
   wa = w.PointData.GetArray('RTData')

See if this example doesn't help: http://paraview.org/Wiki/ParaView/Python/Lookup_tables

Burlen

On 2/24/2014 1:29 PM, Scott, W Alan wrote:
I have a user that is trying to assign a custom color map in Python.  How is 
this done?  I tried the trace recorder, but it doesn't show this 
action/command.  Mu user's note is below:

Thanks,

Alan



Hello,

I am trying to use paraview.simple python interface to assign a custom color 
map, but I can't seem to get it to work with even the default color maps.  For 
example

AssignLookupTable("nodal_eqps", "Warm")
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Applications/paraview.app/Contents/Python/paraview/simple.py", line 
770, in AssignLookupTable
     return _GetLUTReaderInstance().GetLUT(arrayObject, LUTName, rangeOveride)
   File "/Applications/paraview.app/Contents/Python/paraview/lookuptable.py", 
line 234, in GetLUT
     range = self.__GetRange(aArray,aRangeOveride)
   File "/Applications/paraview.app/Contents/Python/paraview/lookuptable.py", 
line 301, in __GetRange
     nComps = aArray.GetNumberOfComponents()
AttributeError: 'str' object has no attribute 'GetNumberOfComponents'

I have been looking at

http://www.paraview.org/ParaView3/Doc/Nightly/www/py-doc/_modules/paraview/simple.html#AssignLookupTable

and it appears I need to pass "AssignLookupTable" an "arrayObject".  The "arrayname" called "nodal_eqps" 
works fine with "GetLookupTableForArray", but I don't know how to create an "arrayObject" from this "arrayname".

Thanks for any help you can lend.


_______________________________________________
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

Reply via email to