Mesh WB: how to specify preferred default settings

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!
User avatar
uwestoehr
Posts: 562
Joined: Sun Jan 27, 2019 3:21 am

Mesh WB: how to specify preferred default settings

Postby uwestoehr » Thu Feb 14, 2019 2:44 pm

I have to create several meshes of parts Iconstructed with FC. I found out that these mesh settings are optimal for all my parts:
Mesh-settings-ideal.jpg
Mesh-settings-ideal.jpg (26.19 KiB) Viewed 168 times
and therefore I want to make these settings the default. But in the mesh preferences I can only specify the maximum mesh deviation, not more. (Btw. I found the minor issue #3838).

So the question is if what I want is possible or would be a feature request.
User avatar
uwestoehr
Posts: 562
Joined: Sun Jan 27, 2019 3:21 am

Re: Mesh WB: how to specify preferred default settings

Postby uwestoehr » Sat Feb 16, 2019 3:59 pm

uwestoehr wrote:
Thu Feb 14, 2019 2:44 pm
So the question is if what I want is possible or would be a feature request.
It turned out it is a missing feature. Therefore I created now a feature request: issue #3841
User avatar
HarryGeier
Posts: 1112
Joined: Mon Jul 10, 2017 12:36 pm
Location: Hof Germany

Re: Mesh WB: how to specify preferred default settings

Postby HarryGeier » Sat Feb 16, 2019 9:40 pm

This also bugged me long time..

i made a macro for that task..

# -*- coding: utf-8 -*-
# Create a Standard MESH on on click from the current object.
# Parameters are coded in Macro . I use them to 99.9% for 3D STL´s
# Macro Begin: makestl.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++
import FreeCAD
import Mesh
import MeshPartGui, FreeCADGui
import MeshPart

#Get the current FreeCAD Document Object
__doc__=FreeCAD.activeDocument()
Gui.activateWorkbench("MeshWorkbench")

#Get the Name of the current selected Object
sel = FreeCADGui.Selection.getSelection()
Nameelement = sel[0].Name
#Print the Name
App.Console.PrintMessage(str(Nameelement)+"\n")

#instantiate a Mesh
__mesh__=__doc__.addObject("Mesh::Feature","Mesh")
#Get the Object selected
__part__=__doc__.getObject(Nameelement)

#Copy it´s Shape
__shape__=__part__.Shape.copy(False)
__shape__.Placement=__part__.getGlobalPlacement()


#Mek the Mesh with Standard Parameters
__mesh__.Mesh=MeshPart.meshFromShape(Shape=__shape__, LinearDeflection=0.1, AngularDeflection=25, Relative=False)


#rename the new Mesh and put into View
__mesh__.Label=Nameelement+" (Meshed)"
__mesh__.ViewObject.CreaseAngle=25.0

#Make the Feature invisible
Gui.getDocument(__doc__).getObject(Nameelement).Visibility=False
#Clean Up
del __doc__, __mesh__, __part__, __shape__

# Macro End: makestl.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++


takes the selected elemet, creates a STANDARD mesh , makes source invisible and mesh visible
Kaum macht man´s richtig , gehts´s
My Video Tutorials on Youtube: https://www.youtube.com/channel/UCoe3B ... p8Q/videos
My FreeCAD Stuff on Hidrive: https://my.hidrive.com/share/qr3l1yddy6#$/
User avatar
uwestoehr
Posts: 562
Joined: Sun Jan 27, 2019 3:21 am

Re: Mesh WB: how to specify preferred default settings

Postby uwestoehr » Sun Feb 17, 2019 1:14 am

HarryGeier wrote:
Sat Feb 16, 2019 9:40 pm
This also bugged me long time..
i made a macro for that task..
Many thanks Harry! Works perfect.
User avatar
uwestoehr
Posts: 562
Joined: Sun Jan 27, 2019 3:21 am

Re: Mesh WB: how to specify preferred default settings

Postby uwestoehr » Sun Jul 14, 2019 12:45 am

HarryGeier wrote:
Sat Feb 16, 2019 9:40 pm
This also bugged me long time..
i made a macro for that task..
Great news:
Werner kindly implemented last week the feature to store the last used meshed settings (git commit 6797fa615f761be2c69f7e351e52d5a9814d864b).
Therefore I don't need a macro anymore, I just enter the values I like and they will be proposed as default for any further call of the mesh generation dialog.
So check out the latest FC 0.19 build.