Adding operation to activeSelection works only if design is not yet saved!?

Adding operation to activeSelection works only if design is not yet saved!?

ltomuta
Advisor Advisor
294 Views
0 Replies
Message 1 of 1

Adding operation to activeSelection works only if design is not yet saved!?

ltomuta
Advisor
Advisor

This basic code works fine if the op (a setup in my case) exists in a new design that is not yet saved. Or if I call the APIs in an existing saved design, but via the text command console instead of from my add-in.

ui.activeSelections.clear()
if ui.activeSelections.add(op):
    ui.commandDefinitions.itemById('IronEditTool').execute()


But if I save the design and then try to execute my add-in, the add() method returns True yet execute() shows a toast notification about invalid selection

ltomuta_0-1715607292773.png

with a matching log entry: 

20240513T163531 E  .9244 New Alert message. Tooltip: No operation is selected., Short Message: No operation is selected., Long Message: No operation is selected.



0 Likes
295 Views
0 Replies
Replies (0)