Hi all I am using 0.18 freecad is there a way to preset a draw style as default example I like the flatline mode
Thank you Andrew
Default draw Style
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!
Re: Default draw Style
Flat Lines is the default style. What are you trying to do exactly, which workbench are you using?
You need to provide Important information.
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.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: Default draw Style
Hi Andrew.
AFAIK there currently isn't a setting for that. In addition each time you create a new document, the draw style gets reset and is document dependent. Hence you can't run some code snippet once, on for example FreeCAD start. What you could do is to first create a macro with such contents:
And after to create a macro command on (global) toolbar:
https://www.freecadweb.org/wiki/Customize_Toolbars
Now instead of pressing on "Create a new document" command, you press on the newly created macro command. And that should give you the results you are after.
P.S. https://www.freecadweb.org/wiki/Std_DrawStyle#Scripting
AFAIK there currently isn't a setting for that. In addition each time you create a new document, the draw style gets reset and is document dependent. Hence you can't run some code snippet once, on for example FreeCAD start. What you could do is to first create a macro with such contents:
Code: Select all
Gui.runCommand('Std_New')
Gui.runCommand('Std_DrawStyle', 3)
https://www.freecadweb.org/wiki/Customize_Toolbars
Now instead of pressing on "Create a new document" command, you press on the newly created macro command. And that should give you the results you are after.
P.S. https://www.freecadweb.org/wiki/Std_DrawStyle#Scripting
Re: Default draw Style
Shouldn't that be?:
For the menu ( -> View -> Draw Style) to reflect this new value you have to temporarily switch to a different document. Is there a way to avoid that?
Code: Select all
Gui.runCommand('Std_New')
Gui.runCommand('Std_DrawStyle', 1)
Re: Default draw Style
You could have a macro launched at startup that registers a document observer. This latter then can set a default draw style each time a document is open and/or created.
Re: Default draw Style
I used the number 3 for the demonstration purposes. The number can be any of the following values, depending on the desired outcome:
https://www.freecadweb.org/wiki/Std_DrawStyle#Scripting
Fair point. One can install Autoload module (Tools -> Addon manager) and follow the procedure:
https://forum.freecadweb.org/viewtopic. ... 95#p180338
Copy this code and paste it as a new macro (Autoload_DrawStyle.py):
Code: Select all
import FreeCAD
import FreeCADGui
class DocObserver(object):
"""Document observer."""
def slotCreatedDocument(self, doc):
"""Change drawstyle on document created."""
FreeCADGui.runCommand("Std_DrawStyle", 3)
FreeCAD.Console.PrintMessage("Drawstyle set\n")
do = DocObserver()
FreeCAD.addDocumentObserver(do)