GeometryGymIfc is available via Nuget.
When starting a new project, open the Nuget package manager and search for GeometryGymIfc
(see here)
Installing via package manager console:
Install-Package GeometryGymIFC
If a specific version is of interest, add a version flag:
Install-Package GeometryGymIFC -Version 0.1.6
Add the reference to your code:
using GeometryGym.Ifc;
var database = new DatabaseIfc(ModelView.Ifc4X3_RC2);
When creating a new database, the user can choose if some boilerplate data should be generated automatically.
var database = new DatabaseIfc(true, ModelView.Ifc4X3_RC2).
The first argument triggers the boilerplate generation. If the constructor is called only be the desired ModelView item, the boilerplate is created by default.
string path = "<filepath/to/model>";
var database = new DatabaseIfc(path);
database.WriteFile("myIfcFile.ifc");
Once the DatabaseIfc
instance is created, it offers various settings
database.Factory.ApplicationDeveloper = "Developer Name";
database.Factory.ApplicationFullName = "IFC Application";
database.Factory.Options.GenerateOwnerHistory = false;
var element = new IfcBuiltElement(database);
element.AddComment("some comment");
results in
/* some comment */
#1= IFCBUILTELEMENT('3X4z6TQDjEfweLPwC9InC4',#7,$,$,$,$,$,$);
Constructors for IFC classes are typically require all non-optional attributes.
Passing null
into any constructor is typically not intended and leads to non schema compliant IFC files.