Message 1 of 5
Allowing click-drag input for UserInterface.selectEntity ("Faces")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When the mouse pointer is moving (but over a face) during the mouse click, the exception,
2 : InternalValidationError : selections.size() > 0
is thrown for UserInterface.selectEntity.
The same exception is thrown when a key is pressed. The script below can be used to demonstrate this. While running it, click various location quickly on one or more faces.
I am looking for a way to accept click-drag input, similar to the GUI's Select Sketch, where a click-drag behaves the same as a click.
Otherwise, does anyone have a suggestion on how to distinguish a click-drag from a key press for UserInterface.selectEntity?
Thank you
import adsk.core, traceback
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
app.log('-'*80)
while True:
try:
returnValue = ui.selectEntity('Select a face', 'Faces')
app.log("Successfully selected a face.")
except Exception as err:
app.log(str(err))
break
except:
app.log('Failed:\n{}'.format(traceback.format_exc()))
app.log("End of script.")
Fusion 360 2.0.12670