Draft grid stays in other workbenches

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft grid stays in other workbenches

Post by vocx »

GeneFC wrote: Wed Jul 15, 2020 4:24 pm ...
Does a workbench know when if has been "left" in favor of another workbench?
...
Inside Draft's InitGui.py

Code: Select all

class DraftWorkbench(FreeCADGui.Workbench):

    ...

    def Activated(self):
        """When entering the workbench."""
        if hasattr(FreeCADGui, "draftToolBar"):
            FreeCADGui.draftToolBar.Activated()
        if hasattr(FreeCADGui, "Snapper"):
            FreeCADGui.Snapper.show()
            import draftutils.init_draft_statusbar as dsb
            dsb.show_draft_statusbar()
        FreeCAD.Console.PrintLog("Draft workbench activated.\n")

    def Deactivated(self):
        """When quitting the workbench."""
        if hasattr(FreeCADGui, "draftToolBar"):
            FreeCADGui.draftToolBar.Deactivated()
        if hasattr(FreeCADGui, "Snapper"):
            FreeCADGui.Snapper.hide()
            import draftutils.init_draft_statusbar as dsb
            dsb.hide_draft_statusbar()
        FreeCAD.Console.PrintLog("Draft workbench deactivated.\n")
It would be a matter of hiding the grid when Deactivating the workbench (check the code inside Draft_ToggleGrid). This sounds relatively trivial, however, since it's not a very critical issue, we Drafters have largely ignored it. However, I notice that many Part/PartDesigners go crazy about it, so maybe we can tackle it.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Draft grid stays in other workbenches

Post by -alex- »

JFYI I use G,R official shortcut to quickly show/hide this grid, that works pretty fine from inside or outside Draft WB AFAIK.
BTW I hope the behaviour will be improved.
mrdic
Posts: 130
Joined: Wed May 10, 2017 4:25 am

Re: Draft grid stays in other workbenches

Post by mrdic »

There's a default shortcut g,r that toggles grid on and off. It seems to me that it doesn't work in every WB, but I tend to look at it first before I dismiss it because it shows me workplane orientation. You can customise snap bar appearance in other WBs too, to dismiss the grid from it.
drmacro
Veteran
Posts: 8867
Joined: Sun Mar 02, 2014 4:35 pm

Re: Draft grid stays in other workbenches

Post by drmacro »

mrdic wrote: Thu Jul 16, 2020 3:57 am There's a default shortcut g,r that toggles grid on and off. It seems to me that it doesn't work in every WB, but I tend to look at it first before I dismiss it because it shows me workplane orientation. You can customise snap bar appearance in other WBs too, to dismiss the grid from it.
Draft WB is a special animal. :roll:

Note, that the short cut g,r does different things if Draft WB has not been activated. After it has, then g,r does toggle the grid in other workbenches.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
freman
Veteran
Posts: 2201
Joined: Tue Nov 27, 2018 10:30 pm

Re: Draft grid stays in other workbenches

Post by freman »

I just got his by this yesterday, having accidentally switched to draft WB by mistake. I flipped straight back out but did not realise where this grid had come from ( I was working in Part Design - which involves Sketcher and Path WB ).

I could not work out why it had popped up and how to get rid of it : nothing in the WBs I was using had any options relating to this. I had to post for help on the forum.

It seems a quick in and out should not leave me with a changed environment and some cryptic feature.

Having said that I can see this could be quite handy for measuring depth while designing paths. It would be quicker than hovering over features and trying to spot coords in the status bar. A graph in Path could be useful.

So I would say, please don't disable it everywhere except Draft, but please make it accessible in a consistent way: g,r seems inconsistent right now.

my2c.
Post Reply