I'm happy to supply you with a test case, @kandennti-san. Here is a little script adapted from the API sampler which shows the problem. Type a new number into the text box to reset numRows.
#Author-William Anderson
#Description-Shows failure of TextBoxCmd to draw bottom border if numRows > 4
import adsk.core, adsk.fusion, adsk.cam, traceback
_handlers = []
class MyCommandCreatedHandler(adsk.core.CommandCreatedEventHandler):
def __init__(self):
super().__init__()
def notify(self, args):
try:
# Get the command that was created.
cmd = adsk.core.Command.cast(args.command)
# Connect to the input changed event.
onInputChanged = MyCommandInputChangedHandler()
cmd.inputChanged.add(onInputChanged)
_handlers.append(onInputChanged)
# Get the CommandInputs collection associated with the command.
inputs = cmd.commandInputs
# Create an editable textbox input.
myBox = inputs.addTextBoxCommandInput('writable_textBox', 'myTextBox', '5', 5, False)
myBox.isFullWidth = False
except:
_ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
class MyCommandInputChangedHandler(adsk.core.InputChangedEventHandler):
def __init__(self):
super().__init__()
def notify(self, args):
try:
eventArgs = adsk.core.InputChangedEventArgs.cast(args)
inputs = eventArgs.inputs
cmdInput = eventArgs.input
cmdId = cmdInput.id
if cmdId == 'writable_textBox':
# read number and reset number of lines displayable
textBox = adsk.core.TextBoxCommandInput.cast(cmdInput)
text = textBox.text
try:
rows = int(text)
textBox.numRows = max(rows, 1)
except:
pass
except:
_ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def run(context):
try:
global _app, _ui
_app = adsk.core.Application.get()
_ui = _app.userInterface
# Get the existing command definition or create it if it doesn't already exist.
cmdDef = _ui.commandDefinitions.itemById('textBoxTest')
if not cmdDef:
cmdDef = _ui.commandDefinitions.addButtonDefinition('textBoxTest', 'TextBox Texter', '')
# Connect to the command created event.
onCommandCreated = MyCommandCreatedHandler()
cmdDef.commandCreated.add(onCommandCreated)
_handlers.append(onCommandCreated)
# Execute the command definition.
cmdDef.execute()
# Prevent this module from being terminated when the script returns, because we are waiting for event handlers to fire.
adsk.autoTerminate(False)
except:
if _ui:
_ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))