Skip to content

GeometryReader.ShapeInstances is empty if the optional RepresentationIdentifier and RepresentationType values of IfcShapeRepresentation are not filled by the export software. #577

Description

@andreinovikovsiemens

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

  1. Open attached project in visual studio. XBimGeometryMissing.zip
  2. Add path of attached IFC file to the launch settings command-line arguments wall.zip
  3. 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>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions