In Draft.py, some makeXXXX(makeCircle, makeRectangle, ...) functions call FreeCAD.ActiveDocument.recompute() before returning a new object, and some (makeText, makeArray, makePathArray, makeEllipse) do not.
In DraftTools.py, again, some tools (Arc) call recompute, and some (Rectangle) do not.
Is there are rule of thumb for when and where to include the recompute() call??
wf
ROT for Use of recompute() in Draft Module
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- wandererfan
- Veteran
- Posts: 6317
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: ROT for Use of recompute() in Draft Module
Yeah, there is still quite some mess in the draft module...
My first idea was: not recompute inside the Draft.makeXXX functions, so the person who uses these in scripts can choose when to recompute, but then some cases appeared where you must recompute anyway, otherwise the operation is not fully performed. And things stayed more or less like that... Maybe it's time for some housecleaning
My first idea was: not recompute inside the Draft.makeXXX functions, so the person who uses these in scripts can choose when to recompute, but then some cases appeared where you must recompute anyway, otherwise the operation is not fully performed. And things stayed more or less like that... Maybe it's time for some housecleaning