Smino.Bcf.Toolkit 1.0.0

dotnet add package Smino.Bcf.Toolkit --version 1.0.0
NuGet\Install-Package Smino.Bcf.Toolkit -Version 1.0.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="Smino.Bcf.Toolkit" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Smino.Bcf.Toolkit --version 1.0.0
#r "nuget: Smino.Bcf.Toolkit, 1.0.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.
// Install Smino.Bcf.Toolkit as a Cake Addin
#addin nuget:?package=Smino.Bcf.Toolkit&version=1.0.0

// Install Smino.Bcf.Toolkit as a Cake Tool
#tool nuget:?package=Smino.Bcf.Toolkit&version=1.0.0

This C# NuGet library allows you to easily build up and convert data into BCF files. It gives you a straightforward API to build your BCF objects exactly how you want in your order.

Installation

You can install the BcfToolkit library via NuGet Package Manager or by adding it to your project's .csproj file.

nuget install Smino.Bcf.Toolkit

Usage

Creating BCF objects

To create a BCF Model, BuilderBuilder class can be used. Then, various functions provided by the builder can be used to fulfill the BCF model objects.

Here are some examples:

using BcfToolkit.Builder.Bcf30;

var builder = new BcfBuilder();
var bcf = builder
  .AddMarkup(m => m
    .SetTitle("Simple title")
    .SetDescription("This is a description")
    .AddLabel("Architecture")
    .SetPriority("Critical")
    .SetTopicType("Clash")
    .SetTopicStatus("Active")
    .AddComment(c => c
      .SetComment("This is a comment")
      .SetDate(DateTime.Now)
      .SetAuthor("jimmy@page.com"))
    .AddViewPoint(v => v
        .SetPerspectiveCamera(pCam => pCam
          .SetCamera(cam => cam
            .SetViewPoint(10, 10, 10))),
      snapshotData)) // Provide a snapshot data here
  .SetExtensions(e => e
    .AddPriority("Critical")
    .AddPriority("Major")
    .AddPriority("Normal")
    .AddPriority("Minor")
    .AddTopicType("Issue")
    .AddTopicType("Fault")
    .AddTopicType("Clash")
    .AddTopicType("Remark")
    .AddTopicLabel("Architecture")
    .AddTopicLabel("Structure")
    .AddTopicLabel("MEP"))
  .SetProject(p => p
    .SetProjectId("projectId")
    .SetProjectName("My project"))
  .SetDocumentInfo(dI => dI
    .AddDocument(d => d
      .SetFileName("document.pdf")
      .SetDescription("This is a document")))
  .Build();

The BcfBuilder class can also consume BCF files as a stream and build up the model objects.

using BcfToolkit.Builder.Bcf30;

await using var stream = new FileStream(source, FileMode.Open, FileAccess.Read);
var builder = new BcfBuilder();
var bcf = await builder
    .BuildFromStream(stream);

The default builders can be used if the user prefers not to deal with filling the required fields. The builder.WithDefaults() function serves this. However in certain cases the user may need to replace the component IDs of IFC objects with the actual GUIDs during the build process.

using BcfToolkit.Builder.Bcf30;

var builder = new BcfBuilder();
var bcf = builder
    .WithDefaults()
    .Build();
Using BCF workers

The workers are implemented to use predefined workflows to convert BCF files into json. The aimed BCF version must be set first then ConverterContext class lets the nested object to do the conversion accordingly.

using BcfToolkit;
using BcfToolkit.Model;

var version = BcfVersion.Parse(arguments.TargetVersion);
var context = new ConverterContext(version);
await context.Convert("sourcePath", "targetPath");

The exact worker can be called directly as well for both converting directions, BCF into json and back.

using BcfToolkit.Worker.Bcf30;

var worker = new ConverterWorker()
worker.BcfZipToJson(source, target);
using BcfToolkit.Worker.Bcf30;

var worker = new ConverterWorker()
worker.JsonToBcfZip(source, target);
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. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

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
1.0.0 50 1/29/2024
0.0.1 123 10/13/2023