Compare commits

...

5 Commits

Author SHA1 Message Date
da4d3228b0 revert: remove degree symbol fix (moved to caller)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:31:50 -05:00
3c1700c480 fix: repair double-encoded degree symbol in DXF output
ACadSharp misreads UTF-8 degree symbol (C2 B0) as two ANSI_1252
characters (°) then writes that back out. Post-process the saved
DXF to replace ° with ° so bend notes display correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:28:38 -05:00
f2f50f9914 fix: set bend line entity color to ByLayer
Bend lines retained their original explicit color (white) from
SolidWorks after being moved to the BEND layer. Now set to ByLayer
so they inherit the layer's yellow color.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:51:54 -05:00
bf36a56387 fix: detect bend lines from SolidWorks DXF exports
Three issues prevented bend line detection after the ACadSharp migration:

1. IsBendLine required layer "BEND" but SolidWorks exports bend lines
   on layer "0" with CENTERX2 linetype. Added "0" as accepted layer.

2. Bend note regex used literal ° which failed when ACadSharp reads the
   degree symbol as multi-byte "°" due to ANSI/UTF-8 encoding mismatch.
   Changed to [^R\d]* to tolerate any characters between angle and R.

3. Radius filter excluded bends with null Radius (unparsed notes).
   Nullable comparison null <= 4.0 evaluates to false in C#, filtering
   out all bends. Added null check to include unparsed bends.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 14:33:59 -05:00
6e131d402e fix: upgrade ACadSharp 3.1.32 → 3.4.9 to fix missing OBJECTS section
The DxfWriter in 3.1.32 wrote root dictionary entries referencing child
dictionary objects (ACAD_GROUP, ACAD_LAYOUT, etc.) but never serialized
the actual objects. This caused AutoCAD to report "GroupTable dictionary
was not defined in NamedObject dictionary". Version 3.4.9 includes the
root dictionary fix from PR #957.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 14:20:45 -05:00
3 changed files with 6 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ namespace EtchBendLines
/// The regular expression pattern the bend note must match
/// </summary>
static readonly Regex bendNoteRegex = new Regex(
@"\b(?<direction>UP|DOWN|DN)\s+(?<angle>\d+(\.\d+)?)°?\s*R\s*(?<radius>\d+(\.\d+)?)\b",
@"\b(?<direction>UP|DOWN|DN)\s+(?<angle>\d+(\.\d+)?)[^R\d]*R\s*(?<radius>\d+(\.\d+)?)\b",
RegexOptions.Compiled | RegexOptions.IgnoreCase
);
@@ -66,7 +66,7 @@ namespace EtchBendLines
AssignBendDirections(bends, bendNotes);
return bends.Where(b => b.Radius <= MaxBendRadius).ToList();
return bends.Where(b => b.Radius == null || b.Radius <= MaxBendRadius).ToList();
}
private bool IsBendLine(Line line)
@@ -76,6 +76,7 @@ namespace EtchBendLines
switch (line.Layer.Name.ToUpperInvariant())
{
case "0":
case "BEND":
case "BEND LINES":
case "BENDLINES":

View File

@@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ACadSharp" Version="3.1.32" />
<PackageReference Include="ACadSharp" Version="3.4.9" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
</ItemGroup>

View File

@@ -100,10 +100,11 @@ namespace EtchBendLines
var doc = LoadDocument(filePath);
var bends = ExtractBends(doc);
// Ensure all bend lines are on the BEND layer
// Ensure all bend lines are on the BEND layer with ByLayer color
foreach (var bend in bends)
{
bend.Line.Layer = BendLayer;
bend.Line.Color = Color.ByLayer;
}
var upBends = bends.Where(b => b.Direction == BendDirection.Up);