Skip to main content

What You’ll Learn

By the end of this guide, you’ll understand:
  • ✅ How to create and structure Base objects
  • ✅ The difference between direct attributes and the properties dictionary
  • ✅ How to access and discover object properties
  • ✅ How to work with lists and collections

Prerequisites

Before starting this guide, you should:
This guide focuses on working with objects - not sending/receiving them. For send/receive operations, see the Quickstart.

How do I create a Speckle object?

You need to create custom data structures or add metadata to geometry for your Speckle project. Use the Base class - it’s the foundation of all Speckle objects and supports dynamic properties:
Base objects are Python classes that accept any property name dynamically (no predefined schema needed), serialize automatically for Speckle, support nesting (objects within objects), and work with Python’s native attribute access. When to create Base objects:
  • Building custom data structures (surveys, analysis results, schedules)
  • Grouping related objects together
  • Adding application-specific metadata
Don’t use reserved names: Avoid property names starting with _ or matching Base methods like id, speckle_type, get_member_names(). These have special meanings.

How do I add metadata: direct attributes vs. properties dictionary?

You need to attach metadata to objects, but you’re unsure whether to use direct attributes (obj.name) or the properties dictionary (obj.properties["name"]). Use direct attributes for structure and organization:
Use the properties dictionary for queryable metadata:
Direct attributes (obj.name) are part of your object’s structure, provide Python-level property access, and are good for relationships and hierarchies like obj.levels, obj.elements, obj.children. Properties dictionary (obj.properties) is a standardized metadata container, follows BIM connector conventions, makes data searchable across applications, and commonly uses keys like category, family, type, material.
Which to use? Both are valid Speckle patterns! The properties dictionary is a convention that makes metadata more discoverable. If Revit sends a wall, its category will be in properties["category"] - following this pattern makes your data easier to work with across platforms.
Combining both approaches:

How do I access object properties?

You have a Speckle object and need to read its properties, but you don’t know what properties it has or how to access them safely. For direct attributes:
For properties dictionary:
Discovering all properties - use get_member_names() to discover what properties an object has:
get_member_names() returns all property names on the object, automatically filtering out:
  • Private members (starting with _)
  • Methods and functions
  • Class attributes
This means you get a clean list of just the data properties. No need to check if not name.startswith("_") - it’s already filtered!
Safe property access pattern:
Don’t assume properties exist! Speckle objects can come from different sources with different schemas. Always use safe access patterns:

How do I work with lists and collections?

You need to work with multiple objects - filtering them, counting them, or processing them in bulk. Looping through lists:
Filtering lists:
Counting and aggregating:
Working with nested collections - many Speckle objects use elements arrays for hierarchical structures:
Terminology Note: Examples here use terms like “building”, “level”, “room” to illustrate hierarchical concepts. Real BIM data from connectors (Revit, Rhino, etc.) uses proxy structures rather than direct nesting - for example, Revit levels are LevelProxy objects that reference elements by ID. See Proxification and BIM Data Patterns for actual BIM structures.
Common collection patterns:
Check if elements exists before looping:

Practical Examples

Example 1: Create a Survey Point Collection

Example 2: Filter and Summarize Objects

Example 3: Build a Hierarchy

Learn More

Core Concepts: Guides: API Reference:

Next Steps

Now that you understand how to work with Speckle objects, you’re ready to:
  1. Learn traversal - Navigate nested object structures recursively
  2. Extract data - Filter and find specific objects in complex hierarchies
  3. Work with geometry - Extract and manipulate displayValue meshes from BIM objects
Continue to Intermediate: Finding and Extracting Data
Last modified on July 18, 2026