FreeCAD workbench to create assembly handbooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
864 B

import FreeCADGui as Gui
import FreeCAD as App
import ahb_utils
class AHB_SetViewDirection:
def GetResources(self):
return {"MenuText": "Set view direction",
"ToolTip": "Applies the current 3D view direction on the selected TechDraw view",
"Pixmap": ""
}
def IsActive(self):
return ahb_utils.getCurrentView() is not None
def Activated(self):
workbench = Gui.getWorkbench("AssemblyHandbookWorkbench") #: :type workbench: AssemblyHandbookWorkbench
view = ahb_utils.getCurrentView()
if view is None:
raise Exception("Please select a TechDraw view")
workbench.techDrawExtensions.setCurrentViewDirection(view)
from ahb_command import AHB_CommandWrapper
AHB_CommandWrapper.addGuiCommand('AHB_view_set_direction', AHB_SetViewDirection())