ac8a3885e2
- primo rilascio.
39 lines
1.3 KiB
VB.net
39 lines
1.3 KiB
VB.net
Imports EgtUILib.EgtInterface
|
|
|
|
Public Class cmdImport
|
|
|
|
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 btnImport_Click(sender As System.Object, e As System.EventArgs) Handles btnImport.Click
|
|
If ImportFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
|
Dim nFileType As Integer = EgtGetFileType(ImportFileDialog.FileName)
|
|
If nFileType = FT_DXF Then
|
|
Cursor = Cursors.WaitCursor
|
|
EgtNewFile(m_nContext)
|
|
If EgtImportDxf(m_nContext, ImportFileDialog.FileName) Then
|
|
EgtZoom(m_nContext, ZM_ALL, True)
|
|
End If
|
|
Cursor = Cursors.Default
|
|
ElseIf nFileType = FT_STL Then
|
|
Cursor = Cursors.WaitCursor
|
|
EgtNewFile(m_nContext)
|
|
If EgtImportStl(m_nContext, ImportFileDialog.FileName) Then
|
|
EgtZoom(m_nContext, ZM_ALL, True)
|
|
End If
|
|
Cursor = Cursors.Default
|
|
Else
|
|
MessageBox.Show("File type unknown", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
End Class |