JFToolkit.Dxf 0.2.0

dotnet add package JFToolkit.Dxf --version 0.2.0
                    
NuGet\Install-Package JFToolkit.Dxf -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JFToolkit.Dxf" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JFToolkit.Dxf" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="JFToolkit.Dxf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JFToolkit.Dxf --version 0.2.0
                    
#r "nuget: JFToolkit.Dxf, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JFToolkit.Dxf@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JFToolkit.Dxf&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=JFToolkit.Dxf&version=0.2.0
                    
Install as a Cake Tool

JFToolkit.Dxf

Zero-dependency .NET library for reading and writing DXF files — focused on block extraction and insertion. Open a template, extract blocks, paste them into plot frames at specific positions.

License Target

The problem

You have a DXF symbol library with 100+ P&ID blocks (pumps, valves, tanks). You have plot frames (A3, A4 with title blocks). You need to assemble drawing sheets by pasting the right symbols at the right coordinates.

Doing this in AutoCAD by hand: open template, copy block, switch to drawing, paste, position... for every sheet. A P&ID might have 30 sheets.

This library makes it one operation per block.

Install

dotnet add package JFToolkit.Dxf

Zero dependencies. No AutoCAD SDK. Pure C# string I/O.

Usage

Your workflow: extract blocks, insert at coordinates

using JFToolkit.Dxf;

// Open your symbol library and plot frame
var template = DxfDocument.Load("pandid_symbols.dxf");
var drawing  = DxfDocument.Load("a3_landscape.dxf");

// Pull out the blocks you need
drawing.ImportBlock(template.Blocks["PUMP_CENTRIFUGAL"]);
drawing.ImportBlock(template.Blocks["VALVE_GATE_50"]);
drawing.ImportBlock(template.Blocks["TANK_VERTICAL"]);

// Paste at position
drawing.Entities.Add(new DxfInsert
{
    BlockName = "PUMP_CENTRIFUGAL",
    X = 120, Y = 340
});
drawing.Entities.Add(new DxfInsert
{
    BlockName = "TANK_VERTICAL",
    X = 100, Y = 150,
    ScaleX = 2.0, ScaleY = 2.0  // double size
});

drawing.Save("sheet_03.dxf");

Inspect what's in a file

var doc = DxfDocument.Load("mystery.dxf");

Console.WriteLine($"Blocks: {doc.Blocks.Count}");
foreach (var (name, block) in doc.Blocks)
    Console.WriteLine($"  {name}: {block.Entities.Count} entities");

Console.WriteLine($"Inserts: {doc.Entities.OfType<DxfInsert>().Count()}");

Supported entities (v0.1)

Entity Read Write Notes
INSERT Block reference at position with scale/rotation
LINE
CIRCLE
ARC
TEXT Single-line text
MTEXT Read-only (converted to plain text)
LWPOLYLINE Lightweight polyline (2D vertex array)
BLOCK Block definitions (import/export)

What it does NOT do (by design)

  • No DIMENSION, HATCH, SPLINE, or 3D entities
  • No binary DXF (text format only)
  • No block creation from scratch (blocks come from templates)
  • No header variable editing (pass-through only)
  • No pre-R2000 DXF versions

Requirements

  • .NET 8 or .NET 9
  • Any OS (pure text I/O, no Windows-specific dependencies)

License

MIT — use it anywhere, commercial or personal.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 43 6/5/2026
0.1.0 50 6/4/2026