AnsweredAssumed Answered

Convert Network Dataset Evaluators from VBA to Python

Question asked by rralbritton on Aug 17, 2017
Latest reply on Aug 18, 2017 by rralbritton

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?

 

def NetworkParticipating(value):
  value = 0
  if Edge.AttributeValueByName(value)== 0:
    value = -1
  return value

Value = NetworkParticipating('!network_participating!')

##Also tried:

def NetworkParticipating(value):
  restricted = False
  if value = 0:
    restricted = True
  return restricted


Outcomes