diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 5d51e0a..9328422 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -1537,6 +1537,8 @@ Public Class Part DdfFile.GetOrderedListSameCompo(TempList) ' ontengo la posizione prevista nella grafica Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, m_SelCompo) + ' recupero il direttorio della componente + Dim sDirCompo As String = Path.GetFileName(m_SelCompo.CompoType.Path) ' recupero la lista ordinata Dim sCompoName As String = m_SelCompo.TemplateSelItem ' recupero il primo part disponibile @@ -1547,7 +1549,7 @@ Public Class Part Dim sInfoPath As String = String.Empty If EgtGetInfo(nIdLay, "Path", sInfoPath) Then Dim sNamePath As String = sInfoPath - If sNamePath.Contains(sCompoName) And IndexLay = IndexInList Then + If sNamePath.Contains(sCompoName) And sNamePath.Contains(sDirCompo) And IndexLay = IndexInList Then EgtSetMark(nIdLay) m_SelCompo.SetMark() Exit While diff --git a/SceneManager/SceneManagerVM.vb b/SceneManager/SceneManagerVM.vb index 6760a89..c530612 100644 --- a/SceneManager/SceneManagerVM.vb +++ b/SceneManager/SceneManagerVM.vb @@ -492,6 +492,8 @@ Public Class SceneManagerVM DdfFile.GetOrderedListSameCompo(TempList) ' ottengo la posizione prevista nella grafica Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, CurrCompo) + ' recupero il direttorio della componente + Dim sDirCompo As String = Path.GetFileName(CurrCompo.CompoType.Path) ' recupero la lista ordinata Dim sCompoName As String = CurrCompo.TemplateSelItem ' oridnamento del layer @@ -502,7 +504,7 @@ Public Class SceneManagerVM ' Dim sNamePath As String = Path.GetFileNameWithoutExtension(sInfoPath) Dim sNamePath As String = sInfoPath 'If sNamePath = sCompoName Then - If sNamePath.Contains(sCompoName) Then + If sNamePath.Contains(sCompoName) And sNamePath.Contains(sDirCompo) Then Dim nCurrLayId As Integer = nIdLay Dim nCounter As Integer = 1 While nCurrLayId <> GDB_ID.NULL