Message 1 of 4
Bug: Large contents in command dialog blanks dialog in sketch mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
If I create a command window in sketch mode and show more contents than can fit in the window, both the texts of the window and the controls of the sketch windows are blanked. I noticed this when working with a smaller Fusion window as I had other windows on the side.
If I make the Fusion window larger (or the textbox smaller):
Here is a minimal example add-in. Make the Fusion window small or increase the number of lines in the textbox. Create a new sketch and choose CREATE -> Run command.
from .lib import fusionAddInUtils as futil
import adsk.core
from datetime import datetime
app = adsk.core.Application.get()
ui = app.userInterface
def run(context):
try:
# This will run the start function in each of your commands as defined in commands/__init__.py
# commands.start()
cmd = ui.commandDefinitions.addButtonDefinition('bug_run_cmd', 'Run command', '')
ui.allToolbarPanels.itemById('SketchCreatePanel').controls.addCommand(cmd)
futil.add_handler(cmd.commandCreated, cmd_created)
except:
futil.handle_error('run')
def cmd_created(args: adsk.core.CommandCreatedEventArgs):
inputs = args.command.commandInputs
inputs.addTextBoxCommandInput('txt', 'Textbox', 'text', 20, False)
def stop(context):
try:
# Remove all of the event handlers your app has created
futil.clear_handlers()
# This will run the start function in each of your commands as defined in commands/__init__.py
# commands.stop()
cmd = ui.commandDefinitions.itemById('bug_run_cmd')
if cmd:
ui.allToolbarPanels.itemById('SketchCreatePanel').controls.itemById('bug_run_cmd').deleteMe()
cmd.deleteMe()
except:
futil.handle_error('stop')