Created
October 14, 2025 10:34
-
-
Save stephensmitchell/859157cc7ba99c515dedfc8d3a9ef162 to your computer and use it in GitHub Desktop.
Drop Down Lists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #https://help.alibre.com/articles/#!alibre-help-v28/drop-down-lists | |
| import glob | |
| import os | |
| import re | |
| # default diameter to show | |
| DefaultDiameter = 'M6' | |
| # called when an input changes in the dialog window | |
| def InputChanged(Index, Value): | |
| # size changed | |
| if Index == 0: | |
| Size = DiameterNames[Value] | |
| print Size | |
| # called when user confirms selections | |
| def SelectionMade(Values): | |
| # get values | |
| Size = DiameterNames[Values[0]] | |
| print Size | |
| # get access to windows functionality | |
| Win = Windows() | |
| # list of diameters to choose from | |
| DiameterNames = ['M6', 'M8', 'M10', 'M12'] | |
| # create dialog window | |
| Options = [] | |
| Options.append(['Size', WindowsInputTypes.StringList, DiameterNames, DefaultDiameter]) | |
| # show dialog window to user | |
| DialogWidth = 400 | |
| Win.UtilityDialog('Test', 'Apply', SelectionMade, InputChanged, Options, DialogWidth) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment