diff --git a/common/lc_partselectionwidget.cpp b/common/lc_partselectionwidget.cpp index bf6661e3..6eeabeac 100644 --- a/common/lc_partselectionwidget.cpp +++ b/common/lc_partselectionwidget.cpp @@ -127,8 +127,22 @@ void lcPartSelectionListModel::SetCategory(int CategoryIndex) if (CategoryIndex != -1) Library->GetCategoryEntries(CategoryIndex, false, SingleParts, GroupedParts); else + { Library->GetParts(SingleParts); + lcModel* CurrentModel = lcGetActiveModel(); + + for (int PartIdx = 0; PartIdx < SingleParts.GetSize(); ) + { + PieceInfo* Info = SingleParts[PartIdx]; + + if (!Info->IsModel() || !Info->GetModel()->IncludesModel(CurrentModel)) + PartIdx++; + else + SingleParts.RemoveIndex(PartIdx); + } + } + auto lcPartSortFunc=[](PieceInfo* const& a, PieceInfo* const& b) { return strcmp(a->m_strDescription, b->m_strDescription);