PIAttributePath typedef
PIComposer APIPIComposer API

PIAttributePath#

typedef PIAttributePath = List<dynamic>

A path defined as a list of tokens where each token is either a string or an integer.

Token Types:#

  • String tokens: Reference either an attribute name or a select's chosen type
  • Integer tokens: Always reference an index into an aggregate (list, array, etc.)

Path Navigation:#

Provides a simple yet powerful way to address attribute locations within composed instances. Path navigation is not bounded to a single instance—it may cross instance boundaries and traverse multiple instances within a model.

An attribute value is addressable if it can be reached by valid path traversal.

Example: Accessing IfcBeam placement coordinates where starting point is#

IfcBeam instance.

Path Definition:

final path = [
  'ObjectPlacement',           // Attribute name → IfcLocalPlacement instance
  'RelativePlacement',         // Attribute name → IfcAxis2Placement select
  'IfcAxis2Placement3D',       // Select type choice → IfcAxis2Placement3D instance
  'Location',                  // Attribute name → IfcCartesianPoint instance
  'Coordinates',               // Attribute name → LIST [1:3] OF REAL
  0                            // Array index → First coordinate (x-value)
];

Navigation Breakdown:

  1. Start at IfcBeam instance
  2. Traverse to ObjectPlacement attribute (→ IfcLocalPlacement)
  3. Traverse to RelativePlacement attribute (→ IfcAxis2Placement SELECT)
  4. Choose IfcAxis2Placement3D from the SELECT
  5. Traverse to Location attribute (→ IfcCartesianPoint)
  6. Traverse to Coordinates attribute (→ LIST OF REAL)
  7. Access index [0] for x-coordinate

Key Advantages:#

  • Universal addressing: Access any attribute in any composed instance
  • Cross-instance navigation: Traverse multiple instance boundaries seamlessly
  • Simple syntax: Intuitive list-based construction
  • Batch operations: Enable complex data manipulation through paths

Performance Characteristics:#

  • Highly efficient: Path traversal is the most efficient method for accessing composed attributes due to memory locality and optimized internal representation
  • In-situ updates: Simple fixed-size types (int, double, bool) are updated directly in the underlying flat buffer without copying
  • Instance boundary cost: The only performance cost occurs when crossing instance boundaries (reference resolution), but composed attribute traversal within the same instance is extremely fast

Important Notes:#

  • The first token must always be a string (attribute name)
  • Paths crossing instance boundaries require resolveRef: true in access methods
  • Invalid paths (non-existent attributes, out-of-bounds indices) will result in errors
  • Composed attribute access is optimized via flat buffer memory layout