[Paraview] Python programmable script and XML SetInputArrayToProcess to get array name

THIBON Alfred alfred.thibon at edf.fr
Tue Apr 11 09:25:42 EDT 2017


Dear Paraviewers,

I am kind of a newby and can't figure out how to access in a custom plugin the string with the name of a scalar field from an input.

I followed informations in Pat Marion's page https://blog.kitware.com/easy-customization-of-the-paraview-python-programmable-filter-property-panel/ and add a snippet from http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Drop_down_list_with_values_from_input_arrays.

But if I managed to use variables from a DoubleVectorProperty by calling its name property from my script, I can't figure out how to access the name of my arrays in the StringVectorProperty populated with SetInputArrayToProcess command.

Maybe I am not using the right tools. My goals is to get the string name of my array to read pointdata.
Today I can access it by hardcoding the name in my programmable script :

self.array = 'CHAMP___ACCELERATION___001'
inputs[0].PointData[self.array][:,0]

I'd like to get  'CHAMP___ACCELERATION___001' from a drop down list. With the following snippet the list is populated but I can't access the string selected. That must be simple...

      <StringVectorProperty name="SelectInputScalars"
                          label="Array"
                          command="SetInputArrayToProcess"
                          number_of_elements="5"
                          element_types="0 0 0 0 2"
                          animateable="0">
        <ArrayListDomain name="array_list"
                         attribute_type="Scalars"
                         input_domain_name="inputs_array">
          <RequiredProperties>
            <Property name="Input"
                      function="Input" />
          </RequiredProperties>
        </ArrayListDomain>
        <FieldDataDomain name="field_list">
          <RequiredProperties>
            <Property name="Input"
                      function="Input" />
          </RequiredProperties>
        </FieldDataDomain>
      </StringVectorProperty>

I am not sure my message (and my English) are very clear...

Thank you very much for your incoming help !

Alfred

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170411/d742e167/attachment.html>
-------------- next part --------------



Ce message et toutes les pi?ces jointes (ci-apr?s le 'Message') sont ?tablis ? l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme ? sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.

Si vous n'?tes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez re?u ce Message par erreur, merci de le supprimer de votre syst?me, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions ?galement d'en avertir imm?diatement l'exp?diteur par retour du message.

Il est impossible de garantir que les communications par messagerie ?lectronique arrivent en temps utile, sont s?curis?es ou d?nu?es de toute erreur ou virus.
____________________________________________________

This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or virus-free.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170411/d742e167/attachment-0001.html>


More information about the ParaView mailing list