TestEIn 1.6h1 :

- modifiche a Special Componenti e Parti Piane.
This commit is contained in:
Dario Sassi
2015-08-04 19:30:06 +00:00
parent 23458242c3
commit 58a0f8df16
8 changed files with 306 additions and 42 deletions
+8 -2
View File
@@ -170,8 +170,9 @@ Public Class Component
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
Form1.LoadObjTree()
' Ritorno al contesto locale
EgtSetCurrentContext(Scene2.GetCtx())
' Chiudo il dialogo
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Function ExecCompoFile() As Boolean
@@ -255,12 +256,17 @@ Public Class Component
EgtEraseEmptyParts()
' eseguo inserimento
For i As Integer = 1 To nNbr
' Inserisco il componente
If Not EgtLuaExecLine(LUA_CMP_DRAW & "(false)") Then
Dim sErr As String = String.Empty
EgtLuaGetLastError(sErr)
EgtOutLog(sErr)
Exit For
End If
' Ne recupero l'Id
Dim nId2 As Integer = EgtGetLastPart()
' Lo posiziono in ordine
EgtPackPart(nId2, PACK_MAX_X, PACK_OFFS)
Next
' disabilito registrazione
EgtDisableCommandLogger()
+4
View File
@@ -38,4 +38,8 @@ Public Const TEMP_DIR As String = "Temp"
' Sottodirettorio di default per le macchine
Public Const MACHINES_DFL_DIR As String = "Machines"
' Costanti per Pack dei pezzi in Special
Public Const PACK_MAX_X As Double = 2500
Public Const PACK_OFFS As Double = 20
End Module
+121 -28
View File
@@ -2424,6 +2424,34 @@ Public Function EgtInvertCurve(ByVal nId As Integer) As Boolean
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtOffsetCurve")>
Private Function EgtOffsetCurve_32(ByVal nId As Integer, ByVal dDist As Double, ByVal nType As OFF_TYPE) As Boolean
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtOffsetCurve")>
Private Function EgtOffsetCurve_64(ByVal nId As Integer, ByVal dDist As Double, ByVal nType As OFF_TYPE) As Boolean
End Function
Public Function EgtOffsetCurve(ByVal nId As Integer, ByVal dDist As Double, ByVal nType As OFF_TYPE) As Boolean
If IntPtr.Size = 4 Then
Return EgtOffsetCurve_32(nId, dDist, nType)
Else
Return EgtOffsetCurve_64(nId, dDist, nType)
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtApproxCurve")>
Private Function EgtApproxCurve_32(ByVal nId As Integer, ByVal nApprType As Integer, ByVal dLinTol As Double) As Boolean
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtApproxCurve")>
Private Function EgtApproxCurve_64(ByVal nId As Integer, ByVal nApprType As Integer, ByVal dLinTol As Double) As Boolean
End Function
Public Function EgtApproxCurve(ByVal nId As Integer, ByVal nApprType As Integer, ByVal dLinTol As Double) As Boolean
If IntPtr.Size = 4 Then
Return EgtApproxCurve_32(nId, nApprType, dLinTol)
Else
Return EgtApproxCurve_64(nId, nApprType, dLinTol)
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtChangeClosedCurveStartPoint")>
Private Function EgtChangeClosedCurveStartPoint_32(ByVal nId As Integer, ByRef PtStart As Point3d, Optional ByVal nRefType As GDB_RT = GDB_RT.LOC) As Boolean
End Function
@@ -2564,20 +2592,6 @@ Public Function EgtSplitCurveAtPoint(ByVal nId As Integer, ByRef PtOn As Point3d
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtOffsetCurve")>
Private Function EgtOffsetCurve_32(ByVal nId As Integer, ByVal dDist As Double, ByVal nType As OFF_TYPE) As Boolean
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtOffsetCurve")>
Private Function EgtOffsetCurve_64(ByVal nId As Integer, ByVal dDist As Double, ByVal nType As OFF_TYPE) As Boolean
End Function
Public Function EgtOffsetCurve(ByVal nId As Integer, ByVal dDist As Double, ByVal nType As OFF_TYPE) As Boolean
If IntPtr.Size = 4 Then
Return EgtOffsetCurve_32(nId, dDist, nType)
Else
Return EgtOffsetCurve_64(nId, dDist, nType)
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtModifyCircleCP")>
Private Function EgtModifyCircleCP_32(ByVal nId As Integer, ByRef PtOn As Point3d, Optional ByVal nRefType As GDB_RT = GDB_RT.LOC) As Boolean
End Function
@@ -2648,20 +2662,6 @@ Public Function EgtExplodeCurveCompo(ByVal nId As Integer, ByRef nCount As Integ
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtApproxCurve")>
Private Function EgtApproxCurve_32(ByVal nId As Integer, ByVal nApprType As Integer, ByVal dLinTol As Double) As Integer
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtApproxCurve")>
Private Function EgtApproxCurve_64(ByVal nId As Integer, ByVal nApprType As Integer, ByVal dLinTol As Double) As Integer
End Function
Public Function EgtApproxCurve(ByVal nId As Integer, ByVal nApprType As Integer, ByVal dLinTol As Double) As Integer
If IntPtr.Size = 4 Then
Return EgtApproxCurve_32(nId, nApprType, dLinTol)
Else
Return EgtApproxCurve_64(nId, nApprType, dLinTol)
End If
End Function
'---------- GeomDb Surfaces Modify ---------------------------------------------
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtInvertSurface")>
@@ -2806,6 +2806,34 @@ Public Function EgtGetNextPart(ByVal nPartId As Integer, Optional ByVal bOnlyVis
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetLastPart")>
Private Function EgtGetLastPart_32(Optional ByVal bOnlyVisible As Boolean = False) As Integer
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetLastPart")>
Private Function EgtGetLastPart_64(Optional ByVal bOnlyVisible As Boolean = False) As Integer
End Function
Public Function EgtGetLastPart(Optional ByVal bOnlyVisible As Boolean = False) As Integer
If IntPtr.Size = 4 Then
Return EgtGetLastPart_32(bOnlyVisible)
Else
Return EgtGetLastPart_64(bOnlyVisible)
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetPrevPart")>
Private Function EgtGetPrevPart_32(ByVal nPartId As Integer, Optional ByVal bOnlyVisible As Boolean = False) As Integer
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetPrevPart")>
Private Function EgtGetPrevPart_64(ByVal nPartId As Integer, Optional ByVal bOnlyVisible As Boolean = False) As Integer
End Function
Public Function EgtGetPrevPart(ByVal nPartId As Integer, Optional ByVal bOnlyVisible As Boolean = False) As Integer
If IntPtr.Size = 4 Then
Return EgtGetPrevPart_32(nPartId, bOnlyVisible)
Else
Return EgtGetPrevPart_64(nPartId, bOnlyVisible)
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetFirstLayer")>
Private Function EgtGetFirstLayer_32(ByVal nPartId As Integer, Optional ByVal bOnlyVisible As Boolean = False) As Integer
End Function
@@ -2834,6 +2862,35 @@ Public Function EgtGetNextLayer(ByVal nLayerId As Integer, Optional ByVal bOnlyV
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetLastLayer")>
Private Function EgtGetLastLayer_32(ByVal nPartId As Integer, Optional ByVal bOnlyVisible As Boolean = False) As Integer
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetLastLayer")>
Private Function EgtGetlastLayer_64(ByVal nPartId As Integer, Optional ByVal bOnlyVisible As Boolean = False) As Integer
End Function
Public Function EgtGetLastLayer(ByVal nPartId As Integer, Optional ByVal bOnlyVisible As Boolean = False) As Integer
If IntPtr.Size = 4 Then
Return EgtGetLastLayer_32(nPartId, bOnlyVisible)
Else
Return EgtGetlastLayer_64(nPartId, bOnlyVisible)
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetPrevLayer")>
Private Function EgtGetPrevLayer_32(ByVal nLayerId As Integer, Optional ByVal bOnlyVisible As Boolean = False) As Integer
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetPrevLayer")>
Private Function EgtGetPrevLayer_64(ByVal nLayerId As Integer, Optional ByVal bOnlyVisible As Boolean = False) As Integer
End Function
Public Function EgtGetPrevLayer(ByVal nLayerId As Integer, Optional ByVal bOnlyVisible As Boolean = False) As Integer
If IntPtr.Size = 4 Then
Return EgtGetPrevLayer_32(nLayerId, bOnlyVisible)
Else
Return EgtGetPrevLayer_64(nLayerId, bOnlyVisible)
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtEraseEmptyParts")>
Private Function EgtEraseEmptyParts_32() As Boolean
End Function
@@ -4587,6 +4644,36 @@ Private Function EgtVectorToIdLoc(ByRef VtV As Vector3d, ByVal nId As Integer) A
End Function
'---------- Nestings -----------------------------------------------------------
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtCreateFlatParts")>
Private Function EgtCreateFlatParts_32(ByVal nType As Integer) As Boolean
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtCreateFlatParts")>
Private Function EgtCreateFlatParts_64(ByVal nType As Integer) As Boolean
End Function
Public Function EgtCreateFlatParts(ByVal nType As Integer) As Boolean
If IntPtr.Size = 4 Then
Return EgtCreateFlatParts_32(nType)
Else
Return EgtCreateFlatParts_64(nType)
End If
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtPackPart")>
Private Function EgtPackPart_32(ByVal nId As Integer, ByVal dXmax As Double, ByVal dOffs As Double) As Boolean
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtPackPart")>
Private Function EgtPackPart_64(ByVal nId As Integer, ByVal dXmax As Double, ByVal dOffs As Double) As Boolean
End Function
Public Function EgtPackPart(ByVal nId As Integer, ByVal dXmax As Double, ByVal dOffs As Double) As Boolean
If IntPtr.Size = 4 Then
Return EgtPackPart_32(nId, dXmax, dOffs)
Else
Return EgtPackPart_64(nId, dXmax, dOffs)
End If
End Function
'---------- Machinings ---------------------------------------------------------
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtInitMachMgr")>
Private Function EgtInitMachMgr_32(ByVal sMachinesDir As String) As Boolean
@@ -5987,5 +6074,11 @@ Public Enum INS_POS As Integer
End Enum
'Costanti : interruzione di riga
Public Const LINE_BREAK As String = "<br/>"
'Costanti : tipo creazione pezzo piatto
Public Enum FPC_TYPE As Integer
REGION = 1
LAYER = 2
NGE = 3
End Enum
End Module
+63 -2
View File
@@ -32,8 +32,14 @@ Partial Class FlatParts
Me.TableLayoutPanel2 = New System.Windows.Forms.TableLayoutPanel()
Me.rbMm = New System.Windows.Forms.RadioButton()
Me.rbInch = New System.Windows.Forms.RadioButton()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.btnReset = New System.Windows.Forms.Button()
Me.btnUseLayer = New System.Windows.Forms.Button()
Me.btnUseRegion = New System.Windows.Forms.Button()
Me.btnInsert = New System.Windows.Forms.Button()
Me.TableLayoutPanel1.SuspendLayout()
Me.TableLayoutPanel2.SuspendLayout()
Me.Panel1.SuspendLayout()
Me.SuspendLayout()
'
'TableLayoutPanel1
@@ -45,14 +51,15 @@ Partial Class FlatParts
Me.TableLayoutPanel1.Controls.Add(Me.tbCurrDir, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.ListView1, 0, 1)
Me.TableLayoutPanel1.Controls.Add(Me.TableLayoutPanel2, 1, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Panel1, 1, 2)
Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 0)
Me.TableLayoutPanel1.Margin = New System.Windows.Forms.Padding(0)
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
Me.TableLayoutPanel1.RowCount = 3
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26.0!))
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 69.0821228!))
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30.9178791!))
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 69.08212!))
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30.91788!))
Me.TableLayoutPanel1.Size = New System.Drawing.Size(744, 414)
Me.TableLayoutPanel1.TabIndex = 0
'
@@ -152,6 +159,54 @@ Partial Class FlatParts
Me.rbInch.Text = "Inch"
Me.rbInch.UseVisualStyleBackColor = False
'
'Panel1
'
Me.Panel1.Controls.Add(Me.btnReset)
Me.Panel1.Controls.Add(Me.btnUseLayer)
Me.Panel1.Controls.Add(Me.btnUseRegion)
Me.Panel1.Controls.Add(Me.btnInsert)
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
Me.Panel1.Location = New System.Drawing.Point(203, 297)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(538, 114)
Me.Panel1.TabIndex = 11
'
'btnReset
'
Me.btnReset.Location = New System.Drawing.Point(219, 52)
Me.btnReset.Name = "btnReset"
Me.btnReset.Size = New System.Drawing.Size(75, 23)
Me.btnReset.TabIndex = 3
Me.btnReset.Text = "Reset"
Me.btnReset.UseVisualStyleBackColor = True
'
'btnUseLayer
'
Me.btnUseLayer.Location = New System.Drawing.Point(219, 23)
Me.btnUseLayer.Name = "btnUseLayer"
Me.btnUseLayer.Size = New System.Drawing.Size(75, 23)
Me.btnUseLayer.TabIndex = 2
Me.btnUseLayer.Text = "Use Layer"
Me.btnUseLayer.UseVisualStyleBackColor = True
'
'btnUseRegion
'
Me.btnUseRegion.Location = New System.Drawing.Point(300, 23)
Me.btnUseRegion.Name = "btnUseRegion"
Me.btnUseRegion.Size = New System.Drawing.Size(75, 23)
Me.btnUseRegion.TabIndex = 1
Me.btnUseRegion.Text = "Use Region"
Me.btnUseRegion.UseVisualStyleBackColor = True
'
'btnInsert
'
Me.btnInsert.Location = New System.Drawing.Point(300, 52)
Me.btnInsert.Name = "btnInsert"
Me.btnInsert.Size = New System.Drawing.Size(75, 23)
Me.btnInsert.TabIndex = 0
Me.btnInsert.Text = "Insert"
Me.btnInsert.UseVisualStyleBackColor = True
'
'FlatParts
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -169,6 +224,7 @@ Partial Class FlatParts
Me.TableLayoutPanel1.PerformLayout()
Me.TableLayoutPanel2.ResumeLayout(False)
Me.TableLayoutPanel2.PerformLayout()
Me.Panel1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
@@ -180,4 +236,9 @@ End Sub
Friend WithEvents rbMm As System.Windows.Forms.RadioButton
Friend WithEvents TableLayoutPanel2 As System.Windows.Forms.TableLayoutPanel
Friend WithEvents rbInch As System.Windows.Forms.RadioButton
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Friend WithEvents btnInsert As System.Windows.Forms.Button
Friend WithEvents btnUseRegion As System.Windows.Forms.Button
Friend WithEvents btnUseLayer As System.Windows.Forms.Button
Friend WithEvents btnReset As System.Windows.Forms.Button
End Class
+1 -1
View File
@@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACy
FQAAAk1TRnQBSQFMAgEBBAEAAbgBAAG4AQABIAEAASABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAGA
FQAAAk1TRnQBSQFMAgEBBAEAAeABAAHgAQABIAEAASABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAGA
AwABQAMAAQEBAAEYBgABYP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
/wD/AP8A/wCQAAP+PP0D/v8APAAD/gP7PPgD+wP9mQAh6X4AAckB1wHlAZgBsQHHAZgBsQHHAZgBrwHH
+103 -7
View File
@@ -8,6 +8,7 @@ Public Class FlatParts
' Properties
Private m_sCurrDir As String = String.Empty
Private m_sCurrFile As String = String.Empty
Private m_nFileType As Integer = FT.NULL
Private Sub FlatParts_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
' imposto colore di default
@@ -156,10 +157,13 @@ Public Class FlatParts
ListView1.Items.Add(DirI.Name, 2)
Next
' elenco dei file
Dim vFileI As FileInfo() = DirInfo.GetFiles("*.dxf")
Dim vFileI As FileInfo() = DirInfo.GetFiles()
Dim FileI As FileInfo
For Each FileI In vFileI
ListView1.Items.Add(FileI.Name, 3)
Dim sExt As String = Path.GetExtension(FileI.Name).ToUpper()
If sExt = ".DXF" Or sExt = ".NGE" Then
ListView1.Items.Add(FileI.Name, 3)
End If
Next
' Fine aggiornamento lista
ListView1.EndUpdate()
@@ -195,21 +199,113 @@ Public Class FlatParts
EgtNewFile()
' Eseguo zoom
Scene2.ZoomAll()
' disabilito bottoni Process e Insert
btnUseLayer.Enabled = False
btnUseRegion.Enabled = False
btnReset.Enabled = False
btnInsert.Enabled = False
Return True
End Function
Private Function LoadCurrFile() As Boolean
' Pulisco il DB geometrico locale
EgtNewFile()
Dim bOk As Boolean = EgtNewFile()
' Costruisco path completa del componente
Dim sPath = IO.Path.Combine(m_sCurrDir, m_sCurrFile)
' recupero unità di misura del file
Dim dScale As Double = If(rbMm.Checked(), ONEMM, ONEINCH)
' Importo file DXF
Dim bOk As Boolean = EgtImportDxf(sPath, dScale)
' Riconoscimento tipo
m_nFileType = EgtGetFileType(sPath)
If m_nFileType = FT.DXF Then
' recupero unità di misura del file
Dim dScale As Double = If(rbMm.Checked(), ONEMM, ONEINCH)
' Importo file DXF
bOk = bOk AndAlso EgtImportDxf(sPath, dScale)
ElseIf m_nFileType = FT.NGE Then
' Carico Nge
bOk = bOk AndAlso EgtOpenFile(sPath)
Else
' Formato sconosciuto
EgtNewFile()
bOk = False
End If
' Eseguo zoom
Scene2.ZoomAll()
' abilito bottoni UseLayer e UseRegion, disabilito Reset e Insert
btnUseLayer.Enabled = True
btnUseRegion.Enabled = True
btnReset.Enabled = False
btnInsert.Enabled = False
Return bOk
End Function
Private Sub btnUseLayer_Click(sender As Object, e As EventArgs) Handles btnUseLayer.Click
' Creo i pezzi
Dim nType As Integer = If(m_nFileType = FT.NGE, FPC_TYPE.NGE, FPC_TYPE.LAYER)
EgtCreateFlatParts(nType)
' Eseguo zoom
Scene2.ZoomAll()
' disabilito bottoni UseLayer e UseRegion, abilito bottoni Reset e Insert
btnUseLayer.Enabled = False
btnUseRegion.Enabled = False
btnReset.Enabled = True
btnInsert.Enabled = True
End Sub
Private Sub btnUseRegion_Click(sender As Object, e As EventArgs) Handles btnUseRegion.Click
' Creo i pezzi
Dim nType As Integer = If(m_nFileType = FT.NGE, FPC_TYPE.NGE, FPC_TYPE.REGION)
EgtCreateFlatParts(nType)
' Eseguo zoom
Scene2.ZoomAll()
' disabilito bottoni UseLayer e UseRegion, abilito bottoni Reset e Insert
btnUseLayer.Enabled = False
btnUseRegion.Enabled = False
btnReset.Enabled = True
btnInsert.Enabled = True
End Sub
Private Sub btnReset_Click(sender As Object, e As EventArgs) Handles btnReset.Click
' Ricarico file corrente
LoadCurrFile()
End Sub
Private Sub btnInsert_Click(sender As Object, e As EventArgs) Handles btnInsert.Click
' Vettore nomi file temporanei
Dim sTmpFiles As New ArrayList()
' Ciclo di salvataggio dei pezzi
Dim nId As Integer = EgtGetFirstPart()
While nId <> GDB_ID.NULL
' Esporto il pezzo in un file temporaneo
Dim sTmpFile As String = Form1.GetTempDir() & "\FlatPart" & nId & ".Nge"
sTmpFiles.Add(sTmpFile)
If Not EgtSaveObjToFile(nId, sTmpFile, NGE.BIN) Then
Return
End If
' Passo al pezzo successivo
nId = EgtGetNextPart(nId)
End While
' Passo al contesto principale
EgtSetCurrentContext(Form1.GetCtx())
' Elimino eventuali precedenti pezzi vuoti
EgtEraseEmptyParts()
' Ciclo di caricamento dei pezzi
For Each sTmpfile As String In sTmpFiles
If My.Computer.FileSystem.FileExists(sTmpfile) Then
' Inserisco il pezzo
EgtInsertFile(sTmpfile)
' Ne recupero l'Id
Dim nId2 As Integer = EgtGetLastPart()
' Lo posiziono in ordine
EgtPackPart(nId2, PACK_MAX_X, PACK_OFFS)
' Cancello il file
My.Computer.FileSystem.DeleteFile(sTmpfile)
End If
Next
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
Form1.LoadObjTree()
' Chiudo il dialogo
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Close()
End Sub
End Class
+4
View File
@@ -57,6 +57,10 @@ Public Class Form1
Return m_sMachinesRoot
End Function
Public Function GetTempDir() As String
Return m_sTempDir
End Function
Public Function GetIniFile() As String
Return m_sIniFile
End Function
+2 -2
View File
@@ -46,5 +46,5 @@ Imports System.Runtime.InteropServices
' utilizzando l'asterisco (*) come descritto di seguito:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.6.7.8")>
<Assembly: AssemblyFileVersion("1.6.7.8")>
<Assembly: AssemblyVersion("1.6.8.1")>
<Assembly: AssemblyFileVersion("1.6.8.1")>