From bc59d9e357eb7ac64c7a3118c01ad5920599fa22 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 8 Jun 2026 19:42:40 +0200 Subject: [PATCH] =?UTF-8?q?EgtCAM5=20:=20-=20aggiunta=20possibilit=C3=A0?= =?UTF-8?q?=20di=20scegliere=20path=20del=20partprogram=20premendo=20CTRL+?= =?UTF-8?q?genera=20(come=20Icarus).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SimulationExpanderVM.vb | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb index 52d5948..65994d4 100644 --- a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb +++ b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb @@ -91,6 +91,27 @@ Public Class SimulationExpanderVM ' Verifico se richiesta anche visualizzazione del CN Dim bNcView As Boolean = ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) + ' Verifico se richiesto anche nome del CN + Dim bNcName As Boolean = ((Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control) + If bNcName Then + Dim sExt As String = ".cnc" + EgtUILib.GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, sExt, sExt, IniFile.m_sCurrMachIniFilePath) + Dim sCurrFilePath As String = "" + Dim sInitDir As String = "" + EgtGetCurrFilePath(sCurrFilePath) + If Not IsNothing(sCurrFilePath) Then sInitDir = System.IO.Path.ChangeExtension(sCurrFilePath, sExt) + Dim NewSaveFileDialog As New Windows.Forms.SaveFileDialog With {.Title = "PartProgram File Name", + .Filter = "|*" & sExt, + .FilterIndex = 1, + .InitialDirectory = System.IO.Path.GetDirectoryName(sInitDir), + .FileName = sInitDir, + .CreatePrompt = True, + .OverwritePrompt = True, + .ValidateNames = False} + If NewSaveFileDialog.ShowDialog() = Forms.DialogResult.Cancel Then Return + EgtSetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_NCNAME, NewSaveFileDialog.FileName) + End If + ' Recupero la fase corrente Dim nPhase As Integer = EgtGetCurrPhase() ' Aggiorno le lavorazioni @@ -449,7 +470,10 @@ Public Class SimulationExpanderVM sInfo = "EgtCAM5 ver." & Map.refMainWindowVM.Version() & " - " & sCurrFilePath #End If If EgtGetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_NCNAME, sCncFile) AndAlso Not String.IsNullOrWhiteSpace(sCncFile) Then - sCncFile = Path.GetDirectoryName(sCurrFilePath) & "\" & Path.GetFileName(sCncFile) + Dim sFileDir As String = Path.GetDirectoryName( sCncFile) + If String.IsNullOrWhiteSpace(sFileDir) OrElse Not My.Computer.FileSystem.DirectoryExists(sFileDir) Then + sCncFile = Path.GetDirectoryName(sCurrFilePath) & "\" & Path.GetFileName(sCncFile) + End If Else sCncFile = Path.ChangeExtension(sCurrFilePath, Nothing) If IniFile.m_bMachiningGroup Then @@ -459,7 +483,7 @@ Public Class SimulationExpanderVM sInfo &= "-" & sMGrpName End If End If - Dim sExt As String = ".cnc" + Dim sExt As String = ".cnc" EgtUILib.GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, sExt, sExt, IniFile.m_sCurrMachIniFilePath) sCncFile = Path.ChangeExtension(sCncFile, sExt) End If