From beea154999278d6ebb1b650444b51a76cc6b290a Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 14 May 2025 10:47:10 +0200 Subject: [PATCH] =?UTF-8?q?EgtDoorCreator=202.7e2=20:=20-=20migliorie=20pe?= =?UTF-8?q?r=20visualizzazione=20decori=20da=20file=20nge=20(rimane=20da?= =?UTF-8?q?=20sistemare=20caso=20con=20pi=C3=B9=20layer).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DoorParameters/Part.vb | 15 ++++++++++++--- MainWindow/MainWindowModel.vb | 4 ++-- My Project/AssemblyInfo.vb | 4 ++-- SceneManager/SceneManagerVM.vb | 32 ++++++++++++++++++++++++-------- 4 files changed, 40 insertions(+), 15 deletions(-) diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 9328422..e01916d 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -1547,13 +1547,22 @@ Public Class Part Dim IndexLay As Integer = 0 While nIdLay <> GDB_ID.NULL Dim sInfoPath As String = String.Empty - If EgtGetInfo(nIdLay, "Path", sInfoPath) Then + If Not EgtGetInfo(nIdLay, "Path", sInfoPath) Then + Dim sFileName As String = String.Empty + Dim sFileDir As String = String.Empty + If EgtGetInfo(nIdLay, "CustGeomFile", sFileName) AndAlso + EgtGetInfo(nIdLay, "CustGeomPath", sFileDir) Then + sInfoPath = sFileDir & sFileName + End If + End If + If Not String.IsNullOrWhiteSpace( sInfoPath) Then Dim sNamePath As String = sInfoPath - If sNamePath.Contains(sCompoName) And sNamePath.Contains(sDirCompo) And IndexLay = IndexInList Then + If sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 AndAlso + sInfoPath.IndexOf( sDirCompo, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay = IndexInList Then EgtSetMark(nIdLay) m_SelCompo.SetMark() Exit While - ElseIf sNamePath.Contains(sCompoName) And IndexLay < IndexInList Then + ElseIf sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay < IndexInList Then IndexLay = IndexLay + 1 End If End If diff --git a/MainWindow/MainWindowModel.vb b/MainWindow/MainWindowModel.vb index 2f6b969..dbb7f43 100644 --- a/MainWindow/MainWindowModel.vb +++ b/MainWindow/MainWindowModel.vb @@ -71,8 +71,8 @@ Friend Class MainWindowModel EgtSetLockId(sLockId) End If ' Recupero livello e opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(3279, 2704, 1, IniFile.m_nKeyLevel) And - EgtGetKeyOptions(3279, 2704, 1, IniFile.m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(3279, 2705, 1, IniFile.m_nKeyLevel) And + EgtGetKeyOptions(3279, 2705, 1, IniFile.m_nKeyOptions) ' Leggo e imposto livello utilizzatore IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1)) 'Inizializzazione generale di EgtInterface diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index dfd7016..bc12e7b 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -72,5 +72,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/SceneManager/SceneManagerVM.vb b/SceneManager/SceneManagerVM.vb index 4868a94..bbc3e4b 100644 --- a/SceneManager/SceneManagerVM.vb +++ b/SceneManager/SceneManagerVM.vb @@ -490,10 +490,21 @@ Public Class SceneManagerVM Dim sCompoName As String = CurrCompo.TemplateSelItem ' recupero il nome della componente selezionata con MouseOver Dim sInfoPath As String = String.Empty - If Not EgtGetInfo(nIdLay, "Path", sInfoPath) Then Return False + If Not EgtGetInfo(nIdLay, "Path", sInfoPath) Then + Dim sFileName As String = String.Empty + Dim sFileDir As String = String.Empty + If EgtGetInfo(nIdLay, "CustGeomFile", sFileName) AndAlso + EgtGetInfo(nIdLay, "CustGeomPath", sFileDir) Then + sInfoPath = sFileDir & sFileName + Else + Return False + End If + End If ' verifico validità - If Not ( sInfoPath.Contains(sCompoName) AndAlso sInfoPath.Contains(sDirCompo)) Then Return False - + If Not ( sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 AndAlso + sInfoPath.IndexOf( sDirCompo, StringComparison.InvariantCultureIgnoreCase) >= 0) Then + Return False + End If ' recupero la lista dei compo dello stesso tipo Dim TempList As ObservableCollection(Of Compo) = DdfFile.GetCurrentListSameCompoType(CompoList, CurrCompo.CompoType.DDFName) ' recupero la lista dei compo con lo stesso nome @@ -507,24 +518,29 @@ Public Class SceneManagerVM While nCurrLayId <> GDB_ID.NULL nCurrLayId = EgtGetNext(nCurrLayId) Dim LocalsPath As String = String.Empty - If EgtGetInfo(nCurrLayId, "Path", LocalsPath) AndAlso - sInfoPath.Trim = LocalsPath.Trim Then + Dim LocalsName As String = String.Empty + Dim LocalsDir As String = String.Empty + If ( EgtGetInfo(nCurrLayId, "Path", LocalsPath) AndAlso + sInfoPath.Trim = LocalsPath.Trim) OrElse + ( EgtGetInfo(nCurrLayId, "CustGeomFile", LocalsName) AndAlso + EgtGetInfo(nCurrLayId, "CustGeomPath", LocalsDir) AndAlso + sInfoPath.Trim = LocalsDir.Trim & LocalsName.Trim) Then nCounter += 1 End If End While - Dim IndexLay As Integer = TempList.Count - nCounter + Dim IndexLay As Integer = Math.Max( TempList.Count - nCounter, 0) ' ottengo la posizione prevista nella grafica Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, CurrCompo) While IndexInList < TempList.Count And nIdLay <> GDB_ID.NULL ' recupero l'ordinamento del layer - If sInfoPath.Contains(sCompoName) And IndexLay = IndexInList Then + If sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay = IndexInList Then EgtSetMark(nIdLay) ' evidenzio la compo corrente TempList(IndexInList).SetMark() ' ricerca terminata correttamente Return True - ElseIf sInfoPath.Contains(sCompoName) And IndexInList < IndexLay Then + ElseIf sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexInList < IndexLay Then IndexInList += 1 Else Return False