Part.Load
Part.Load is the SDK entry point for reading a sheet-metal part from disk.
It accepts any file format that Flux understands, returns a fully constructed Part object,
and leaves manufacturing calculations to the caller.
File: Core/Part/Part.cs — static method Part.Load(string filename)
1. Prerequisite — Library.Init
Part.Load requires the Flux library to be initialised before it is called.
Library.Init loads the WAD resource packages and verifies the licence.
Calling Part.Load before Library.Init results in undefined behaviour.
Library.Init(sDataDir, sWadDir, null); // must come first
var part = Part.Load(filename);
The third argument to Library.Init is the application’s main window handle —
pass null for console applications, a Window instance for WPF applications.
For licence handling during initialisation see the APIInit pattern used in every
SDK sample:
static void APIInit() {
try {
Library.Init(sDataDir, sWadDir, null);
} catch (APIException e) {
if (e.Code == EResult.NoLicense) {
// Prompt user for serial / name / email, then call Library.RegisterLicense.
// ...
Environment.Exit(exitCode);
}
}
}
static readonly string sDataDir = "C:/FluxSDK/Data", sWadDir = "C:/FluxSDK/Bin";
2. Signature
public static Part Part.Load(string filename)
| Parameter | Type | Meaning |
|---|---|---|
|
|
Absolute or relative path to the source file. The extension determines which loader is used. |
return |
|
A fully constructed |
The method throws if the file does not exist, the format is unrecognised, or the file is corrupt.
3. Supported File Formats
The format is detected from the file extension.
Part.KnownFileTypes returns the complete list of extensions recognised by the
installed build:
// Build an OpenFileDialog filter string from all supported types.
// Each entry has the form "Description|*.ext".
string filter = string.Join(";", Part.KnownFileTypes.Select(x => x.After('|')));
Common formats:
| Extension | Format |
|---|---|
|
Flux native format — ZIP archive containing AU-serialised part data.
Produced by |
|
Flux text format for 2D flat drawings. Contains geometry, material, thickness, and bend marks but no 3D model. |
|
AutoCAD Drawing Exchange Format. Flat 2D drawings; layers map to drawing roles. |
|
PDF vector outlines imported as a 2D flat drawing. |
|
3D surface or solid geometry imported as a surface model. |
|
3D solid geometry imported as a surface model. |
4. What Gets Populated
The properties populated on the returned Part depend entirely on what the file contains.
No manufacturing data is computed automatically — all Make* methods must be called
explicitly after loading.
| Property | .fx |
.geo |
.dxf |
.iges / .step |
|---|---|---|---|---|
|
yes |
yes |
partial |
no |
|
yes |
yes |
yes |
no |
|
if saved |
no |
no |
no |
|
if saved |
no |
no |
no |
|
if saved |
no |
no |
no |
|
if saved |
no |
no |
no |
|
if saved |
no |
no |
yes |
A .geo or .dxf file always yields a Dwg and never a Model.
A .iges or .step file yields a SurfaceModel and nothing else —
both Dwg and Model must be derived via post-load operations (see below).
5. Post-Load Operations
Part.Load does not call any manufacturing algorithms.
Callers must explicitly request whatever representations or tooling they need:
| Method | What it produces |
|---|---|
|
Derives |
|
Derives |
|
Derives |
|
Generates |
|
Generates |
|
Generates |
The call graph for the most common starting points:
File loaded as flat 2D (geo, dxf)
└── Part.Load(file)
├── part.Dwg ← ready immediately
├── part.FoldTo3D() ← derive 3D model from Dwg
│ ├── part.Model ← now available
│ ├── part.MakeBendTech(mac)
│ └── part.MakeFoldTech(mac)
└── part.MakeCutTech(mac)
File loaded as 3D surface (iges, step)
└── Part.Load(file)
├── part.SurfaceModel ← ready immediately
├── part.SheetMetalize()
│ └── part.Model ← now available
└── part.UnfoldTo2D()
└── part.Dwg ← now available
File loaded as native (fx)
└── Part.Load(file)
├── part.Info, Dwg, Model, *Tech ← as saved in the file
├── part.FoldTo3D() ← only if Model is null
└── part.UnfoldTo2D() ← only if Dwg is null
6. Common Patterns
6.1. Read metadata only
var part = Part.Load(file);
Console.WriteLine($"Name: {part.Info.Name}");
Console.WriteLine($"Material: {part.Info.Matl.DisplayName}");
Console.WriteLine($"Thickness: {part.Info.Thickness}");
6.2. Convert to another 2D format
var part = Part.Load(file);
part.Dwg.SaveDXF(Path.ChangeExtension(file, ".dxf")); // GEO → DXF
part.Dwg.SaveGEO(Path.ChangeExtension(file, ".geo")); // DXF → GEO
6.3. Save as native Flux format
var part = Part.Load(file); // any supported format
part.SaveFX(Path.ChangeExtension(file, ".fx"));
6.4. Generate press-brake tooling
var part = Part.Load(file);
if (part.Model == null) part.FoldTo3D(); // ensure 3D model exists
part.MakeBendTech(BendMachine.Default);
var tech = part.BendTech;
6.5. Generate laser tooling
var part = Part.Load(file);
part.UnfoldTo2D(); // ensure flat drawing exists
part.MakeCutTech(sDefaultCutMac);
var tech = part.CutTech;
6.6. View in a WPF editor
var part = Part.Load(filename);
part.UnfoldTo2D();
if (part.Dwg != null) part.FoldTo3D(); // derive 3D from Dwg if possible
_ = new PartEditor(part, PartEditor.ESkin.Model);
7. KnownFileTypes
Part.KnownFileTypes is a static property that returns all file type descriptors
recognised by the current build, in file-dialog filter format:
IEnumerable<string> Part.KnownFileTypes
Each element has the form "Description|.ext1;.ext2", matching the Filter property
of a standard OpenFileDialog:
// All supported types, PDF excluded.
static string PartFileTypes
=> string.Join(";", Part.KnownFileTypes.Select(x => x.After('|')))
.Replace("*.pdf;", "");
8. Result After Part.Load
Part.Load(filename)
│
├── Info ← name, material, thickness, grain, GUID
│
├── Dwg ← 2D flat drawing (null if 3D-only file)
│ ├── E2Pline[] outer contour + holes + features
│ └── E2Bendline[] bend marks with angle, radius, k-factor
│
├── Model ← 3D folded model (null unless .fx contains one)
│ ├── E3Plane[] flat faces
│ └── E3Flex[] bends connecting faces
│
├── SurfaceModel ← raw imported surfaces (iges/step only, otherwise null)
│
└── BendTech / FoldTech / CutTech
← null unless restored from .fx; call Make*() to generate
9. Key Files
| File | Responsibility |
|---|---|
|
|
|
|
|
Parses the |
|
Parses DXF into a |
|
AU deserialiser — reads the binary object graph inside |
|
|
|
|
|
|