I am working on converting all of the VBA script evaporators from VBA to Python, and for the life of me I can not get it to work. I understand python, but there is an element to using the script elevator this that I am missing/not understanding.
This is an example of the current VBA that works
Dim val
val = 0
if(Edge.AttributeValueByName("network_participating)=0) then
val = -1
Based on this, and this, I came up with the code examples below (along with several others not listed) and nothing is working. What am I overlooking?
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">NetworkParticipating</SPAN><SPAN class="punctuation token">(</SPAN>value<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
value <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN>
<SPAN class="keyword token">if</SPAN> Edge<SPAN class="punctuation token">.</SPAN>AttributeValueByName<SPAN class="punctuation token">(</SPAN>value<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">==</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">:</SPAN>
value <SPAN class="operator token">=</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">1</SPAN>
<SPAN class="keyword token">return</SPAN> value
Value <SPAN class="operator token">=</SPAN> NetworkParticipating<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'!network_participating!'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">##Also tried:</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">NetworkParticipating</SPAN><SPAN class="punctuation token">(</SPAN>value<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
restricted <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">False</SPAN>
<SPAN class="keyword token">if</SPAN> value <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">:</SPAN>
restricted <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
<SPAN class="keyword token">return</SPAN> restricted
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>