Command line script double invocation

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Command line script double invocation

Post by mlampert »

I just notice that one of my test scripts produced two shapes instead of one. As it turned out I had a typo, using `Gui` instead of `FreeCADGui`, in which case the script gets executed again

file "double.py"

Code: Select all

import FreeCAD
import FreeCADGui
import Part

print('double.py invoked')

Part.show(Part.Edge(Part.makeCircle(1)))
FreeCAD.ActiveDocument.recompute()

Gui.activeDocument().activeView().viewTop()         # <-- causes invocation again
#FreeCADGui.activeDocument().activeView().viewTop() # <-- no double invocation
when I start FC with:

Code: Select all

FreeCAD double.py
I don't think it's a big deal, I was just wondering if this is a known issue.
Post Reply