Skip to main content

Overview

When working with BIM models in Speckle, you’ll encounter objects whose geometry is represented through displayValue properties. This guide shows you how to extract this geometry, including how to handle instance definitions that require resolving applicationId references. What you’ll learn:
  • How to extract meshes from displayValue properties
  • How to build an applicationId index for reference lookups
  • How to resolve InstanceDefinition references to get actual geometry
  • How to apply transformations to instances
For a comprehensive explanation of proxies and why Speckle uses them, see BIM Data Patterns: Pattern 5 and Proxification.

The Challenge with Display Values

After receiving a model version with operations.receive(), objects have a displayValue property containing visualization geometry. This can be:
  1. Direct meshes - The geometry is right there
  2. Instance references - References to InstanceDefinition objects by applicationId
The second case requires building an applicationId index to resolve the references.

Extracting Display Values

Finding Objects with Display Values

Start by finding all objects that have display geometry:

Extracting Direct Meshes

For objects with direct mesh geometry:

Building an applicationId Index

To resolve instance references, build an index mapping applicationIds to objects:
Why build an index? Without it, you’d traverse the entire tree for each lookup. With an index, lookups are instant (O(1) vs O(n)).

Working with Instance Definitions

Understanding Instance Definitions

Instance definitions enable geometry reuse. The definition contains references to geometry objects (by applicationId), and each instance includes a transformation matrix.

Extracting Instance Definitions

Extract instance definitions and resolve their geometry references:

Resolving Instance References in Display Values

Now you can resolve instance references when extracting display values:

Applying Transformations

Instance references include transformation matrices that position, rotate, and scale the geometry:
Transform structure: The transform is a 4x4 transformation matrix stored as a flat list of 16 numbers (column-major order). This represents position, rotation, and scale.

Complete Example

Here’s a complete workflow combining all concepts:

Best Practices

Build the Index Once

Building an applicationId index traverses the entire object tree. Do this once at the start:

Use Safe Dictionary Access

Always use .get() when looking up by applicationId:

Check for Proxy Collections

Not all model versions have instance definitions:

Troubleshooting

Problem: Instance definition’s objects list has applicationIds but you can’t find the geometry.Why this happens: The geometry objects might not have been indexed, or the applicationIds are incorrect.Solution: Verify your index contains the referenced objects:
Problem: Some objects have direct meshes, others have instance references in the same displayValue list.Why this happens: Complex objects can combine directly modeled geometry with instanced components.Solution: Check the type of each item in displayValue:
Problem: version.instanceDefinitionProxies doesn’t exist or is empty.Why this happens: Not all models use instancing—depends on the source application and how the model was created.Solution: Always check before accessing, and handle both cases:
Problem: Can’t tell if displayValue contains meshes or instance references.Why this happens: Both are in the same displayValue property.Solution: Check for the presence of applicationId:

Summary

Key concepts:
  • displayValue can contain direct meshes or instance references
  • InstanceDefinition objects reference geometry by applicationId, not direct embedding
  • applicationId index enables fast lookups when resolving references
  • Transformations position, rotate, and scale instanced geometry
Core workflow:
  1. Build applicationId index once
  2. Extract instance definitions, resolving their geometry references
  3. Process displayValue, handling both direct meshes and instance references
  4. Apply transformations where present
For more on proxies:

Next Steps

BIM Data Patterns

Level proxies, color proxies, and organizational hierarchies

Finding and Extracting Data

Advanced traversal and filtering techniques

Understanding Speckle Mesh

Deep dive into mesh structure and encoding

Working with Geometry

Create and manipulate geometry objects
Last modified on July 18, 2026