Rename: The two visual modes of using Sketcher

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!
mario52
Posts: 3353
Joined: Wed May 16, 2012 2:13 pm

Re: How to make a standard toolbar

Postby mario52 » Thu Nov 12, 2020 6:53 pm

hi

the value change but i not see the difference

same if i adding "Gui.runCommand('Std_DlgPreferences',0)" in end "def SM1()"

see this post (work with the preference options certain work other no):

The Open Document Widget is NOT showing ALL my files

Standard / imperial unit system change - short cut

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
freedman
Posts: 1791
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: How to make a standard toolbar

Postby freedman » Thu Nov 12, 2020 8:19 pm

I also don't see any changes. Maybe Openbrain can jump in here.
Right out of the console:

Code: Select all

for name,doc in App.listDocuments().items():
    for sketch in doc.findObjects('Sketcher::SketchObject'):
        sketch.ViewObject.HideDependent = True
        sketch.ViewObject.ShowLinks = True
        sketch.ViewObject.ShowSupport = True
        sketch.ViewObject.RestoreCamera = True
It's like it only takes the info from the screen.
freedman
Posts: 1791
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: How to make a standard toolbar

Postby freedman » Fri Nov 13, 2020 6:14 pm

Here is a macro if folks want to do some testing, the macro only sets 3 levels of visibilty. It's kind of big because of the style sheet issues I'm having. Another big advantage of SM2, in Sketcher if you turn on auto-update the model will update in real time and you get to watch, I really like this when designing something.
Attachments
3_level_pic.JPG
3_level_pic.JPG (9.76 KiB) Viewed 302 times
Vision_3_levels.FCMacro
(3.52 KiB) Downloaded 12 times
freedman
Posts: 1791
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: How to make a standard toolbar

Postby freedman » Fri Nov 13, 2020 8:38 pm

Deleted by OP
Last edited by freedman on Sun Nov 15, 2020 6:31 am, edited 1 time in total.
freedman
Posts: 1791
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: How to make a standard toolbar

Postby freedman » Fri Nov 13, 2020 8:55 pm

I will start a new post in the "Python scripting and macros" section and reference this. Looks like there's some work to be done. :)
Continues here, https://forum.freecadweb.org/viewtopic.php?f=22&t=52130
Thanks
mario52
Posts: 3353
Joined: Wed May 16, 2012 2:13 pm

Re: How to make a standard toolbar

Postby mario52 » Sat Nov 14, 2020 10:20 am

hi

no problem "on va tirer notre plan"

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
freedman
Posts: 1791
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: How to make a standard toolbar

Postby freedman » Sun Nov 15, 2020 6:20 am

Since I got this working I thought I would at least post the fix in a macro. It works great and updates correctly in Preferences.
The SM1 button toggles between SM1 and SM2. When using SM2 the model will be shown solid (in Sketcher) until you use the global visibilty buttons to peer thru the surface. If you load a new document you will need to toggle the the SM button to apply settings, the macro does not react to a new file load.
There is still some work to be done to get this into a toolbar.

I added a pic of ppemawm's Grinder, a huge difference if your trying to design in context. SM1 on the left, SM2 on the right.
Attachments
Grinder_SM1_SM2.png
Grinder_SM1_SM2.png (263.88 KiB) Viewed 178 times
Vision_SM1_SM2.FCMacro
(4.4 KiB) Downloaded 13 times
sm1_2_pic.PNG
sm1_2_pic.PNG (2.78 KiB) Viewed 213 times
Last edited by freedman on Tue Nov 17, 2020 11:45 pm, edited 1 time in total.
mario52
Posts: 3353
Joined: Wed May 16, 2012 2:13 pm

Re: Rename: The two visual modes of using Sketcher

Postby mario52 » Tue Nov 17, 2020 10:38 am

hi

just to see if the macro work to needed

Vision_Sm1Sm2_00.gif
Vision_Sm1Sm2_00.gif (285.67 KiB) Viewed 167 times

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22988 (Git)
Build type: Release
Branch: master
Hash: cdc01cb20cfa74079c45b9dc2dab81e3248b2aa5
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0


mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
drmacro
Posts: 2589
Joined: Sun Mar 02, 2014 4:35 pm

Re: Rename: The two visual modes of using Sketcher

Postby drmacro » Tue Nov 17, 2020 10:54 am

I've only had one cup of coffee this morning, but, I can't see what changes when the SM button is clicked... :oops:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."

My beginners, written treatise: Learning FreeCAD
jmaustpc
Posts: 10791
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: How to make a standard toolbar

Postby jmaustpc » Tue Nov 17, 2020 12:41 pm

freedman wrote:
Thu Nov 12, 2020 2:11 am
Just about every time I get a file off the forum I convert the file to SM2 format, it allows me to see where the sketches are placed relative to the model. Also, I have been using SM2 for about 2 years, I get to design and see the entire model.
The problom with SM2 is the fact that you can't see sketches imbeded in the model so most everyone uses (SM1), the FreeCAD default. If we can change the global transparency easily then we all can start using SM2.
why don't you just click on the Sketcher_ViewSection tool/icon in sketcher wb.

Image