-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0257af7
commit 42be43c
Showing
10 changed files
with
188 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,89 @@ is a zipped file as per the standard. | |
``` | ||
|
||
### As A Library | ||
This C# NuGet library allows you to easily build up 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 `BcfConverter` library via NuGet Package Manager or by adding | ||
it to your project's .csproj file. | ||
``` | ||
nuget install BCFConverter | ||
``` | ||
|
||
#### Usage | ||
##### Creating BCF objects | ||
To create a BCF Model, you can use the BuilderCreator class to obtain a builder object. | ||
Then, you can use various functions provided by the builder to fulfill the BCF model | ||
objects. | ||
|
||
**IMPORTANT:** The builder always creates BCF 3.0 models. | ||
|
||
Here's an example: | ||
|
||
```csharp | ||
using BCFConverter; | ||
|
||
// Create a markup builder | ||
var markupBuilder = BuilderCreator.CreateMarkupBuilder(); | ||
|
||
// Build the BCF Markup | ||
var bcfMarkup = markupBuilder | ||
.AddTitle("Simple title") | ||
.AddDescription("This is a description") | ||
.AddLabel("Architecture") | ||
.AddPriority("Critical") | ||
.AddTopicType("Clash") | ||
.AddTopicStatus("Active") | ||
.AddComment(c => c | ||
.AddComment("This is a comment") | ||
.AddDate(DateTime.Now) | ||
.AddAuthor("[email protected]")) | ||
.AddViewPoint(v => v | ||
.AddPerspectiveCamera(pCam => pCam | ||
.AddCamera(cam => cam | ||
.AddViewPoint(10, 10, 10))), | ||
snapshotData) // Provide snapshot data here | ||
.Build(); | ||
|
||
// Create a project builder | ||
var projectBuilder = BuilderCreator.CreateProjectBuilder(); | ||
|
||
// Build the BCF Project | ||
var project = projectBuilder | ||
.AddProjectId("projectId") | ||
.AddProjectName("My project") | ||
.Build(); | ||
|
||
// Create a document builder | ||
var documentBuilder = BuilderCreator.CreateDocumentBuilder(); | ||
|
||
// Build the BCF Document | ||
var document = builder | ||
.AddDocument(d => d | ||
.AddFileName("document.pdf") | ||
.AddDescription("This is a document")) | ||
.Build(); | ||
|
||
// Create an extensions builder | ||
var extBuilder = BuilderCreator.CreateExtensionsBuilder(); | ||
|
||
// Build the BCF Extensions | ||
var extensions = builder | ||
.AddPriority("Critical") | ||
.AddPriority("Major") | ||
.AddPriority("Normal") | ||
.AddPriority("Minor") | ||
.AddTopicType("Issue") | ||
.AddTopicType("Fault") | ||
.AddTopicType("Clash") | ||
.AddTopicType("Remark") | ||
.AddTopicLabel("Architecture") | ||
.AddTopicLabel("Structure") | ||
.AddTopicLabel("MEP") | ||
.Build(); | ||
``` | ||
|
||
## File Structure | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using BcfConverter.Builder.Bcf30; | ||
|
||
namespace BcfConverter.Builder; | ||
|
||
public static class BuilderCreator { | ||
/// <summary> | ||
/// Creates a new instance of `MarkupBuilder` object. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static MarkupBuilder CreateMarkupBuilder() { | ||
return new MarkupBuilder(); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new instance of `ProjectBuilder` object. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static ProjectBuilder CreateProjectBuilder() { | ||
return new ProjectBuilder(); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new instance of `ExtensionsBuilder` object. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static ExtensionsBuilder CreateExtensionsBuilder() { | ||
return new ExtensionsBuilder(); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new instance of `DocumentInfoBuilder` object. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static DocumentInfoBuilder CreateDocumentBuilder() { | ||
return new DocumentInfoBuilder(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace BcfConverter.Model.Bcf21; | ||
|
||
public class Bcf { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace BcfConverter.Model; | ||
|
||
public class IBcf { | ||
|
||
} |