[Smtk-developers] Help

David Thompson david.thompson at kitware.com
Fri Jun 26 16:37:20 EDT 2015


Hi Indu,

> Tide and wind and the tabular entries in my form.  There will be no fixed number of entries for tide and wind, they can vary according to the situation. In this test example I sent you, I  only have  one each for tide (Tide-0) and wind (Wind-0). 
> I need to know,
> 1. How many of tide entries are there
> 2. How many wind entries are there.

tideAtts = asys.findAttributes('Tide')
windAtts = asys.findAttributes('Wind')
print len(tideAtts)
print len(windAtts)

You can then run "for tideAtt in tideAtts:" to process each tide or wind attribute in the returned list.

> 3. Then access the items(Gage Station,{Station,Agency,Station ID}) and its values (Gage Station,{station,0,1234})  of each tide and wind entries. 

Access to these items is as in the previous e-mail, except that you can access items by their integer position in the attribute:

smtk.attribute.to_concrete(smtk.attribute.to_concrete(tideAtts[0].item(0)).item(0)).name()
smtk.attribute.to_concrete(smtk.attribute.to_concrete(tideAtts[0].item(0)).item(0)).value(0)

	David


More information about the Smtk-developers mailing list