Speckle.Core.Serialisation BaseObjectSerializerV2 on large ifc files duplicates objects

  • Objective:
    Here is what i am trying to achieve.
    I have ifc file generated from Revit. i find it difficult to work with speckle server as it has a lot of complications that i dont need. I am trying to convert ifc file to speckle format that i can later use with speckle viewer with SpeckleOfflineLoader
    i’ve managed to successfully parse data from ifc to speckle format json that i later pass to SpeckleOfflineLoader.
    What are you trying to achieve, e.g. Receive Blender data in Excel, Use REST to query comments, …
  • Issue:
    With larger IFC models i see a bug with either objects duplications and/or disposition screenshot 1
    the issue does not exist on ifc file itself as i have opened it with other tools for ifc and there is no object duplications or dispositions
var filePath = new FilePath(ifcFilePath);
            //Ara3D.IfcLoader.IfcFile
            var ifcFile = IfcFile.Load(filePath, true);

            var geometryModel = ifcFile.ToSpeckle();
            
            //  Speckle.Core.Serialisation.BaseObjectSerializerV2
            var serializer = new BaseObjectSerializerV2();
            var geometryModelJson = serializer.Serialize(geometryModel);
            File.WriteAllText(jsonFilePath, geometryModelJson);

Is there a known error with serialization of large speckle objects or mb there is other ways to achieve my goal?

1 Like

Curious what are you guys cooking? I’m not remembering any speckle offline loader of ours, so keen to hear more!

Regarding IFC parser, you could check the new one: speckle-server/packages/fileimport-service/src/ifc-dotnet at main · specklesystems/speckle-server · GitHub

Or are you already using that?

I will look into that, is there a way to use this without committing to speckle server? as a standalone dll or something like this as i am already seeing here that it requires this
var projectIdArgument = new Argument<string>("projectId"); var versionMessageArgument = new Argument<string>("versionMessage"); var modelIdArgument = new Argument<string>("modelId"); var modelNameArgument = new Argument<string>("modelName"); var regionNameArgument = new Argument<string>("regionName");

i’ve found this SpeckleOfflineLoader in
import { SpeckleOfflineLoader } from ‘@speckle/viewer’;
it was suggested in one of threads here

1 Like

so what about using this without need to have speckle server? i just want a simple way to create this processing path
Ifc → speckle base → json

One thing to consider, @Viktor_zhuk:

If your end goal is IFC → JSON → 3D visualization, there are already several tools and libraries (like ifcjs or xeokit) that convert IFC directly to JSON or even load IFC files straight into a web viewer without needing the Speckle object model or serialization layer.

So why go down the Speckle route at all?

Speckle’s superpower isn’t file conversion — it’s structured, interoperable data: objects, relationships, metadata, versioning, and the ability to consume and transform that data across multiple platforms and domains.

If you’re just after “geometry in a JSON blob,” Speckle might feel like overhead. But if you want:

  • Consistent object structures
  • Referencing and relationships
  • Extensible metadata
  • Future interoperability with other authoring tools
  • The ability to publish into collaborative or automated pipelines down the line

…then using Speckle as your intermediate makes sense.

But if your goal is a simple offline IFC viewer and you don’t need all that — other tools might get you there faster and leaner.

Either way, we’re happy to help if you want to experiment more with the Speckle pipeline — but I’m also pleased to point you toward lighter alternatives if that’s ultimately a better fit.

2 Likes