docs: update README to reflect local export and .NET 8 migration

Remove CutFab API references and document the current architecture:
local file export, SQL Server tracking, and .NET 8.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 22:35:41 -05:00
parent 697463f61e
commit 0ace378eff

View File

@@ -1,6 +1,6 @@
# ExportDXF
A Windows desktop application that automates exporting flat pattern DXF files from SolidWorks drawings, assemblies, and parts. Built for sheet metal fabrication workflows, it extracts BOM data, generates DXF flat patterns with etch/bend line markings, exports drawing PDFs, and uploads everything to a CutFab API for downstream cut programming.
A Windows desktop application that automates exporting flat pattern DXF files from SolidWorks drawings, assemblies, and parts. Built for sheet metal fabrication workflows, it extracts BOM data, generates DXF flat patterns with etch/bend line markings, and exports drawing PDFs to a local output folder with SQL Server tracking.
## Features
@@ -8,17 +8,19 @@ A Windows desktop application that automates exporting flat pattern DXF files fr
- **Flat pattern generation** with automatic sheet metal detection
- **Etch line insertion** on bend-up lines for fabrication reference (via EtchBendLines library)
- **PDF export** of SolidWorks drawings
- **CutFab API integration** -- uploads DXFs, PDFs, and BOM data with sheet metal properties (thickness, K-factor, bend radius, material)
- **Local file export** -- saves DXFs and PDFs to a configurable output folder
- **SQL Server database** -- tracks export history and BOM data via Entity Framework Core
- **View flip control** with automatic, manual, and prefer-up strategies
- **Drawing selection UI** that connects to SolidWorks and displays the active document
- **Active document tracking** -- connects to SolidWorks and displays the active document in the title bar
- **BOM extraction** from drawing BOM tables or assembly component trees
- **Drawing history dropdowns** -- equipment and drawing number filters populated from past exports
## Requirements
- Windows 10/11
- .NET Framework 4.8
- .NET 8.0
- SolidWorks (installed and licensed)
- CutFab API server (default: `http://localhost:7027`)
- SQL Server (default: `localhost`, database: `ExportDxfDb`, Windows auth)
## Solution Structure
@@ -33,17 +35,19 @@ ExportDXF.sln
| Namespace | Purpose |
|-----------|---------|
| `ExportDXF.Services` | Core services -- SolidWorks connection, DXF export, BOM extraction, PDF export, API client |
| `ExportDXF.Forms` | WinForms UI -- drawing selection and main export form |
| `ExportDXF.Models` | Data models -- BomItem, ExportContext, SolidWorksDocument |
| `ExportDXF.Services` | Core services -- SolidWorks connection, DXF export, BOM extraction, PDF export, file export |
| `ExportDXF.Forms` | WinForms UI -- main export form with log and BOM grids |
| `ExportDXF.Models` | Data models -- BomItem, ExportRecord, ExportContext, SolidWorksDocument |
| `ExportDXF.Data` | Entity Framework Core DbContext for SQL Server persistence |
| `ExportDXF.ViewFlipDeciders` | Strategies for determining if a flat pattern view should be flipped |
| `ExportDXF.ItemExtractors` | Extract component items from BOM tables and assemblies |
| `ExportDXF.Utilities` | SolidWorks helpers, sheet metal property extraction, text utilities |
| `ExportDXF.Extensions` | Extension methods for SolidWorks, UI, unit conversion, strings, TimeSpan |
| `EtchBendLines` | Post-processes DXF files to add etch marks on bend-up lines |
## How It Works
1. **Startup** -- Connects to a running SolidWorks instance (or launches one). Shows a drawing selection form that pulls equipment/drawing data from the CutFab API and displays the active SolidWorks document.
1. **Startup** -- Connects to a running SolidWorks instance (or launches one) asynchronously. Loads past export history from the database to populate equipment/drawing dropdowns. Displays the active SolidWorks document name in the title bar.
2. **Export** -- Based on the active document type:
- **Drawing**: Extracts BOM items from BOM tables, exports the drawing as PDF, then iterates through each component to generate flat pattern DXFs.
@@ -52,21 +56,27 @@ ExportDXF.sln
3. **Post-processing** -- Each exported DXF is run through the EtchBendLines library, which identifies bend-up lines and adds short etch marks at their endpoints on a dedicated `ETCH` layer. Only up bends are etched because SolidWorks automatically flips the flat pattern so the shortest flange is the first bend. The etch marks let the press brake operator verify part orientation right off the laser table without flipping -- the first bend (shortest flange) will always have an etch line.
4. **Upload** -- DXF files (zipped), PDFs, and BOM item data are uploaded to the CutFab API along with sheet metal properties. The API auto-links cut templates based on material and thickness.
4. **Save** -- DXF and PDF files are copied to the configured output folder. Export records and BOM items (with sheet metal properties) are saved to the SQL Server database.
## Configuration
The API base URL is configured in `App.config`:
Settings are in `App.config`:
```xml
<appSettings>
<add key="CutFab.ApiBaseUrl" value="http://localhost:7027" />
<add key="MaxBendRadius" value="2.0" />
<add key="ExportOutputFolder" value="C:\ExportDXF\Output" />
</appSettings>
<connectionStrings>
<add name="ExportDxfDb"
connectionString="Server=localhost;Database=ExportDxfDb;Trusted_Connection=True;TrustServerCertificate=True;"
providerName="Microsoft.Data.SqlClient" />
</connectionStrings>
```
## DXF Filename Format
Exported files follow the pattern: `{EquipmentNo} {DrawingNo} PT{ItemNo}.dxf`
Exported files follow the pattern: `{DrawingNumber} PT{ItemNo}.dxf`
Example: `5007 A02 PT01.dxf`