Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

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

ltomuta
Advisor

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
Reply
174 Views
0 Replies
Replies (0)