Overview
When receiving data from BIM authoring tools (Revit, Rhino, ArchiCAD, etc.) via Speckle Connectors, you encounter rich, deeply nested structures with application-specific semantics.Prerequisites: This guide builds on traversal techniques. If you’re new to navigating Speckle
object graphs, start with Traversing Objects to
learn the foundational patterns used throughout this guide.
- Generic container objects:
DataObject,BlenderObject,QgisObject - Geometry primitives:
Mesh,Point,Line, etc. - Organizational proxies:
LevelProxy,GroupProxy,ColorProxy
Characteristics of BIM Data
Deep Nesting: BIM data often has nested structures with properties and sub-objects:Wall or Column. Everything is a generic container:
Pattern 1: Revit Parameters
Revit objects have rich parameter collections organized by category. Understanding Revit Parameter Structure:displayValue - these are the atomic, viewer-selectable BIM elements:
Pattern 3: EncodedValue (Rhino-Specific)
Rhino objects may include native binary data for Rhino-to-Rhino workflows. Understanding EncodedValue:encodedValue is primarily for Rhino-to-Rhino workflows. For other platforms, use displayValue
instead.Pattern 4: Instance and Definition
Complex models use instance/definition patterns for efficiency (like Revit families or Rhino blocks).Instance Definitions Location: Instance definitions are stored in the
instanceDefinitionProxies collection on the root object, not nested in the hierarchy. You need
to build an applicationId index to resolve instance references, similar to how level proxies work
(see Pattern 5).applicationId:
Pattern 5: Level and Location Data with Proxy Collections
BIM models use proxy collections at the root level to organize objects by levels, colors, groups, and materials. Understanding this pattern is essential for working with BIM hierarchies. Key Insight: Proxies enable multiple overlapping organizational hierarchies. A single wall can simultaneously belong to:- A building level (architectural hierarchy)
- A functional group (organizational grouping)
- A layer (CAD hierarchy)
- A material assignment (material hierarchy)
- An instance type (blocks/families)
See Also: For a comprehensive explanation of proxification, why overlapping hierarchies
matter, and intersection queries across multiple organizational systems, see
Proxification.
The Proxy Pattern Workflow:
- Proxies live at root level - Look for
levelProxies,colorProxies, etc. on the root object - Proxies contain applicationId lists - Each proxy has an
objectsarray of applicationId strings - Build an applicationId index - Map applicationIds to actual objects in the
elements[]hierarchy - Resolve references - Match proxy applicationIds against your index to find actual objects
- Reverse lookup for object level - To find an object’s level, search which proxy’s list contains its applicationId
levelProxies- Building levels/storeys organizationcolorProxies- Color-based groupinggroupProxies- Named groupsrenderMaterialProxies- Material assignmentsinstanceDefinitionProxies- Instance/definition relationships
applicationId strings that point to objects in the elements[] hierarchy.
LevelProxy Structure:
applicationId strings, but you need to find the actual objects in the elements[] hierarchy.
Pattern 6: Material Quantities
Revit objects can contain detailed material quantity takeoffs stored inproperties["Material Quantities"]. These quantities exist only on individual objects - there is no pre-aggregated total at the model level. To get project-wide material totals, you need to traverse all objects and aggregate their material quantities.
Understanding Material Quantities:
Each object with materials contains a Material Quantities dictionary with material breakdowns:
Complete Example: BIM Building Analysis
Best Practices
Use defensive coding for parameters
Use defensive coding for parameters
Always check if properties exist before accessing:
Handle both dict and Base for parameters
Handle both dict and Base for parameters
Parameters can be dict or Base objects:
Use displayValue for visualization
Use displayValue for visualization
Don’t rely on encodedValue for cross-platform work:
Cache extracted data for performance
Cache extracted data for performance
Don’t re-extract parameters repeatedly:
Summary
Complex BIM data requires:- ✅ Defensive coding - Check before accessing
- ✅ Parameter extraction - Understand the nested structure
- ✅ DisplayValue usage - For cross-platform visualization
- ✅ Traversal patterns - Find objects in deep hierarchies
- ✅ Level awareness - Group by building levels
- ✅ Instance handling - Understand instance/definition patterns
Next Steps
Display Values
Deep dive into display values and cross-platform visualization
Extracting Display Values
How to extract geometry from proxified display values and instances
Data Traversal
Advanced traversal techniques for any structure
Simple Data Patterns
Working with simpler data structures