[Paraview-developers] Changing Display properties using python
Hallock, Kevin
Kevin.Hallock at pfizer.com
Mon May 2 16:33:10 EDT 2016
Thanks!
Kevin
On 5/2/16, 1:48 PM, "Utkarsh Ayachit" <utkarsh.ayachit at kitware.com> wrote:
>The property is called "Position". This highlights a bug in the code
>where the label is not being used as the name for the property in
>Python. I've reported a bug:
>http://www.paraview.org/Bug/view.php?id=16108
>
>Utkarsh
>
>On Mon, May 2, 2016 at 1:04 PM, Hallock, Kevin <Kevin.Hallock at pfizer.com>
>wrote:
>> Hi everyone,
>>
>> I am writing a simple script to create 3D text at a specified location,
>>but
>> I am having trouble figuring out how to apply a translation to it.
>>Here is
>> my brief code:
>>
>> from paraview import vtk
>> string = "Python"
>> text = paraview.simple.a3DText(Text=string)
>> paraview.simple.SetDisplayProperties(Opacity=1)
>> paraview.simple.Show()
>>
>> Opacity works, but when I use
>>
>> from paraview import vtk
>> string = "Python"
>> text = paraview.simple.a3DText(Text=string)
>> paraview.simple.SetDisplayProperties(Opacity=1, Translation=[1,1,1])
>> paraview.simple.Show()
>>
>>
>> I receive the following error:
>>
>> Traceback (most recent call last):
>>
>> File "<string>", line 4, in <module>
>>
>> File "/Applications/paraview.app/Contents/Python/paraview/simple.py",
>>line
>> 429, in SetDisplayProperties
>>
>> SetProperties(rep, **params)
>>
>> File "/Applications/paraview.app/Contents/Python/paraview/simple.py",
>>line
>> 480, in SetProperties
>>
>> raise AttributeError("object has no property %s" % param)
>>
>> AttributeError: object has no property Translation
>>
>>
>> There is some property that allows it to be translated, but I do not
>>know
>> the correct name. Is there a good resource for finding the names of the
>> individual properties so they can be changed in a script?
>>
>> Thanks,
>>
>> Kevin
>>
>> --
>> Kevin Hallock
>> Visualization and Modeling, Quantitative Medicine
>> Neuroscience and Pain Research Unit
>> Worldwide Research and Development
>> Pfizer Inc
>> 610 Main Street
>> Cambridge, MA 02139
>> Email: kevin.hallock at pfizer.com
>> Fax: 845-474-4001
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Search the list archives at:
>> http://markmail.org/search/?q=Paraview-developers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/paraview-developers
>>
More information about the Paraview-developers
mailing list