0.16 Features We'd Like To See
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 105
- Joined: Fri Jul 17, 2015 7:40 pm
Re: 0.16 Features We'd Like To See
Hello everyone,
Maybe the preference dilogue can be improved.
I'd like the tool icon size to have more options. I want the size 20 and it's not in the dropdown list.
I have to modify user.cfg file in my home folder:
<FCInt Name="ToolbarIconSize" Value="20"/>
But that is overwriten the next time preference is set and I need to change it back again.
Why not just left it as an editable box?
OS: Debian GNU/Linux 8.0 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5632 (Git)
Build type: Release
Maybe the preference dilogue can be improved.
I'd like the tool icon size to have more options. I want the size 20 and it's not in the dropdown list.
I have to modify user.cfg file in my home folder:
<FCInt Name="ToolbarIconSize" Value="20"/>
But that is overwriten the next time preference is set and I need to change it back again.
Why not just left it as an editable box?
OS: Debian GNU/Linux 8.0 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5632 (Git)
Build type: Release
-
- Posts: 105
- Joined: Fri Jul 17, 2015 7:40 pm
Re: 0.16 Features We'd Like To See
Maybe the shape2Dview in the draft workbench should use the view direction as the default projection direction.
Re: 0.16 Features We'd Like To See
Sound intuitivegodblessfq wrote:Maybe the shape2Dview in the draft workbench should use the view direction as the default projection direction.

Need help? Feel free to ask, but please read the guidelines first
- microelly2
- Veteran
- Posts: 4690
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: 0.16 Features We'd Like To See
godblessfq wrote:Maybe the shape2Dview in the draft workbench should use the view direction as the default projection direction.
Code: Select all
import math
import FreeCAD,Draft
camera = FreeCADGui.ActiveDocument.ActiveView.getCameraNode()
a=str(camera.position.getValue().toString())
al=a.split(' ')
v=Draft.makeShape2DView(FreeCAD.ActiveDocument.YourObject)
v.Projection=(float(al[0]),float(al[1]),float(al[2]))
-
- Posts: 105
- Joined: Fri Jul 17, 2015 7:40 pm
Re: 0.16 Features We'd Like To See
Thank you for the macro. I am gonna to replace the shape2dview tool with it. 

Re: 0.16 Features We'd Like To See
hi microelly2
i modify your code for use with one object selected
I would put it in the wiki, what name can we give it
if you agree !
mario
i modify your code for use with one object selected
I would put it in the wiki, what name can we give it
if you agree !
Code: Select all
import math
import FreeCAD,Draft
try:
sel = FreeCADGui.Selection.getSelection()[0]
camera = FreeCADGui.ActiveDocument.ActiveView.getCameraNode()
a=str(camera.position.getValue().toString())
al=a.split(' ')
v=Draft.makeShape2DView(FreeCAD.ActiveDocument.getObject(sel.Name))
v.Projection=(float(al[0]),float(al[1]),float(al[2]))
App.ActiveDocument.recompute()
except Exception:
print "Select one object"
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.
- microelly2
- Veteran
- Posts: 4690
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: 0.16 Features We'd Like To See
Good idea mario,
I would it call 2DView and store into https://github.com/FreeCAD/FreeCAD-macros
There is already a macro Foto.FCMacro, which makes a picture (still works from top view)
Do you have access to that git or I can check it in.
I want to make some more modification next:
1. rotate to view in a way that the real z-axis maps to the y-axis of the 2dView
2. and we should make the exeption handling stronger.
I would it call 2DView and store into https://github.com/FreeCAD/FreeCAD-macros
There is already a macro Foto.FCMacro, which makes a picture (still works from top view)
Do you have access to that git or I can check it in.
I want to make some more modification next:
1. rotate to view in a way that the real z-axis maps to the y-axis of the 2dView
2. and we should make the exeption handling stronger.
Code: Select all
def errorDialog(msg):
diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u"Error Message",msg )
diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint)
diag.exec_()
....
except Exception:
errorDialog( "Select one object")
Re: 0.16 Features We'd Like To See
hi
mario
ok and the icon ?microelly2 wrote:I would it call 2DView
nomicroelly2 wrote:Do you have access to that git or I can check it in.
mario
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.
- microelly2
- Veteran
- Posts: 4690
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: 0.16 Features We'd Like To See
I don't see a simple solution to get the right direction of generated figure by a script.
somewhere behind Drawing.projectEx and HLRAlgo_Projector may be a way to get the things right,
but for me a running script is better than hours to read.
So my proposal: Create a Draft.Clone of the part, Rotate this clone to get the right view from +z
and then create the shape2View from this clone.
May be someone can tell me how the rotation logic is
(otherwise I will put the proposal into a macro)
somewhere behind Drawing.projectEx and HLRAlgo_Projector may be a way to get the things right,
but for me a running script is better than hours to read.
So my proposal: Create a Draft.Clone of the part, Rotate this clone to get the right view from +z
and then create the shape2View from this clone.
May be someone can tell me how the rotation logic is

(otherwise I will put the proposal into a macro)
- microelly2
- Veteran
- Posts: 4690
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact: