From d0c8e3e88b75a91e27da22f2fdbfcacd33256a59 Mon Sep 17 00:00:00 2001 From: NicolaP Date: Mon, 28 Feb 2022 15:41:44 +0100 Subject: [PATCH] Migliorata gestione GUID (per rotazione) da CSV (Inserisci/Rimuovi), NGE, DXF --- CadCuts/CSVPage.xaml.vb | 10 +++++++++- DrawImport/ImportPageUC.xaml.vb | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CadCuts/CSVPage.xaml.vb b/CadCuts/CSVPage.xaml.vb index 15269dc..1a60c44 100644 --- a/CadCuts/CSVPage.xaml.vb +++ b/CadCuts/CSVPage.xaml.vb @@ -643,6 +643,11 @@ Public Class CSVPage ' assegno l'identificatico del pezzo, se esiste If Not String.IsNullOrEmpty(CurrPart.m_sRefGuid) Then + ' GuidCode dovrebbe contenere 36 caratteri, il precode 5: tot = 41 + If CurrPart.m_sRefGuid.Count <= 36 Then + Dim sPreGuid As String = CreatePreGuidCode(CurrPart.m_nId) + CurrPart.m_sRefGuid = sPreGuid & CurrPart.m_sRefGuid + End If EgtSetInfo(CurrPart.m_nId, INFO_REFGROUP, CurrPart.m_sRefGuid) End If Dim nRegLayId As Integer = EgtGetFirstNameInGroup(CurrPart.m_nId, NAME_REGION) @@ -774,10 +779,13 @@ Public Class CSVPage ' Rimuovo dal grezzo EgtRemovePartFromRawPart(nId) End If + ' recupero il Guid del pezzo corrente (potrebbe essere stato modificato a causa di rotazioni quando il pezzo รจ passato in parcheggio) + Dim sCurrRefGuid As String = String.Empty + EgtGetInfo(nId, INFO_REFGROUP, sCurrRefGuid) ' Cancello il pezzo EgtErase(nId) ' aggiorno il layer che indica il numero di pezzi in parcheggio (se sRefGroup<>"") - m_MainWindow.m_CadCutPageUC.m_NestPage.CountPartInFamily(CurrPart.m_sRefGuid) + m_MainWindow.m_CadCutPageUC.m_NestPage.CountPartInFamily(sCurrRefGuid) ' Aggiorno il contatore CurrPart.m_nToNest += 1 ' ricreo la lista delle famiglie di pezzi presenti in parcheggio diff --git a/DrawImport/ImportPageUC.xaml.vb b/DrawImport/ImportPageUC.xaml.vb index 9c647e2..fcbe161 100644 --- a/DrawImport/ImportPageUC.xaml.vb +++ b/DrawImport/ImportPageUC.xaml.vb @@ -900,7 +900,8 @@ Public Class ImportPageUC EgtSetInfo(nId, INFO_SOU_PATH, IO.Path.Combine(m_sCurrDir, m_sCurrFile)) ' assegno l'identificatico del pezzo, se esiste If Not String.IsNullOrEmpty(sGUICode) Then - EgtSetInfo(nId, INFO_REFGROUP, sGUICode) + Dim sPreGuid As String = CreatePreGuidCode(nId) + EgtSetInfo(nId, INFO_REFGROUP, sPreGuid & sGUICode) End If ' Inserisco in parcheggio m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True)