I am using translate method from DraftTools module.
However when I try to run my script by python interpreter (not from FreeCAD) it gives me the following error:
File "C:my_script.py", line 4, in <module>
from DraftTools import translate
File "C:\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\FreeCAD 0.19\Mod\Draft\DraftTools.py", line 51, in <module>
import DraftGui # Initializes the DraftToolBar class
File "C:\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\FreeCAD 0.19\Mod\Draft\DraftGui.py", line 2231, in <module>
FreeCADGui.draftToolBar = DraftToolBar()
File "C:\FreeCAD 0.19\Mod\Draft\DraftGui.py", line 196, in __init__
self.uiloader = FreeCADGui.UiLoader()
AttributeError: module 'FreeCADGui' has no attribute 'UiLoader
How could I do translate operation without GUI?
[Solved] translate object without GUI
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[Solved] translate object without GUI
Last edited by rluq on Fri May 27, 2022 9:20 pm, edited 1 time in total.
Re: translate object without GUI
Code: Select all
obj.Placement.translate(App.Vector(1, 2, 3))
Code: Select all
obj.Placement.Base = App.Vector(1, 2, 3)
Re: [Solved] translate object without GUI
Thank you for your answer, Roy_043!