diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb index 3cc4640..061faa4 100644 --- a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb +++ b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb @@ -412,6 +412,9 @@ Namespace EgtCAM5 ''' Creata the new tool. This method is invoked by the NewCommand. ''' Public Sub Generate(ByVal param As Object) + ' Recupero la fase corrente + Dim nPhase As Integer = EgtGetCurrPhase() + ' Eseguo Dim sCurrFilePath As String = String.Empty EgtGetCurrFilePath(sCurrFilePath) If String.IsNullOrEmpty(sCurrFilePath) OrElse EgtGetModified() Then @@ -439,8 +442,12 @@ Namespace EgtCAM5 Else Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 32)) End If - ' Torno alla prima fase - EgtSetCurrPhase(1, True) + ' Torno alla fase originale (o alla prima se non definita) + If nPhase = 0 Then + EgtSetCurrPhase(1, True) + Else + EgtSetCurrPhase(nPhase, True) + End If End Sub #End Region ' GenerateCommand