Skip to content

Commit 0bfe0d4

Browse files
committed
fix: resolve variable name collision in export collision detection
1 parent a255919 commit 0bfe0d4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

solidworks-service/BluePLM.SolidWorksService/SolidWorksAPI.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -988,10 +988,10 @@ ref warnings
988988
if (usedFilenames.Contains(configOutputPath))
989989
{
990990
// Collision detected - append config name to make unique
991-
var dir = Path.GetDirectoryName(configOutputPath)!;
991+
var collisionDir = Path.GetDirectoryName(configOutputPath)!;
992992
var nameWithoutExt = Path.GetFileNameWithoutExtension(configOutputPath);
993-
var ext = Path.GetExtension(configOutputPath);
994-
configOutputPath = Path.Combine(dir, $"{nameWithoutExt}_({configName}){ext}");
993+
var fileExt = Path.GetExtension(configOutputPath);
994+
configOutputPath = Path.Combine(collisionDir, $"{nameWithoutExt}_({configName}){fileExt}");
995995
Console.Error.WriteLine($"[Export] Filename collision detected, renamed to: {Path.GetFileName(configOutputPath)}");
996996
}
997997
usedFilenames.Add(configOutputPath);
@@ -1267,10 +1267,10 @@ ref warnings
12671267
if (usedFilenames.Contains(configOutputPath))
12681268
{
12691269
// Collision detected - append config name to make unique
1270-
var dir = Path.GetDirectoryName(configOutputPath)!;
1270+
var collisionDir = Path.GetDirectoryName(configOutputPath)!;
12711271
var nameWithoutExt = Path.GetFileNameWithoutExtension(configOutputPath);
1272-
var ext = Path.GetExtension(configOutputPath);
1273-
configOutputPath = Path.Combine(dir, $"{nameWithoutExt}_({configName}){ext}");
1272+
var fileExt = Path.GetExtension(configOutputPath);
1273+
configOutputPath = Path.Combine(collisionDir, $"{nameWithoutExt}_({configName}){fileExt}");
12741274
Console.Error.WriteLine($"[Export] Filename collision detected, renamed to: {Path.GetFileName(configOutputPath)}");
12751275
}
12761276
usedFilenames.Add(configOutputPath);

0 commit comments

Comments
 (0)