Message 1 of 6
[Bug] UserInterface.selectEntity returns errors instead of null when selection is aborted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
The following code returns an error message if the selection is aborted using the Esc key: "InternalValidationError : selections.size() > 0" in adsk/core.py at line 16844.
import adsk.core, traceback
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
selection = ui.selectEntity('Select a B-Rep body', 'SolidBodies')
if selection:
pass
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Jérôme Briot, Freelance engineer - Mechanical design and prototyping
3D Print Plus / Pro | IDF Import | GitHub To Fusion 360 | Tube Bending Data Exchanger | Slice Data Export
Memory Used | Basic Calculator | Check Computer Specifications | Import spline from any CSV file