0

As I have reported here when I try to render the cone example by:

from paraview.simple import *
cone = Cone()
Show(cone)
Render()

I get a non responding window:

enter image description here

enter image description here

My version of Python is:

Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32

and I’m on Windows 10 64-bit. I would appreciate if you could help me know what is the problem and how I can solve it.

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193

1 Answers1

3

Just use the Interact() method.

from paraview.simple import *
cone = Cone()
Show(cone)
Interact()

use the q key to stop the interaction.

Mathieu Westphal
  • 2,544
  • 1
  • 19
  • 33
  • I could not reply over there because of `the maximum number of replies a new user can create on their first day` :) but thanks. this is an awesome solution. now it is completely responsive except when trying to close the window. Is there a python command to stop rendering and close the VTK window from within Python? – Foad S. Farimani Sep 07 '18 at 11:43
  • On the side note, I wonder why the `Render()` is not being replaced completely with `Interact()`? I mean when there is the later why former?! – Foad S. Farimani Sep 07 '18 at 11:43
  • 1
    yes, the command is `q` key, while the VTK window has the focus. Most people using pvpython are actually generating screenshots and do not interact at all. – Mathieu Westphal Sep 07 '18 at 12:08
  • BTW I like the [other solution](https://stackoverflow.com/a/46407769/4999991) better. – Foad S. Farimani Sep 07 '18 at 12:11
  • 1
    `q` does not close the window but only stop the interaction. Allowing you to do other stuff in the command. – Mathieu Westphal Sep 07 '18 at 12:32
  • Ok. So there is no way to close this window in a peaceful way :) I'm trying to solve my own question [here](https://stackoverflow.com/questions/52206088/using-python-scripting-to-plot-integration-of-a-variable-over-a-line-versus-time) using the [other method](https://stackoverflow.com/a/46407769/4999991) you suggested. But I have some issues. I will report it below @cory-quammen answer [here](https://stackoverflow.com/a/52214249/4999991) – Foad S. Farimani Sep 07 '18 at 12:39
  • 1
    Not that I could think of no. Sure, do not hesitate to tag me. – Mathieu Westphal Sep 07 '18 at 12:41
  • 1
    You can use `Disconnect()` to close all windows and reset pvpython – Mathieu Westphal Sep 17 '18 at 09:45