PyTuflow: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 114:
|''str'' Name
|-
|rowspan='1'|<b>[[#nodeCount|nodeCount]] ()</b>
|rowspan='1'|Returns the total number of nodes in the results
|''int'' Count
Line 1,060:
# print to console
print('Results from {0} loaded successfully.format(name))
else:
# did not load correctly, print error message to console
print(message)
</pre>
 
==nodeCount==
<b>nodeCount ()</b><br>
Returns the total number of nodes in the results<br>
;Parameters:
: -
;Returns:
: '''Count:''' ''int''
:: Number of nodes
'''Example'''<br>
<pre>
import pytuflow as tu
 
# Initialise result class
res = tu.ResData()
 
# load .tpc result file
path = r'C:\TUFLOW\results\M04_5m_001.tpc'
err, message = res.load(path)
 
# check results were loaded successfully before calling function
if not err:
node_count = res.nodeCount()
# print to console
print('{0} nodes in results.format(node_count))
else:
# did not load correctly, print error message to console