[Paraview] [EXTERNAL] Re: Selecting a point in Python

Cory Quammen cory.quammen at kitware.com
Fri Dec 18 14:19:34 EST 2015


Alan,

Scrap what I said earlier. There is a simpler way.

For selecting a point by ID, try:

query = 'id == 1234'
can = GetActiveSource()
s = SelectPoints(query)
plotSelectionOverTime = PlotSelectionOverTime(Input=can, Selection=s)
view = CreateView('QuartileChartView')
Show(plotSelectionOverTime, view)

For selecting a point with the maximum value, change the query variable to:

query = 'DISPL[0] == max(DISPL[0])'

Thanks,
Cory

On Fri, Dec 18, 2015 at 12:57 PM, Scott, W Alan <wascott at sandia.gov> wrote:

> Excellent!  Thanks.
>
>
>
> One more question – is it possible to select the cell or point with a
> maximum value, as opposed to a hard coded cell or point?
>
>
>
> Alan
>
>
>
> *From:* Cory Quammen [mailto:cory.quammen at kitware.com]
> *Sent:* Friday, December 18, 2015 8:02 AM
> *To:* Scott, W Alan
> *Cc:* paraview at paraview.org
> *Subject:* [EXTERNAL] Re: [Paraview] Selecting a point in Python
>
>
>
> HI Alan,
>
>
>
> Selections are indeed possible in Python, though as you have found they
> are not recorded in traces.
>
>
>
> You should be able to do something like this to select one or more points:
>
>
>
> can = GetActiveSource()
>
>
>
> # Extract the desired block first
>
> extractBlock = ExtractBlock(Input=can)
>
> extractBlock.BlockIndices = [2]
>
>
>
> # Now extract point 1764
>
> pointID = 1764
>
> pointIDs = [0, pointID] # process number, point ID
>
> selection = paraview.simple.IDSelectionSource(ContainingCells=0, FieldType
> = "POINT", IDs = pointIDs)
>
> plotSelectionOverTime1 = PlotSelectionOverTime(Input=can,
>     Selection=selection)
>
> qcv = CreateView('QuartileChartView')
>
> d = Show(plotSelectionOverTime1, qcv)
>
>
>
>
>
> I hope this helps,
>
> Cory
>
>
>
>
>
> On Wed, Dec 9, 2015 at 7:29 PM, Scott, W Alan <wascott at sandia.gov> wrote:
>
> I am trying to create a python script that will create a plot selection
> over time.  Here is what I am trying to do:
>
> ·         Read in the can.exo.  All vars on.  Apply
>
> ·         Select point on can. (This is the line that does not record in
> the Trace Recorder, and I need).
>
> ·         Plot selection over time (I can’t get here without the previous
> step).
>
>
>
> How is a selection done in Python?
>
>
>
> Thanks,
>
>
>
> Alan
>
>
>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
>
>
>
>
> --
>
> Cory Quammen
> R&D Engineer
> Kitware, Inc.
>



-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20151218/c5136ccc/attachment.html>


More information about the ParaView mailing list