IfcIO.Cli
0.4.0
See the version list below for details.
dotnet tool install --global IfcIO.Cli --version 0.4.0
dotnet new tool-manifest
dotnet tool install --local IfcIO.Cli --version 0.4.0
#tool dotnet:?package=IfcIO.Cli&version=0.4.0
nuke :add-package IfcIO.Cli --version 0.4.0
<p align="center"> <img src="docs/images/ifcio-banner.png" alt="IfcIO" width="640"> </p>
IfcIO
IfcIO is a fast, 100% managed .NET library for building, reading, and exporting Industry Foundation Classes (.ifc) files compliant with IFC2x3 Coordination View V2.0 and IFC4 Design Transfer / Reference View without third-party dependencies or native code.
Built clean-room under the IOExtend organization as the shared open-standards IFC foundation for AEC/BIM projects (including NwcIO and RvtIO).
Features
- Full High-Level Model Ingestion (
IfcModel.Open):- Reconstructs complete spatial hierarchy (Project, Site, Building, Storeys), elements, properties, materials, and 3D meshes from any
.ifcor.ifczipfile. - Multi-line STEP statement accumulation and quote-aware tokenization in
StepReader.
- Reconstructs complete spatial hierarchy (Project, Site, Building, Storeys), elements, properties, materials, and 3D meshes from any
- IFC4 Modern Tessellation (
IfcTriangulatedFaceSet):- Encodes geometry using compact
IfcTriangulatedFaceSetandIfcCartesianPointList3Dunder representation type'Tessellation'for IFC4 exports (>60% smaller files).
- Encodes geometry using compact
- Direct 3D Exporters (glTF 2.0 & Wavefront OBJ):
- Instant conversion of any IFC model to binary glTF 2.0 (
.glb) with PBR metallic-roughness materials and vertex normals, or Wavefront OBJ (.obj+.mtl).
- Instant conversion of any IFC model to binary glTF 2.0 (
- PKZip Compressed IFC (
.ifczip):- Built-in transparent compression and decompression for standard
.ifcziparchives with zero native dependencies.
- Built-in transparent compression and decompression for standard
- Cross-Platform CLI Tool (
ifcio):- Global .NET CLI tool (
IfcIO.Clion NuGet) providinginfo,export,pack,unpack, andvalidatecommands.
- Global .NET CLI tool (
- buildingSMART 22-Character GlobalId (
IfcGuid):- Standard base64-like buildingSMART encoding (
0-9, A-Z, a-z, _, $). - Bidirectional conversion between 128-bit
.NET Guidand 22-character IFC GlobalId. - Deterministic GUID generation via SHA-256 namespace hashing for elements and models.
- Standard base64-like buildingSMART encoding (
- 3D Faceted BRep Geometry (
IfcFacetedBrep):- Encodes 3D meshes as
IfcFacetedBrep→IfcClosedShell→IfcFace→IfcFaceOuterBound→IfcPolyLoop→IfcCartesianPoint. - Vertex deduplication via shared per-mesh
IfcCartesianPointcoordinates.
- Encodes 3D meshes as
- BIM Spatial Containment:
- Standard spatial aggregation:
IfcProject→IfcSite→IfcBuilding→IfcBuildingStoreyviaIfcRelAggregates. - Elements assigned to storeys via
IfcRelContainedInSpatialStructure.
- Standard spatial aggregation:
- Semantic Classification & Properties:
- Automatic classification for standard BIM entities:
IfcWall,IfcSlab,IfcColumn,IfcBeam,IfcReinforcingBar,IfcWindow,IfcDoor,IfcFooting,IfcStair,IfcRailing,IfcRoof,IfcPipeSegment,IfcDuctSegment,IfcBuildingElementProxy. - Property sets (
IfcPropertySet,IfcPropertySingleValue) with typed values (IfcText,IfcInteger,IfcReal,IfcBoolean). - Reusable Type Products (
IfcTypeProduct) linked viaIfcRelDefinesByType. - Surface styles and materials (
IfcSurfaceStyle,IfcSurfaceStyleShading,IfcColourRgb,IfcStyledItem).
- Automatic classification for standard BIM entities:
- Zero Dependencies: Pure C# targeting
.NET 8and.NET 10.
Install
Add the package to your .NET project:
dotnet add package IfcIO
Library Usage (C#)
Creating and Exporting an IFC Model
using IfcIO;
using IfcIO.Geometry;
using IfcIO.Model;
using IfcIO.Schema;
// Create model (IFC2X3 or IFC4)
var model = IfcModel.Create("Residential Building Block 1", IfcSchema.Ifc2x3);
model.Author = "mahach666";
model.Organization = "IOExtend";
// Add storeys
var floor1 = model.AddStorey("Level 1", elevation: 0.0);
var floor2 = model.AddStorey("Level 2", elevation: 3300.0);
// Materials & colors
var concrete = new IfcMaterial { Name = "Concrete B25", R = 0.72, G = 0.72, B = 0.75 };
// Add 3D polygon mesh element
var vertices = new IfcVector3[]
{
new(0, 0, 0),
new(2000, 0, 0),
new(2000, 200, 0),
new(0, 200, 0),
new(0, 0, 2800),
new(2000, 0, 2800),
new(2000, 200, 2800),
new(0, 200, 2800)
};
var indices = new int[]
{
0, 2, 1, 0, 3, 2, // bottom
4, 5, 6, 4, 6, 7, // top
0, 1, 5, 0, 5, 4, // front
1, 2, 6, 1, 6, 5, // right
2, 3, 7, 2, 7, 6, // back
3, 0, 4, 3, 4, 7 // left
};
var wall = model.AddMesh("Стена монолитная 200", vertices, indices, concrete, floor1);
// Add parametric swept solids (walls, columns)
var paramWall = model.AddExtrudedRectangle(
name: "ExtrudedWall",
xDim: 300.0,
yDim: 6000.0,
depth: 3000.0,
material: concrete,
storey: floor1);
// Add opening and window filling
var openingSolid = new IfcExtrudedAreaSolid(
new IfcRectangleProfileDef(300.0, 1200.0),
depth: 1500.0,
position: new IfcVector3(0, 2000, 900));
var window = new IfcElement
{
Id = 101,
Name = "Window1",
IfcType = "IFCWINDOW",
Solid = new IfcExtrudedAreaSolid(new IfcRectangleProfileDef(100.0, 1180.0), depth: 1480.0),
};
model.AddOpening(paramWall, "WallOpening", solid: openingSolid, filling: window);
// Attach standard buildingSMART Property Sets
paramWall.PropertySets.Add(StandardPsets.WallCommon(
reference: "W-01",
loadBearing: true,
isExternal: true,
fireRating: "REI 120",
thermalTransmittance: 0.28));
// Add parametric revolved solids (curved pipes, fittings, flanged connections)
var pipeProfile = new IfcCircleProfileDef(radius: 100.0, position: new IfcVector3(500, 0, 0));
model.AddRevolvedSolid("90DegElbow", pipeProfile, angle: Math.PI * 0.5, storey: floor1, ifcType: "IFCPIPEFITTING");
// Automatic buildingSMART Quantity Takeoff (QTO) calculation directly from 3D geometry
model.CalculateAllBaseQuantities();
// Attach explicit custom quantity sets
paramWall.QuantitySets.Add(StandardQtoSets.WallBaseQuantities(
length: 6000.0,
width: 300.0,
height: 3000.0,
grossVolume: 5.4,
netVolume: 4.8));
// Validate model integrity
var validation = model.Validate();
if (!validation.IsValid)
{
foreach (var issue in validation.Issues)
Console.WriteLine($"[{issue.Severity}] {issue.RuleId}: {issue.Message}");
}
// Save to multiple formats with one call:
model.Save("Building.ifc"); // Standard STEP file (IFCEXTRUDEDAREASOLID, IFCRELVOIDSELEMENT)
model.SaveZip("Building.ifczip"); // Compressed PKZip archive
model.SaveGlb("Building.glb"); // Binary glTF 2.0 with PBR materials
model.SaveObj("Building.obj"); // Wavefront OBJ + MTL
Loading and Inspecting an IFC Model
using IfcIO;
// Load an existing .ifc or .ifczip model
var model = IfcModel.Open("Building.ifc");
Console.WriteLine($"Project: {model.ProjectName}");
Console.WriteLine($"Schema: {model.Schema}");
Console.WriteLine($"Storeys: {model.Storeys.Count}");
Console.WriteLine($"Elements: {model.AllElements.Count()}");
// Convert directly to glTF 2.0
model.SaveGlb("Building_Converted.glb");
Global CLI Tool (ifcio)
Install the cross-platform command-line tool globally via NuGet:
dotnet tool install --global IfcIO.Cli
CLI Commands
# Inspect model metadata, storeys, and element distribution
ifcio info Building.ifc --report
# Convert IFC to binary glTF 2.0 and Wavefront OBJ
ifcio export Building.ifc --glb scene.glb --obj scene.obj
# Compress IFC to .ifczip
ifcio pack Building.ifc -o Building.ifczip
# Extract IFC from .ifczip
ifcio unpack Building.ifczip -o Building.ifc
# Validate ISO 10303-21 structure and schema
ifcio validate Building.ifc
License and trademarks
IfcIO is licensed under the MIT License. Copyright © 2026 IOExtend.
buildingSMART and IFC are registered trademarks of buildingSMART International Ltd.
IfcIO is an independent implementation of the ISO 10303-21 STEP and buildingSMART specifications. No proprietary code or binaries are included.
| Product | Versions 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 was computed. 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. |
This package has no dependencies.