oldfox
Alibre Super User
How can I make "Size" a global variable that I can use through the rest of the script?
************************************************************************************************
# default diameter to show
DefaultDiameter = 'None Selected'
# called when an input changes in the dialog window
def InputChanged(Index, Value):
# size changed
if Index == 0:
Size = DiameterNames[Value]
print "Input Changed Size is %s" % Size
# called when user confirms selections
def SelectionMade(Values):
# get values
Size = DiameterNames[Values[0]]
print "Selection Made Size is %s" % Size
# get access to windows functionality
Win = Windows()
# list of diameters to choose from
DiameterNames = ['None Selected', 'M6', 'M8', 'M10', 'M12']
# create dialog window
Options = []
Options.append(['Size', WindowsInputTypes.StringList, DiameterNames, DefaultDiameter])
# show dialog window to user
DialogWidth = 400
Win.UtilityDialog('Size', 'Apply', SelectionMade, InputChanged, Options, DialogWidth)
************************************************************************************************
# default diameter to show
DefaultDiameter = 'None Selected'
# called when an input changes in the dialog window
def InputChanged(Index, Value):
# size changed
if Index == 0:
Size = DiameterNames[Value]
print "Input Changed Size is %s" % Size
# called when user confirms selections
def SelectionMade(Values):
# get values
Size = DiameterNames[Values[0]]
print "Selection Made Size is %s" % Size
# get access to windows functionality
Win = Windows()
# list of diameters to choose from
DiameterNames = ['None Selected', 'M6', 'M8', 'M10', 'M12']
# create dialog window
Options = []
Options.append(['Size', WindowsInputTypes.StringList, DiameterNames, DefaultDiameter])
# show dialog window to user
DialogWidth = 400
Win.UtilityDialog('Size', 'Apply', SelectionMade, InputChanged, Options, DialogWidth)