@@ -44,7 +44,8 @@ def command_created(args: adsk.core.CommandCreatedEventArgs):
4444  OPTIONS .restoreDefaults ()
4545  INPUTS  =  args .command .commandInputs 
4646
47-   args .command .setDialogInitialSize (400 , 500 )
47+   args .command .setDialogMinimumSize (400 , 450 )
48+   args .command .setDialogSize (400 , 450 )
4849
4950  initializeInputs ()
5051  enableDisableInputs ()
@@ -83,9 +84,9 @@ def onCommandInputChanged(args: adsk.core.InputChangedEventArgs):
8384    OPTIONS .restoreDefaults ()
8485    updateInputsFromOptions ()
8586  elif  changedInputId  ==  'saveDefaults' :
86-     OPTIONS .saveDefaults ()
87+     if   not   OPTIONS .saveDefaults ():  ui . messageBox ( f'Unable to save defaults file  { OPTIONS . persistFile } . Is it writable?' ,  'Warning' )
8788  elif  changedInputId  ==  'eraseDefaults' :
88-     OPTIONS .eraseDefaults ()
89+     if   not   OPTIONS .eraseDefaults ():  ui . messageBox ( f'Unable to erase defaults file  { OPTIONS . persistFile } . Is it writable?' ,  'Warning' )
8990
9091# This event handler is called when the user interacts with any of the inputs in the dialog 
9192# which allows you to verify that all of the inputs are valid and enables the OK button. 
@@ -139,15 +140,14 @@ def initializeInputs():
139140  supportGroup .children .addValueInput ('supportShellWallThickness' , 'Shell wall thickness' , defaultLengthUnits , adsk .core .ValueInput .createByReal (OPTIONS .supportShellWallThickness ))
140141
141142  # Save, restore and erase defaults 
142-   restoreDefaultsInput  =  INPUTS .addBoolValueInput ('restoreDefaults' , 'Reset' , False , '' , False )
143-   restoreDefaultsInput .text  =  'Reset all panel settings to defaults' 
144- 
145-   persistGroup  =  INPUTS .addGroupCommandInput ('persistGroup' , 'Save defaults' )
146-   persistGroup .isExpanded  =  False 
143+   persistGroup  =  INPUTS .addGroupCommandInput ('persistGroup' , 'Defaults' )
144+   persistGroup .isExpanded  =  True 
145+   restoreDefaultsInput  =  persistGroup .children .addBoolValueInput ('restoreDefaults' , 'Reset' , False , '' , False )
146+   restoreDefaultsInput .text  =  'Reset all inputs to default values' 
147147  saveDefaultsInput  =  persistGroup .children .addBoolValueInput ('saveDefaults' , 'Update defaults' , False , '' , False )
148-   saveDefaultsInput .text  =  'Save current panel settings  as new defaults' 
148+   saveDefaultsInput .text  =  'Save current input values  as new defaults' 
149149  eraseDefaultsInput  =  persistGroup .children .addBoolValueInput ('eraseDefaults' , 'Factory reset' , False , '' , False )
150-   eraseDefaultsInput .text  =  'Erase saved panel settings  defaults' 
150+   eraseDefaultsInput .text  =  'Erase saved input value  defaults' 
151151
152152  message  =  'Does this add-in save you time? Say thanks by <a href="https://buymeacoffee.com/benalman">buying me a coffee.</a>' 
153153  coffeeTextBox  =  INPUTS .addTextBoxCommandInput ('coffeeTextBox' , 'Thanks' , message , 1 , True )
0 commit comments