diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index 1badb846..2110f091 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -928,8 +928,15 @@ Public Class LeftPanelVM Case MCH_CR.BR dPosX = WallMachGroup.dL - PartToAdd.dL - dPosX End Select + ' calcolo box del pezzo e del suo layer box per compensare la eventuale differenza + Dim b3Part As New BBox3d + EgtGetBBoxGlob(nPartDuploId, GDB_BB.STANDARD, b3Part) + Dim b3Box As New BBox3d + Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartDuploId, "Box") + EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box) + Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min ' aggiungo il pezzo al grezzo - If EgtAddPartToRawPart(nPartDuploId, New Point3d(dPosX, dPosY, 0), WallMachGroup.MyMachGroupM.nRawPartId) Then + If EgtAddPartToRawPart(nPartDuploId, New Point3d(dPosX - vtDeltaBox.x, dPosY - vtDeltaBox.y, 0 - vtDeltaBox.z), WallMachGroup.MyMachGroupM.nRawPartId) Then EgtSetInfo(nPartDuploId, MGR_PRT_POSX, dPosX) EgtSetInfo(nPartDuploId, MGR_PRT_POSY, dPosY) EgtSetInfo(nPartDuploId, MGR_PRT_ROT, PartToAdd.nROTATED) diff --git a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb index d801942f..e4f557bd 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/MachGroupPanel/PartVM.vb @@ -213,7 +213,7 @@ Public Class PartVM ' calcolo distanza tra i box Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min ' reinserisco il pezzo nel grezzo - EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId) + EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0 - vtDeltaBox.z), ParentMachGroupVM.MyMachGroupM.nRawPartId) ' lo riseleziono EgtSelectObj(nPartId) ' resetto validazione del pezzo diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb index 6d66aba7..f6e57bf7 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjManager/ProjManagerVM.vb @@ -1484,7 +1484,13 @@ Public Class ProjManagerVM ' creo cartella temporanea di estrazione in Temp Dim sProjectimportDir As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\ProjectImport" If Directory.Exists(sProjectimportDir) Then - Directory.Delete(sProjectimportDir, True) + Try + Directory.Delete(sProjectimportDir, True) + Catch ex As Exception + EgtOutLog("Delete old import project failed!") + MessageBox.Show("Importazione Fallita!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error) + Return + End Try End If Directory.CreateDirectory(sProjectimportDir) Try