|
45 | 45 | local_handlers = [] |
46 | 46 |
|
47 | 47 | # Input groups |
| 48 | +INFO_GROUP = 'info_group' |
48 | 49 | BASIC_SIZES_GROUP = 'basic_sizes' |
49 | 50 | XY_DIMENSIONS_GROUP = 'xy_dimensions' |
50 | 51 | PLATE_FEATURES_GROUP = 'plate_features' |
|
60 | 61 | BASEPLATE_WIDTH_INPUT = 'plate_width' |
61 | 62 | BASEPLATE_LENGTH_INPUT = 'plate_length' |
62 | 63 | BASEPLATE_TYPE_DROPDOWN = 'plate_type_dropdown' |
63 | | -INFO_GROUP_ID = 'info_group' |
64 | 64 |
|
65 | 65 | BASEPLATE_TYPE_LIGHT = 'Light' |
66 | 66 | BASEPLATE_TYPE_FULL = 'Full' |
@@ -160,12 +160,13 @@ def command_created(args: adsk.core.CommandCreatedEventArgs): |
160 | 160 |
|
161 | 161 | # https://help.autodesk.com/view/fusion360/ENU/?contextId=CommandInputs |
162 | 162 | inputs = args.command.commandInputs |
| 163 | + # Create a value input field and set the default using 1 unit of the default length unit. |
| 164 | + defaultLengthUnits = app.activeProduct.unitsManager.defaultLengthUnits |
163 | 165 |
|
164 | | - infoGroup = inputs.addGroupCommandInput(INFO_GROUP_ID, 'Info') |
| 166 | + infoGroup = inputs.addGroupCommandInput(INFO_GROUP, 'Info') |
165 | 167 | infoGroup.children.addTextBoxCommandInput("info_text", "Info", INFO_TEXT, 3, True) |
| 168 | + uiState.registerCommandInput(infoGroup) |
166 | 169 |
|
167 | | - # Create a value input field and set the default using 1 unit of the default length unit. |
168 | | - defaultLengthUnits = app.activeProduct.unitsManager.defaultLengthUnits |
169 | 170 | basicSizesGroup = inputs.addGroupCommandInput(BASIC_SIZES_GROUP, 'Basic size') |
170 | 171 | basicSizesGroup.isExpanded = uiState.getState(BASIC_SIZES_GROUP) |
171 | 172 | uiState.registerCommandInput(basicSizesGroup) |
@@ -405,6 +406,7 @@ def generateBaseplate(args: adsk.core.CommandEventArgs): |
405 | 406 |
|
406 | 407 | def initUiState(): |
407 | 408 | global uiState |
| 409 | + uiState.initValue(INFO_GROUP, True, adsk.core.GroupCommandInput.classType()) |
408 | 410 | uiState.initValue(BASIC_SIZES_GROUP, True, adsk.core.GroupCommandInput.classType()) |
409 | 411 | uiState.initValue(XY_DIMENSIONS_GROUP, True, adsk.core.GroupCommandInput.classType()) |
410 | 412 | uiState.initValue(PLATE_FEATURES_GROUP, True, adsk.core.GroupCommandInput.classType()) |
|
0 commit comments