Utility dialogs are used to create custom utilities. The dialog window stays open as long as the user wants. The user can enter settings and click on an ‘action button’ which then performs some action using the settings. This can be repeated over and over until the user chooses to close the window.
Requires WizoScript version 4.10 or later.
Note – put an image called ‘logo.gif’ into the same folder as the script. The script must be saved to disk before running.
Win = Windows()
# called when an input changes in the dialog window
def InputChanged(Index, Value):
# here index is the item in the list of options, 0 = first option, 1 = second option
# value is the new value entered by the user, e.g. an edge or face
# inserts a connector, called when the 'action button' is clicked
# get the values entered by the user
ChosenEdge = Values
if ChosenEdge == None:
Win.ErrorDialog('Please choose an edge', 'My Utility')
ChosenFace = Values
if ChosenFace == None:
Win.ErrorDialog('Please choose a face', 'My Utility')
# now do something with the edge and face
ChosenAssembly = Edge.GetSelectionAssembly()
# create a set of options to show in the dialog window
Options = 
# show an image - in this case a logo, scaled to have a width of 300px
Options.append(['', WindowsInputTypes.Image, r'logo.gif', 300])
# a selection box to select edges
Options.append(['Hole Edge', WindowsInputTypes.Edge, None])
# a selection box to select faces
Options.append(['Top Face', WindowsInputTypes.Face, None])
# show dialog window to user
# first item is the script name, second item is the text for the 'action button'
# third item is a function to call when the action button is clicked
# fourth item is a function to call when an option changes
# fifth item is the options
# sixth item is the width of the input area of the dialog window
Win.UtilityDialog('My Utility', 'Insert Connector', InsertConnector, InputChanged, Options, 400)