Navisworks embedded SQLite Database, reuse for other purpose?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Navisworks maintains a SQLITE database inside each Navisworks file.
This is super useful and can be accessed to store plugin specific stuff per document.
Navisworks API includes dedicated classes NavisworksConnection, NavisworksCommand etc. providing a reasonably good level of features and performance.
However there are cases where you would not want data stored in the actual navisworks file, for example cached information since:
- these can be regerenated for example at load
- this would grow .nwf file
- this would slow Navisworks file opeing since the embedded database is actually extracted as dedicated file (which is very good and allow for example to view and modify its content using tools like DBBrowser for SQLite!)
So I was thinking of having a separate, external DB file for such cached information.
I know I can add any 3rd party SQLite for C# library in our plugin however:
- increased dependencies
- different code vs Navisworks DB
Ideally I would prefer to just use Navisworks API.
I just haven found (yet) a way to create such a database or at least pass a file path to it to Navisworks API.
Did anyone already explore this?
Thanks.
Here the main entry points:
namespace Autodesk.Navisworks.Api.Data
{
public class NavisworksConnection : DbConnection
{
public override ConnectionState State { get; }
public override string ServerVersion { get; }
public override string Database { get; }
public override string DataSource { get; }
public override string ConnectionString { get; set; }
public override DbTransaction BeginDbTransaction(IsolationLevel A_0);
//
// Summary:
// Not implement
public override void ChangeDatabase(string databaseName);
//
// Summary:
// Does nothing, always keep open.
public override void Close();
public NavisworksCommand CreateCommand();
public override DataTable GetSchema(string collectionName, string[] restrictionValues);
[EditorBrowsable(EditorBrowsableState.Never)]
public LcUSQLiteConnection InternalGetConnection();
//
// Summary:
// Does nothing, connection is automatically opened by DocumentDatabase.
public override void Open();
protected override DbCommand CreateDbCommand();
}
}