[Paraview] Python scripting of selection / labels on contours

Deij, Menno M.Deij at marin.nl
Fri Feb 17 07:35:05 EST 2012


Dear all,

What I'm trying to achieve is to get labels on contourlines from a python script (that is, non-interactively). To get started, I followed the following advice given on the list on Sep 13, 2010:

"Try doing a slice through all the contour lines, and then selecting the points on the slice that you want to label. Then turn on the selection inspector and show point labels with the variable you want to plot. I've found the number of trailing zeros is a bit annoying, as there's no control over the number format, and I normally choose integer values for the contours. The selection labels aren't persistent so a state file will lose these labels, and you'll have to reselect them if you need another plot."

This works very well in interactive mode when the user makes the selection using the selection tool.

Now, what I want to achieve is to do this from a Python script. I have not been able to reproduce the result if I follow or interpret the output from Python trace when I perform the actions described.

So: if you have any ideas on 1) to achieve selections from python script and/or 2) to create labels on contourlines from python script, I'd be very much obliged.

All the best,


Menno


dr. ir. Menno A. Deij
Software Engineer
Maritime Simulation Group
E mailto:M.Deij at marin.nl
T +31 317 49 35 06

MARIN
2, Haagsteeg, P.O. Box 28, 6700 AA Wageningen, The Netherlands
T +31 317 49 39 11, F , I www.marin.nl



More information about the ParaView mailing list