What i want to do is to get the coordinates on a face when hoovering over with the mouse. I get that by doing this and it prints out the position perfectly in the debug console.
# Event handler for the preSelectMouseMove event
def command_preSelectMouseMove(args: adsk.core.SelectionEventArgs):
# Code to react to the event
inputs = args.selection
hoover_test: adsk.core.SelectionCommandInput = args.selection
hoover_point = inputs.point
# print(f'{inputs.entity}')
print(f'{hoover_point.x:.2f}')
Now I want to display the hoover_point readings (live as the mouse moves) in a dialog box as a text. Meaning I need to transfer the hoover_point variable over to def command_inputChanged
# This function will be called when the user changes anything in the command dialog.
def command_inputChanged(args: adsk.core.InputChangedEventArgs):
changed_input = args.input
inputs = args.inputs
futil.log(f'{CMD_NAME} Input Changed Event fired from a change to {changed_input.id}')
start_point_selection_input: adsk.core.SelectionCommandInput = inputs.itemById('spline_start')
position_box: adsk.core.TextBoxCommandInput = inputs.itemById('position_box')
type_box: adsk.core.TextBoxCommandInput = inputs.itemById('type_box')
But I don’t get it to work, even if I make the hoover_point variable global. Maybe I do something wrong when I set up the global variable?🤷 would really appreciate an answer on this. Feels like this is a part of the add writing I just don’t get 100%.