diff --git a/src/RevitDeclarations/Models/Apartment.cs b/src/RevitDeclarations/Models/Apartment.cs index d506a4ac..7a69b78b 100644 --- a/src/RevitDeclarations/Models/Apartment.cs +++ b/src/RevitDeclarations/Models/Apartment.cs @@ -256,15 +256,5 @@ public void CalculateUtp(UtpCalculator calculator) { _utpPantry = calculator.CalculatePantry(this); _utpLaundry = calculator.CalculateLaundry(this); } - - public int GetIntFullNumber() { - if(string.IsNullOrEmpty(FullNumber)) { - return 0; - } else { - string resultString = Regex.Match(FullNumber, @"\d+").Value; - int.TryParse(resultString, out int result); - return result; - } - } } } diff --git a/src/RevitDeclarations/Models/Export/Exporters/CsvExporter.cs b/src/RevitDeclarations/Models/Export/Exporters/CsvExporter.cs index 353c6592..9962e6b7 100644 --- a/src/RevitDeclarations/Models/Export/Exporters/CsvExporter.cs +++ b/src/RevitDeclarations/Models/Export/Exporters/CsvExporter.cs @@ -6,7 +6,7 @@ namespace RevitDeclarations.Models { internal class CsvExporter : ITableExporter { public void Export(string path, DeclarationDataTable table) { - path = Path.ChangeExtension(path, "scv"); + path = Path.ChangeExtension(path, "csv"); string strData = ConvertDataTableToString(table); diff --git a/src/RevitDeclarations/ViewModels/MainViewModel.cs b/src/RevitDeclarations/ViewModels/MainViewModel.cs index de9f45d3..47d53ebf 100644 --- a/src/RevitDeclarations/ViewModels/MainViewModel.cs +++ b/src/RevitDeclarations/ViewModels/MainViewModel.cs @@ -6,6 +6,7 @@ using Autodesk.Revit.DB; using Autodesk.Revit.UI; +using dosymep.Revit.Comparators; using dosymep.WPF.Commands; using dosymep.WPF.ViewModels; @@ -48,6 +49,7 @@ public MainViewModel(RevitRepository revitRepository, DeclarationSettings settin _settings = settings; _phases = _revitRepository.GetPhases(); + _selectedPhase = _phases[_phases.Count - 1]; _excelExportViewModel = new ExcelExportViewModel("Excel", new Guid("01EE33B6-69E1-4364-92FD-A2F94F115A9E"), _settings); @@ -252,10 +254,11 @@ public void ExportDeclaration(object obj) { } } + LogicalStringComparer comparer = new LogicalStringComparer(); List apartments = projects .SelectMany(x => x.Apartments) .OrderBy(x => x.Section) - .ThenBy(x => x.GetIntFullNumber()) + .ThenBy(x => x.FullNumber, comparer) .ToList(); try {