diff --git a/src/Core/Services/SectionBoxBatchDetector.cs b/src/Core/Services/SectionBoxBatchDetector.cs index 31fbf01..983601c 100644 --- a/src/Core/Services/SectionBoxBatchDetector.cs +++ b/src/Core/Services/SectionBoxBatchDetector.cs @@ -109,9 +109,13 @@ namespace NavisworksTransport.Core.Services Directory.CreateDirectory(workDirectory); string safeId = string.IsNullOrWhiteSpace(instanceId) ? Guid.NewGuid().ToString("N") : instanceId; - string localModelPath = Path.Combine(workDirectory, $"model-{safeId}.nwd"); - string routeFilePath = Path.Combine(workDirectory, $"route-{safeId}.json"); - string secondaryDbPath = Path.Combine(workDirectory, $"secondary-{safeId}.db"); + + // 文件名带时间戳后缀:同一 itemId 重复执行(残留状态重置重跑)时避免与 + // 旧执行的文件重名——旧副实例可能仍持有旧文件句柄,同名覆盖会触发加载失败弹窗 + string fileStamp = DateTime.Now.ToString("yyyyMMddHHmmssfff"); + string localModelPath = Path.Combine(workDirectory, $"model-{safeId}-{fileStamp}.nwd"); + string routeFilePath = Path.Combine(workDirectory, $"route-{safeId}-{fileStamp}.json"); + string secondaryDbPath = Path.Combine(workDirectory, $"secondary-{safeId}-{fileStamp}.db"); // 1. 路径剖面盒(复用产品路径盒语义:路径点 + 虚拟物体高度附加点 + 水平 4m/高度 2m 扩展) // 与 LogisticsControlViewModel.EnableClipBoxForCurrentRoute 一致(地面路径点上方、空中路径下方加物体高度)