def Run( self ):
fileName = GetBoard().GetFileName()
if len(fileName)==0:
wx.LogMessage("a board needs to be saved/loaded!")
else:
dirpath = os.path.abspath(os.path.expanduser(fileName))
path, fname = os.path.split(dirpath)
ext = os.path.splitext(os.path.basename(fileName))[1]
name = os.path.splitext(os.path.basename(fileName))[0]
LogMsg="reading from "+ dirpath
out_filename=path+os.sep+name+".dxf"
LogMsg+="writing to "+out_filename
content=[]
txtFile = open(fileName,"r")
content = txtFile.readlines()
content.append(" ")
txtFile.close()
#wx.MessageDialog(None, 'This is a message box. ONLY TEST!', 'Test', wx.OK | wx.ICON_INFORMATION).ShowModal()
#wx.MessageDialog(None, 'This is a message box. ONLY TEST!', content, wx.OK | wx.ICON_INFORMATION).ShowModal()
#found_selected=False
#board = pcbnew.GetBoard()
dlg=wx.MessageBox( 'Only SAVED board file will be exported to DXF file', 'Confirm', wx.OK | wx.CANCEL | wx.ICON_INFORMATION )
if dlg == wx.OK:
if os.path.isfile(out_filename):
dlg=wx.MessageBox( 'Overwrite DXF file?', 'Confirm', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION )
if dlg == wx.YES:
export_dxf(content, out_filename)
else:
export_dxf(content, out_filename)
评论列表
文章目录