@@ -21,6 +21,7 @@ def __init__(self, inputs: adsk.core.CommandInputs, options):
21
21
22
22
self .widthInHp = adsk .core .IntegerSpinnerCommandInput .cast (self .inputs .itemById ("widthInHp" ))
23
23
self .panelHeight = adsk .core .ValueCommandInput .cast (self .inputs .itemById ("panelHeight" ))
24
+ self .sketchOnly = adsk .core .BoolValueCommandInput .cast (self .inputs .itemById ("sketchOnly" ))
24
25
self .supportSolidHeight = adsk .core .ValueCommandInput .cast (self .inputs .itemById ("supportSolidHeight" ))
25
26
self .supportShellHeight = adsk .core .ValueCommandInput .cast (self .inputs .itemById ("supportShellHeight" ))
26
27
self .supportShellWallThickness = adsk .core .ValueCommandInput .cast (self .inputs .itemById ("supportShellWallThickness" ))
@@ -31,15 +32,18 @@ def __init__(self, inputs: adsk.core.CommandInputs, options):
31
32
self .updateUiState ()
32
33
33
34
def updateUiState (self ):
35
+ sketchOnly = self .sketchOnly .value
34
36
supportTypeName = self .supportType .selectedItem .name
35
37
supportTypeId = self .options .getIdForSupportTypeName (supportTypeName )
36
- self .supportSolidHeight .isVisible = supportTypeId == "solid"
37
- self .supportShellHeight .isVisible = supportTypeId == "shell"
38
+ self .panelHeight .isVisible = not sketchOnly
39
+ self .supportSolidHeight .isVisible = supportTypeId == "solid" and not sketchOnly
40
+ self .supportShellHeight .isVisible = supportTypeId == "shell" and not sketchOnly
38
41
self .supportShellWallThickness .isVisible = supportTypeId == "shell"
39
42
40
43
def updateOptionsFromInputs (self ):
41
44
self .options .widthInHp = int (self .widthInHp .value )
42
45
self .options .panelHeight = self .panelHeight .value
46
+ self .options .sketchOnly = self .sketchOnly .value
43
47
self .options .supportSolidHeight = self .supportSolidHeight .value
44
48
self .options .supportShellHeight = self .supportShellHeight .value
45
49
self .options .supportShellWallThickness = self .supportShellWallThickness .value
@@ -50,6 +54,7 @@ def updateOptionsFromInputs(self):
50
54
def updateInputsFromOptions (self ):
51
55
self .widthInHp .value = self .options .widthInHp
52
56
self .panelHeight .value = self .options .panelHeight
57
+ self .sketchOnly .value = self .options .sketchOnly
53
58
self .supportSolidHeight .value = self .options .supportSolidHeight
54
59
self .supportShellHeight .value = self .options .supportShellHeight
55
60
self .supportShellWallThickness .value = self .options .supportShellWallThickness
@@ -105,6 +110,8 @@ def initializeInputs(self):
105
110
for name in self .options .anchorPointNames :
106
111
anchorPointDropdown .listItems .add (name , name == self .options .anchorPointName )
107
112
113
+ self .inputs .addBoolValueInput ("sketchOnly" , "Sketch only" , True , "" , self .options .sketchOnly )
114
+
108
115
supportGroup = self .inputs .addGroupCommandInput ("supportGroup" , "Reinforcement" )
109
116
supportGroup .isExpanded = True
110
117
0 commit comments