A simple Python example within ParaView
You can copy commands from elsewhere and paste them into the Python Shell.
Python is case sensitive. Be sure to use correct capitalization as shown below.
Python is indent sensitive. Be sure to not indent, as shown below.
Lets create and display a sphere.
(Type the following into the Python Shell)
We have now created a sphere in the pipeline, turned on it's visibility, and re-rendered.
Next, lets add a shrink filter. We hide the sphere, add the shrink filter, and re-render.
ParaView will allow us to use either the GUI controls or Python. For instance:
Select the Sphere in the pipeline browser.
In the Python Shell, type the following:
Or, we could continue in the Python as follows:
Hide the Plane widget:
Help! (How do we find out what commands are available?)
To see all commands available in ParaView:
To see all of the options for the Clip creator:
To see all of the options for the instance of the clip we created above:
A better tool to see the available commands for an item in the pipeline is ListProperties, such as:
Note that this doesn't work on instantiated controls, such as the camera. Use dir() for controls such as camera.
And, to see the different properties of the ClipType variable, use
To see lots of detail on an instance of a command, create the instance and ask for help on that instance..
Change! (Lets look at, and change, something)
Print the Theta Resolution
Change it to 64
Lets change the selected filter in the Pipeline Browser:
Lets delete the clip
Lets add a filter to the sphere, without selecting it first