SVF.PropDbReader
1.1.0.5
dotnet add package SVF.PropDbReader --version 1.1.0.5
NuGet\Install-Package SVF.PropDbReader -Version 1.1.0.5
<PackageReference Include="SVF.PropDbReader" Version="1.1.0.5" />
<PackageVersion Include="SVF.PropDbReader" Version="1.1.0.5" />
<PackageReference Include="SVF.PropDbReader" />
paket add SVF.PropDbReader --version 1.1.0.5
#r "nuget: SVF.PropDbReader, 1.1.0.5"
#:package SVF.PropDbReader@1.1.0.5
#addin nuget:?package=SVF.PropDbReader&version=1.1.0.5
#tool nuget:?package=SVF.PropDbReader&version=1.1.0.5
SVF-PropDbReader
<p align="center"> <img src="Resources/Logo.png" alt="SVF-PropDbReader Logo" width="90%"/> </p>
Overview
SVF-PropDbReader is a .NET library (targeting .NET 10.0, 9.0, and 8.0) for reading and extracting property database (PropDb) information from SVF files. SVF is the format used by Autodesk Platform Services (APS) to stream 3D models in web applications.
The PropDb is a SQLite database (.sdb file) embedded in every translated SVF model — it contains all metadata and properties for every element in the model.
This library enables you to:
- Read properties from a local
.sdbfile or download them directly from APS - Extract element locations (translation + bounding box) without downloading full geometry (~100x smaller)
- Embed locations into the
.sdbfile for instant access (no re-download) - Discover all categories and property names in a model
- Query, filter, and stream property values efficiently across large models
- Merge inherited properties from parent elements
- Execute custom parameterized SQL against the property database
Quick Start
Installation
dotnet add package SVF.PropDbReader
From a Local .sdb File
using SVF.PropDbReader;
using var reader = new PropDbReader(@"C:\path\to\properties.sdb");
var props = await reader.GetPropertiesForDbIdAsync(1);
foreach (var kvp in props)
Console.WriteLine($"{kvp.Key}: {kvp.Value}");
From Autodesk APS (Recommended)
using SVF.PropDbReader;
using var reader = await PropDbReader.CreateAsync("<ACCESS_TOKEN>", "<MODEL_URN>");
var props = await reader.GetPropertiesForDbIdAsync(1);
Streaming Large Models
// Memory-efficient — one row at a time
await foreach (var (dbId, value) in reader.GetAllPropertyValuesStreamAsync("Dimensions", "Area"))
{
Console.WriteLine($"dbId {dbId}: Area = {value}");
}
Element Locations (Fragment Data)
New in v1.1.0: Access 3D location data (translation + bounding box) for each element without downloading full fragment geometry. All location data is stored on disk in the SQLite database — zero memory overhead.
Traditional approach downloads 100+ MB of fragment data:
// ❌ Old way: downloads all geometry, materials, transforms (~100+ MB)
var fragments = await APSToolkit.Derivatives.ReadFragmentsRemoteAsync(token, urn);
foreach (var frag in fragments)
{
var pos = frag.Transform.Translation; // Only need these 3 values
}
PropDbReader extracts only location data and embeds it directly into the .sdb database:
// ✅ New way: downloads locations and embeds into .sdb (disk-based, no memory overhead)
using var reader = await PropDbReader.CreateWithEmbeddedLocationsAsync(token, urn);
// Query properties + locations together (reads from SQLite on disk)
var result = await reader.GetPropertiesWithLocationAsync(dbId);
Console.WriteLine($"Element at ({result.Location?.X}, {result.Location?.Y}, {result.Location?.Z})");
One-Time Download, Permanent Storage
// First run: download and embed into .sdb file
using var reader = await PropDbReader.CreateWithEmbeddedLocationsAsync(token, urn);
// Subsequent opens — locations are already in the .sdb file, no re-download
using var cachedReader = new PropDbReader("path-to-file.sdb");
if (cachedReader.HasFragmentLocations)
{
var loc = await cachedReader.GetEmbeddedFragmentLocationAsync(dbId);
Console.WriteLine($"Position: {loc?.X}, {loc?.Y}, {loc?.Z}");
}
Combined Property + Location Queries
// Find elements by property with locations (all from disk)
var results = await reader.FindByPropertyWithLocationsAsync("__category__", "");
foreach (var (dbId, propValue, location) in results)
{
Console.WriteLine($"dbId {dbId}: value={propValue}, Z={location.Z}");
}
// Stream all elements with properties + locations (memory-efficient)
await foreach (var (dbId, props, loc) in reader.GetAllPropertiesWithLocationsStreamAsync())
{
Console.WriteLine($"dbId {dbId} at ({loc.X}, {loc.Y}, {loc.Z})");
}
// Batch query with locations
var batch = await reader.GetPropertiesWithLocationsBatchAsync(new[] { 1, 2, 3 });
Cancellation Support
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
var props = await reader.GetPropertiesForDbIdAsync(1, cts.Token);
Documentation
| Document | Description |
|---|---|
| Getting Started | Installation, setup, and quick start examples |
| API Reference | Full method signatures, parameters, and usage |
| Architecture | Class diagrams, EAV schema, data flow, thread-safety design |
| Migration Guide | Upgrading from v1.0.x to v1.1.0 |
| Examples Notebook | Interactive .NET Jupyter notebook with all examples |
Dependencies
| Package | Version | Purpose |
|---|---|---|
| Microsoft.Data.Sqlite | 10.0.3 | SQLite database access |
| Autodesk.ModelDerivative | 2.2.0 | APS Model Derivative API client |
| Autodesk.Authentication | 2.0.1 | APS Authentication SDK |
| RestSharp | 112.1.0 | HTTP client for fragment downloads |
| SharpZipLib | 1.4.2 | GZIP decompression for SVF resources |
| Newtonsoft.Json | 13.0.3 | JSON serialization |
Contributing
- Fork the repository
- Create a branch for your feature:
git checkout -b feature/my-new-method - Implement your changes with XML doc comments
- Test:
dotnet test - Submit a pull request
Reporting Issues
Open an issue at GitHub Issues with your .NET version, package version, and steps to reproduce.
License
This project is licensed under the Apache License 2.0. See LICENSE for details.
References
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Autodesk.Authentication (>= 2.0.1)
- Autodesk.ModelDerivative (>= 2.2.0)
- Microsoft.Data.Sqlite (>= 10.0.3)
- Newtonsoft.Json (>= 13.0.4)
- RestSharp (>= 113.1.0)
- SharpZipLib (>= 1.4.2)
-
net8.0
- Autodesk.Authentication (>= 2.0.1)
- Autodesk.ModelDerivative (>= 2.2.0)
- Microsoft.Data.Sqlite (>= 10.0.3)
- Newtonsoft.Json (>= 13.0.4)
- RestSharp (>= 113.1.0)
- SharpZipLib (>= 1.4.2)
-
net9.0
- Autodesk.Authentication (>= 2.0.1)
- Autodesk.ModelDerivative (>= 2.2.0)
- Microsoft.Data.Sqlite (>= 10.0.3)
- Newtonsoft.Json (>= 13.0.4)
- RestSharp (>= 113.1.0)
- SharpZipLib (>= 1.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.