Skip to main content

Overview

This guide covers patterns for working with Type 1 (Custom Data) and Type 2 (Simple Model Data) - the simpler data structures you’ll encounter or create in Speckle.

Custom Data Patterns

Creating Custom Data

When you control the entire data structure:

Nested Custom Structures

Build hierarchies for complex data:

Custom Data with Geometry

Combine your structure with geometry:

Simple Model Data Patterns

Pattern 1: Properties Dictionary

The most common pattern for simple model data:
Properties can be any type (string, number, bool, list). Always use .get() with defaults for safety.
Properties Dictionary vs. Direct Attributes: Use the properties dictionary when:
  • Creating data that needs to be queryable by other applications
  • Working with metadata that follows BIM/connector conventions
  • You want a clear separation between data and structure
Use direct attributes when:
  • Creating custom application-specific data structures
  • Building organizational hierarchies (e.g., obj.phases, obj.elements)
  • You need Python-level attribute access
Both approaches work with Speckle - the properties dict is just a convention that makes data more portable and searchable.

Pattern 2: Multiple Objects with Properties

Collections of geometry with metadata:

Pattern 3: Material References

Simple material system:

Pattern 4: Layer Organization

Organize objects by layers:

Pattern 5: DisplayValue for Visualization

Add display geometry to custom objects:
Always provide displayValue for custom objects so they’re visible in Speckle viewers, even without native support.

Working with Received Simple Data

Extracting Properties

Finding Objects by Property

Extracting Display Geometry

Converting to Common Formats

To Pandas DataFrame

To GeoJSON

Best Practices

The SDK provides built-in traversal utilities - use them instead of writing custom traversal:
Benefits: handles edge cases, consistent with SDK patterns, tested and maintained.
get_member_names() already filters out private members (starting with _) and methods:
# get_member_names() already excludes private members for name in
Follow conventions for common properties:
Make units explicit for measurements:
Always include visualization geometry:

Complete Example: Survey Data Pipeline

Summary

Simple data patterns are:
  • Easy to create - Direct property access
  • Easy to query - Properties dictionary
  • Self-documenting - Clear structure
  • Portable - No application dependencies
  • Flexible - Add any properties needed
Use them for:
  • Custom analysis pipelines
  • Simple geometry exports
  • Data you control end-to-end
  • When you don’t need BIM complexity

Next Steps

BIM Data Patterns

Work with complex BIM and connector data

Data Traversal

Learn traversal techniques for any structure

Data Types

Understand the three types of data

Working with Geometry

Complete geometry guide
Last modified on July 18, 2026