[Paraview] ParaView and Python: Position of a slice and pressing the "Rescale to Data Range"-Button

pat marion pat.marion at kitware.com
Wed Mar 3 11:16:31 EST 2010


I think you are trying to set the origin of the slice plane from python?  It
would be sliceFilter.SliceType.Origin = [0, 0, 0].

Try entering these lines in the python console for a demo:

Sphere()
s = Slice()
Show()

for i in range(100):

s.SliceType.Origin=[-0.5 + i*0.01, 0,0]

Render()


Note that when you set the Origin property from python it is automatically
applied, you don't need to click the apply button, but the screen does not
automatically render, so you need to call Render().

Pat

On Wed, Mar 3, 2010 at 10:17 AM, Utkarsh Ayachit <
utkarsh.ayachit at kitware.com> wrote:

> > Is there an option to automatically render a slice when it is moved? I
> basically don't want to press the Apply-button whenever the slice is moved.
> If this isn't possible, how do i "press" the Apply-button with python?
>
> Yes, go to Edit | Settings. There's a check box for "Auto Accept" on
> the "General" page -- check that. ParaView then auto-apply.
>
> > I could read the Origin-values from the Properties field of the Object
> Inspector and set the Origin-values from the Display field to this values.
> But how do I get this Origin-values (I only found the ones from the Display
> field in python).
>
> I am not sure I understand what you are trying to do here.
>
> > I also need to press the "Rescale to Data Range" button when the slice is
> moved. Is this even possible? If so, how?
>
> Not currently. However, you can always write up a python script that
> achieves the same effect. Let me know if you need help with that.
>
> Utkarsh
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100303/51250218/attachment.htm>


More information about the ParaView mailing list