32 lines
745 B
Python
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())
|