Rename: The two visual modes of using Sketcher
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
Rename: The two visual modes of using Sketcher
I'm having a tough time searching for how to make a standard toolbar, like one that could be put in Master at some point. Is there a template or some sample code? I search and most all I get is how to install or modify in the program. Just doing a little research.
Thank you
Thank you
Last edited by freedman on Sun Nov 15, 2020 6:27 am, edited 1 time in total.
Re: How to make a standard toolbar
Are you looking for Python or C++?
Re: How to make a standard toolbar
Python. My thoughts were to get everything working in a macro then let you folks review and tear it up, to get it right. and then migrate to a toolbar. I would expect to build some icons (again for review), I don't know how this all packages but I would hope to get 95% of the work finished and then someone can try to integrate. I don't see me compiling FreeCAD currently.
Thanks
Thanks
Re: How to make a standard toolbar
You could try to download my test workbench. https://forum.freecadweb.org/viewtopic.php?f=40&t=44893
Just unzip under yourFreeCAD/mod folder. Start FreeCAD, switch to that hpBox workbench. You could add your code on it.
Just unzip under yourFreeCAD/mod folder. Start FreeCAD, switch to that hpBox workbench. You could add your code on it.
Re: How to make a standard toolbar
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: How to make a standard toolbar
Thanks all. That should do it.
Here is my target, I put together a 5 minute quick pic so you get the idea.
The first icon associates directly with (on v0.19) the setting Edit-Preferences-Sketcher-Display-Check box "Hide all objects that depend on the sketch". The button is a toggle SM1-SM2, SM2-SM1, the text stands for Sketch Mode 1 and 2. The button when set to SM2 needs to set the check box and set the option "Apply to existing sketches".
I don't know how to apply "Apply to existing sketches" in code, I don't know if it's ever been done.
The next three buttons set the global visibility (all objects) to the shown transparency.
I will do a following post showing why I think this setting is one of the most important changes FreeCAD can make.
Obviously the SM1-SM2 could turn into a series, SM3,SM4......
Thanks
Here is my target, I put together a 5 minute quick pic so you get the idea.
The first icon associates directly with (on v0.19) the setting Edit-Preferences-Sketcher-Display-Check box "Hide all objects that depend on the sketch". The button is a toggle SM1-SM2, SM2-SM1, the text stands for Sketch Mode 1 and 2. The button when set to SM2 needs to set the check box and set the option "Apply to existing sketches".
I don't know how to apply "Apply to existing sketches" in code, I don't know if it's ever been done.
The next three buttons set the global visibility (all objects) to the shown transparency.
I will do a following post showing why I think this setting is one of the most important changes FreeCAD can make.
Obviously the SM1-SM2 could turn into a series, SM3,SM4......
Thanks
- Attachments
-
- sketch_icon.png (10.11 KiB) Viewed 1373 times
Re: How to make a standard toolbar
hmm...I'm on a tablet at the moment, so can't check. But, I seem to remember someone else offering a macro or menu to do the transparency thing.
and "one of the most important changes"...count me as dubious but I look forward to you explanation.
and "one of the most important changes"...count me as dubious but I look forward to you explanation.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Re: How to make a standard toolbar
hi
@ freedman i adapt my macro try this
you must modify the values in the Edit parameter after the first use
mario
@ freedman i adapt my macro try this
you must modify the values in the Edit parameter after the first use
Code: Select all
User parameter:BaseApp/Preferences/Macros/FCMmacros/Visibility_ToolBar
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: How to make a standard toolbar
Geez, thanks Mario52. Very helpful...
The reason behind the toolbar follows in the pics. Each pic shows Sketch mode 1 (SM1) on the left and Sketch mode 2 (SM2) on the right.
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.
I think it's easy to see that SM2 is a better format for modeling.
To refresh what SM1, SM2 look like (in 0.19).
SM1 = Edit-Preferences-Sketcher-Display-Check box "Hide all objects that depend on the sketch" is checked.
SM2 = Edit-Preferences-Sketcher-Display-Check box "Hide all objects that depend on the sketch" is unchecked.
You will need to "Apply to existing sketch".
The reason behind the toolbar follows in the pics. Each pic shows Sketch mode 1 (SM1) on the left and Sketch mode 2 (SM2) on the right.
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.
I think it's easy to see that SM2 is a better format for modeling.
To refresh what SM1, SM2 look like (in 0.19).
SM1 = Edit-Preferences-Sketcher-Display-Check box "Hide all objects that depend on the sketch" is checked.
SM2 = Edit-Preferences-Sketcher-Display-Check box "Hide all objects that depend on the sketch" is unchecked.
You will need to "Apply to existing sketch".
- Attachments
-
- SM1_SM2_sketch.png (275.85 KiB) Viewed 1172 times
-
- SM1_SM2_sketch1.png (193.43 KiB) Viewed 1172 times
-
- SM1_SM2_sketch2.png (210.69 KiB) Viewed 1238 times
-
- SM1_SM2_sketch3.png (215.66 KiB) Viewed 1238 times
-
- SM1_SM2_sketch4.png (188.28 KiB) Viewed 1238 times
Last edited by freedman on Sun Mar 13, 2022 7:29 am, edited 4 times in total.
Re: How to make a standard toolbar
Here is the model file for the previous post, the file got too big.
- Attachments
-
- Test_arch_block.FCStd
- (206.05 KiB) Downloaded 17 times