[Paraview] Help with Clip filter Annotation
Guðni Karl Rosenkjær
grosenkj at eos.ubc.ca
Thu Feb 28 15:14:15 EST 2013
Hello all,
I am making a Annotation for Clip filter that shows the current location. I
have been trying to use the new PythonAnnotation filter but I am not able
to access the Origin and Offset properties from the input to the filters
Expression. This is the Expression I tried: 'At %.0f Northing' %
input.ClipType.Offset+input.ClipType.Origin[1]
In order to get around this, I have made this small python script.
> from paraview.simple import *
>
> # Get the active source
> actSource = GetActiveSource()
>
> # Add the filter
> anno = PythonAnnotation(actSource)
> # Calculate the Northing, offset + origin
> north = anno.Input[0].ClipType.Offset + anno.Input[0].ClipType.Origin[1]
>
> # Set the anno expression
> exprStr = "'At %.0f Northing' % {0:.0f} ".format(north)
> anno.Expression = exprStr
> Show(anno)
> Render()
This works initially, but I am not able to figure out how to get filter to
"update" when the properties of the Clip filter are changed.
All suggestions and help are highly appreciated.
Thanks
Gudni Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130228/a840b4b0/attachment.htm>
More information about the ParaView
mailing list