According to IFC spec https://standards.buildingsmart.org/IFC/RELEASE/IFC4_3/HTML/lexical/IfcRepresentation.htm IfcRepresentation.RepresentationIdentifier and IfcRepresentation.RepresentationType are optional. Not all exporting software fill RepresentationIdentifier and RepresentationType properties which leads to xbim reports model contains no shape instances in models from such software
To reporduce the issue
- Open attached project in visual studio. XBimGeometryMissing.zip
- Add path of attached IFC file to the launch settings command-line arguments wall.zip
- Build and run console application
Current output:
Hello xbim!
shape instances: 0
Expected output:
Hello xbim!
shape instances: 1
If RepresentationIdentifier and RepresentationType are filled in, xbim reports the ShapeInstances count is 1. wall_orig.zip
I assume a possible reason may be related to changes in this commit 54cc1bf
Here is source code of example project just in case
using Xbim.Common.Geometry;
using Xbim.Ifc;
using Xbim.ModelGeometry.Scene;
namespace XBimGeometryMissing
{
public static class Program
{
public static int Main(string[] args)
{
Console.WriteLine("Hello xbim!");
using (IfcStore store = IfcStore.Open(args[0]))
{
var modelContext = new Xbim3DModelContext(store);
modelContext.CreateContext();
using (IGeometryStoreReader reader = store.GeometryStore.BeginRead())
{
Console.WriteLine("shape instances: " + reader.ShapeInstances.Count());
}
}
return 0;
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.9" />
<PackageReference Include="Xbim.Essentials" Version="6.0.587" />
<PackageReference Include="Xbim.Geometry" Version="5.1.820" />
</ItemGroup>
</Project>
According to IFC spec https://standards.buildingsmart.org/IFC/RELEASE/IFC4_3/HTML/lexical/IfcRepresentation.htm IfcRepresentation.RepresentationIdentifier and IfcRepresentation.RepresentationType are optional. Not all exporting software fill RepresentationIdentifier and RepresentationType properties which leads to xbim reports model contains no shape instances in models from such software
To reporduce the issue
Current output:
Hello xbim! shape instances: 0Expected output:
Hello xbim! shape instances: 1If RepresentationIdentifier and RepresentationType are filled in, xbim reports the ShapeInstances count is 1. wall_orig.zip
I assume a possible reason may be related to changes in this commit 54cc1bf
Here is source code of example project just in case