Renaming entity leads to selection reset

Renaming entity leads to selection reset

kriomant
Advocate Advocate
182 Views
2 Replies
Message 1 of 3

Renaming entity leads to selection reset

kriomant
Advocate
Advocate

I use `entity.name = newName` in my add-in code. If renamed entity is selected, after renaming selection is lost. Is it intended behavior?

0 Likes
183 Views
2 Replies
Replies (2)
Message 2 of 3

BrianEkins
Mentor
Mentor

I think this is the expected behavior. Anything that creates a transaction will clear the current selection and setting the name is a transacted operation, (causes an item to be added to the undo list).

 


@kriomant wrote:

I use `entity.name = newName` in my add-in code. If renamed entity is selected, after renaming selection is lost. Is it intended behavior?


 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 3

kriomant
Advocate
Advocate

Ok. I'm able to work around it. But what is rationale for such behavior?

When user renames objects using UI, selection is preserved.

0 Likes