Editing geometry while onActivePathChanged
-
I'm using the
ModelObserver'sonActivePathChangedevent to detect when components/groups are closed after editing. When that condition is met I call a method which deletes and adds some edges to a component definition in the model.However, when an edge is added or removed
onActivePathChangedis called again for every change. And sinceonActivePathChangedcalls the method which causes the edges to be added or removed I now suddenly have an endless loop that runs until the call stack is full and SU bugsplats.onActivePathChanged -- calls --> updateComponentMethod updateComponentMethod -- when adding/removing edges; calls --> onActivePathChanged --> LOOP!!!If I remove the lines that add or removed the edges the loop doesn't occur.
I have worked around it by setting a module variable when I start updating which makesonActivePathChangedexit immediately if the update flag is set to true.But I don't understand at all why
onActivePathChangedis called back when I add/remove edges. Some kind of weird bug?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement