Indeed we should think of how to implement this first. For me we should, somewhere, in the FreeCAD session, keep a table of all opened views + their working plane and grid settings (if we keep per-view working plane parameters, there is no reason to not keep grid settings too. Note that the grid coin object needs to be drawn for each view, so at the moment there is already (in the snapper IIRC) a structure to store several grid objects.Roy_043 wrote: ↑Thu Oct 20, 2022 9:14 am IMO this would make sense. But it raises a number of questions:
Should the grids in the views belonging to the same document be allowed to have different grid spacings? Or would that be too confusing?
How should grid preferences be handled? Should the view that is closed last overwrite the grid preferences and should its grid settings be stored in the document?
So at any moment, for a given view, we could query the table to know the working plane and grid settings to use. The grid itself is already redrawn frequently, basically at each Draft operation, but there might be a need for a more robust system to call a grid redraw.
At the moment we store the WP in FreeCAD.DraftWorkingPlane. We could change this with for ex. something like Draft.get_working_plane() so it becomes dynamic, it would return a different WP depending on the active document/view