[Paraview] get name of source in pipeline gui

Moreland, Kenneth kmorel at sandia.gov
Mon Jan 9 11:42:52 EST 2017


I think the only way to get the name of the active source (or any source for that matter) is to search for it in the values of the dictionary returned by GetSources(). If you look at this dictionary, it has a set of keys that are a pair consisting of the name in the pipeline browser and a unique id string (in case two items in the pipeline browser have the same name). This rather obtuse expression should return the string of the name of the active source in the pipeline browser:

list(GetSources().keys())[list(GetSources().values()).index(GetActiveSource())][0]

Maybe someone knows of another Python binding I am not familiar with, but this should at least solve your problem.

-Ken

From: ParaView [mailto:paraview-bounces at paraview.org] On Behalf Of Bob Flandard
Sent: Sunday, January 8, 2017 4:37 AM
To: paraview <paraview at paraview.org>
Subject: [EXTERNAL] [Paraview] get name of source in pipeline gui

Hi,
How to get the name of the active source in the pipeline? (the gui name)
gas=GetActiveSource()
Then what?
I've spent an hour or more on this.
Thanks, Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170109/f9992a4a/attachment.html>


More information about the ParaView mailing list