kiconnect/freecad/kiconnect/commands/cmd_new_pcb.py
Morgan 'ARR\!' Allen c4c2b80892 thatsa workbench
2025-03-28 23:11:13 -07:00

32 lines
745 B
Python

import os
import sys
import kipy
import FreeCADGui as Gui
import FreeCAD as App
from .. import settings
from ..project import Project
class New:
def GetResources(self):
tooltip = '<p>Create new KiCAD Project</p>'
iconFile = os.path.join(settings.ICONPATH, 'add_board.svg')
return {'MenuText': 'New KiCAD Project', 'ToolTip': tooltip, 'Pixmap' : iconFile }
def Activated(self):
if App.ActiveDocument is None:
App.newDocument()
App.ActiveDocument.openTransaction('kiconnect_new')
kiconnect = Project()
App.ActiveDocument.recompute()
Gui.SendMsgToActiveView("ViewFit")
App.ActiveDocument.commitTransaction()
Gui.addCommand('kiconn_new', New())