ac8a3885e2
- primo rilascio.
37 lines
1.3 KiB
VB.net
37 lines
1.3 KiB
VB.net
Imports EgtUILib.EgtInterface
|
|
|
|
Public Class cmdExport
|
|
|
|
Private m_nContext As Integer
|
|
|
|
Sub New()
|
|
InitializeComponent()
|
|
m_nContext = 1
|
|
End Sub
|
|
|
|
Public Sub SetCtx(ByVal nCtx As Integer)
|
|
m_nContext = nCtx
|
|
End Sub
|
|
|
|
Private Sub btnExport_Click(sender As System.Object, e As System.EventArgs) Handles btnExport.Click
|
|
ExportFileDialog.Title = "Export"
|
|
ExportFileDialog.Filter = "Drawing Exchange Fmt(*.dxf)|*.dxf|Stereolithography (*.stl)|*.stl|All Files (*.*)|*.*"
|
|
ExportFileDialog.FilterIndex = 1
|
|
If ExportFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
|
Dim nFileType As Integer = EgtGetFileType(ExportFileDialog.FileName)
|
|
If nFileType = FT_DXF Then
|
|
Cursor = Cursors.WaitCursor
|
|
EgtExportDxf(m_nContext, GDB_ID_ROOT, ExportFileDialog.FileName)
|
|
Cursor = Cursors.Default
|
|
ElseIf nFileType = FT_STL Then
|
|
Cursor = Cursors.WaitCursor
|
|
EgtExportStl(m_nContext, GDB_ID_ROOT, ExportFileDialog.FileName)
|
|
Cursor = Cursors.Default
|
|
Else
|
|
MessageBox.Show("File type unknown", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
End Class
|