BimZen.Bcf.Core
1.1.0
dotnet add package BimZen.Bcf.Core --version 1.1.0
NuGet\Install-Package BimZen.Bcf.Core -Version 1.1.0
<PackageReference Include="BimZen.Bcf.Core" Version="1.1.0" />
<PackageVersion Include="BimZen.Bcf.Core" Version="1.1.0" />
<PackageReference Include="BimZen.Bcf.Core" />
paket add BimZen.Bcf.Core --version 1.1.0
#r "nuget: BimZen.Bcf.Core, 1.1.0"
#:package BimZen.Bcf.Core@1.1.0
#addin nuget:?package=BimZen.Bcf.Core&version=1.1.0
#tool nuget:?package=BimZen.Bcf.Core&version=1.1.0
English · Русский · Deutsch · Nederlands · Suomi
bimzen-bcf
A .NET library for the buildingSMART Collaboration Format (BCF), plus the single source of truth for the vocabularies that go with it.
Bcf.Core targets netstandard2.0, has zero runtime dependencies, and knows
nothing about any host application. Everything host-specific lives behind
narrow ports that the embedding tool implements. The output is validated
against the official buildingSMART XSDs on every build.
What it does
| Area | What you get |
|---|---|
| Write | BCF 3.0 and BCF 2.1 — two independent serializers, not one parameterised writer |
| Read | BCF 3.0, 2.1 and 2.0 (read-only). Lenient by design: unknown statuses and types from other tools are preserved, never rejected |
| Update | Append to an existing archive without losing what a receiving tool put there |
| Camera | Perspective and orthogonal, quaternion to direction and up vector, per-version limits |
| Units | Any host unit to the metres BCF requires |
| Identifiers | IFC GUID both ways, and Revit UniqueId to IFC GUID with the exporter's own algorithm |
| Vocabularies | Types, statuses, priorities, labels and stages from one file, with generated constants |
| Idempotency | A stable topic key that survives a re-run, so a repeated export does not create duplicates |
What it deliberately does not do: open models, render snapshots, check licences, show windows, or touch the network. All of that belongs to the host.
Quick start
var settings = new BcfExportSettings
{
Author = "coordinator@example.com",
ProjectName = "Northern Quarter",
Version = BcfVersion.Bcf30
};
using (var file = File.Create(@"C:\exports\clashes.bcfzip"))
{
BcfExportResult result = new BcfClashExporter(source).Export(file, settings);
if (!result.Succeeded) { /* result.Error, result.Warnings */ }
}
source is your implementation of IClashSource — the one port that is
mandatory. The full contract, including the optional ports, is in
docs/integration.md.
Installation
A NuGet package (BimZen.Bcf.Core) is being prepared. Until it is published,
reference the project directly:
git clone https://github.com/kichnap/bimzen-bcf.git
dotnet add <your-project> reference bimzen-bcf/Bcf.Core/Bcf.Core.csproj
Non-.NET consumers can use the vocabulary file
bcf-vocabularies/bcf-extensions.json
on its own — it is plain JSON and carries no code.
Repository layout
Bcf.Core/ the BCF model, converters and serializers (netstandard2.0)
Bcf.Core.Tests/ xUnit, net48 + net8.0
bcf-vocabularies/ the canonical vocabulary — the ONLY source of truth
schemas/3.0/ XSDs from buildingSMART/BCF-XML, branch release_3_0
schemas/2.1/ XSDs from buildingSMART/BCF-XML, branch release_2_1
schemas/api/ machine-readable description of the export settings
docs/integration.md the contract for embedding the library in your own tool
docs/releasing.md how a version reaches nuget.org, and what to set up once
test-data/ reference .bcfzip fixtures for import tests
Design rules that are easy to break without noticing
Bcf.Coreknows nothing about any host. No reference to any BIM application: the library builds and its tests run on a machine where none is installed. Data arrives through a narrow port,IClashSource.- Zero NuGet dependencies in
Bcf.Core. The library may end up in the same process as another add-in carrying the same library. Every dependency doubles the chance of aTypeLoadExceptionon a version mismatch. For the same reason the assembly is not strong-named. - The model follows the specification, not the shape of the zip archive. BCF describes the same entities twice — XML in a file and JSON over HTTP. The model is shared; the serialization is swappable.
- Vocabulary values are never hard-coded. Constants are generated from
bcf-vocabularies/bcf-extensions.json;extensions.xml(3.0) andextensions.xsd(2.1) are generated from it too, not shipped as ready files. - Validation is asymmetric: strict on write, lenient on read. A file produced by BIMcollab or Revizto legitimately contains statuses you have never seen. Rejecting it is the fastest way to be known as the tool that "does not understand openBIM".
Generating the vocabulary constants
Vocabulary values reach the code through the generator only — nobody types them by hand:
dotnet run --project Bcf.Vocabulary.Generator # rewrite Bcf.Core/Vocabulary/BcfVocabulary.g.cs
dotnet run --project Bcf.Vocabulary.Generator -- --check # verify the file is up to date
Forgetting to regenerate is not possible: VocabularyDriftTests builds the
constants again from bcf-extensions.json and compares them with the
committed file, and NoHardcodedVocabularyTests makes sure values such as
"In Progress" never appear as string literals in the code.
The vocabulary files that go into an archive are assembled from the same
constants rather than stored ready-made: ExtensionsWriter.Write30 produces
extensions.xml (BCF 3.0), ExtensionsWriter.Write21 produces
extensions.xsd (BCF 2.1). The latter redefines types from markup.xsd, so
that schema has to travel inside the archive next to it.
Reference archives
dotnet run --project Bcf.TestData.Generator
Builds the fixtures in test-data/ with the real exporter, byte-for-byte
reproducibly. Details in test-data/README.md.
Next to them, in test-data/buildingsmart/,
lie the official test cases from the buildingSMART repository. They were
written by other tools, so reading them is the only outside check of whether
this library understands the format the way its authors do — everything else
in test-data/ we both write and read ourselves.
Schemas
The XSDs come from the buildingSMART BCF-XML repository (branches
release_3_0 and release_2_1) and are stored here unchanged. BCF 2.1 has
no extensions.xsd among its schemas: there, vocabularies are declared by a
file inside each archive, and Bcf.Core generates it. The reference copy for
comparison is schemas/2.1/extensions.reference.xsd.
Building and testing
dotnet test Bcf.Core.Tests/Bcf.Core.Tests.csproj
Tests run on two target frameworks: net48, the runtime of desktop BIM
applications, and net8.0 for services and background agents.
Contributing
Repository conventions — language of code and documentation, the bilingual
XML-doc format, what may and may not be hard-coded — are in
AGENTS.md.
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.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.