Arch Schedule recursive call of execute

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Roy_043
Veteran
Posts: 8456
Joined: Thu Dec 27, 2018 12:28 pm

Arch Schedule recursive call of execute

Post by Roy_043 »

There is a problem with Arch_Schedule. Its execute function is called repeatedly whenever an object in the document is modified. Even adding f.e. a Part_Box will trigger the function.

Test:
  1. Open arch_schedule.FCStd.
  2. Edit the WallTrace sketch.
  3. Result: the execute function is triggered 6 times.
  4. Clear the Python console.
  5. Add a Part_Box.
  6. Result: the execute function is triggered 2 times.
  7. Clear the Python console.
  8. Edit a property of the box.
  9. Result: the execute function is triggered 2 times.
I have found a workaround to prevent this recursive calling. But I wonder if there is a better ("standard"?) approach for this. One issue with the revised code is that if the model changes the user has to recompute the schedule manually.

Code: Select all

OS: Windows 8.1 (6.3)
Word size of FreeCAD: 64-bit
Version: 0.20.28611 (Git)
Build type: Release
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: Dutch/Netherlands (nl_NL)
Installed mods: 
Attachments
ArchSchedule.py
(27.24 KiB) Downloaded 37 times
arch_schedule.FCStd
(11.99 KiB) Downloaded 38 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Arch Schedule recursive call of execute

Post by Kunda1 »

Can't test ATM..
paullee wrote:
@paullee do you mind testing
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Roy_043
Veteran
Posts: 8456
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch Schedule recursive call of execute

Post by Roy_043 »

There is no rush. I don't think this is for V0.20.
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Schedule recursive call of execute

Post by paullee »

Hope have more spare time later :D
User avatar
Roy_043
Veteran
Posts: 8456
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch Schedule recursive call of execute

Post by Roy_043 »

Post Reply