I have an Ifc file parser to extract data out of an IFC file. Some of the cobie data is not extracted when I am sure the data is available and Xbim xpolorer is showing the data.
AssetIdentifier, InstallationDate etc...
public class IfcFileParser : IFileParser
{
private readonly Logger _logger = new Logger(nameof(IfcFileParser));
public event EventHandler<COBieDataEventArgs> COBieDataExtracted;
public void Parse(string userId, string filePath, Guid projectId, Guid versionNumber, bool isRevision)
{
var xbimDatabase = GetXbimDatabase(filePath, ".xbim");
var model = GetXbimModel(filePath, xbimDatabase, true);
model.Open(xbimDatabase, XbimDBAccess.Exclusive);
var context = new COBieContext
{
Model = model,
};
var builder = new COBieBuilder(context);
var components = Task.Factory.StartNew(() => COBieExtractor.ExtractComponent(builder.Workbook), TaskCreationOptions.LongRunning);
Task.WaitAll(
components,
);
model.Dispose();
var components = components.Result;
}
private static string GetXbimDatabase(string file, string extension)
{
return Path.ChangeExtension(file, extension);
}
private static XbimModel GetXbimModel(string inFileName, string xbimDb, bool caching)
{
var model = new XbimModel();
if (SupportedFormat.IsIfc(inFileName))
{
model.CreateFrom(
inFileName,
xbimDb,
null, false, caching
);
return model;
}
if (SupportedFormat.IsXbim(inFileName))
{
return model;
}
throw new UnsupportedFormatException(
$"XbimConvert does not support {Path.GetExtension(inFileName)} file formats currently");
}
}
I have an Ifc file parser to extract data out of an IFC file. Some of the cobie data is not extracted when I am sure the data is available and Xbim xpolorer is showing the data.
AssetIdentifier, InstallationDate etc...
Any clue what I am doing wrong?