Using SQLite instead of Excel

I have been experimenting with SQLite with Dynamo recently & thought I would share with the group.

SQLite is a pretty good & simple option compared to MSSQL or MSAccess.
The main benefit as I see it is the data can be well structured & also allows simultaneous reads & writes (plus simple in a standalone file)
A significant number of posts on this forum relate to Excel & I think many could be overcome.
But I have to admit that the main benefit of Excel is that everyone knows how to use it…!

In this very simple example below- I look up data from an external database and update door parameters (comments) with that data.

Andrew



8 Likes

Where is the SQLite node from?

Sorry, should have said- Slingshot package

1 Like

Very interesting, I have been using Excel but this looks much more simple.

Thanks Andrew!

Hi @Andrew_Hannell. I just saw your post about a link between SQLite Studio and Revit model. As shown in this figure, you developed a link between the Revit model and the SQLite database to update the Revit parameter based on SQLite database. What should I do if I want to update the SQLite studio database based on the Revit Model? Your guidance is kindly appreciated

Thanx
Mojtaba

2 Likes

Capture is your friend- please use it…

There are examples on this forum (some by me) on how to write to an SQLite database
The short answer is that you use either an INSERT or an UPDATE query, depending if they are new records, or updating existing ones

Refer:

Hi dear @Andrew_Hannell

I tried to do what you did here, but it did not work. I had a Revit model which is a 7 story building. I am going to update one of the parameters (Level) of a door with a specific ID based on the parameter (Level) in SQLite database. I did exactly what you showed here, but it does not work. I attached some screenshots from my model and database.

Revit%20Model

As you see, I tried to change the “Level” parameter of the door with Element ID 340318 from “Ground Floor” to “Level 3”, but it does not change and under SetParameterByName it shows “Null”. Would you please help me to solve this problem? It should be noted that there are more than 100 doors in the building. I am gonna develop a workflow to update my Revit parameters in case of any changes in corresponding parameters in my SQLite database. My second question is that, is there any way to share my info in SQLite database with a third person through the web or cloud? I want to send my database data to a remote computer if it’s possible. Thank you so much in advance

I don’t believe you can change the level of a door just by changing the level parameter.

Doors are hosted by walls, but also hosted by levels - you can see this in Revit by selecting a door in elevation and ‘pick new host’

It is probably easier to do in Revit but cutting and pasting doors using the ‘aligned to selected levels’ option

As for viewing a SQLite database- I’d suggest Google drive with a third party viewer such as http://sqliteviewer.flowsoft7.com/
(although I am always cautious of giving these apps access to my data)

Hi dear @Andrew
Thank u so much for your response. I don’t know why I had not received a notification about your response, I just saw your reply yesterday when I was double checking this page. Yes, you are right. When I changed the parameter to “Mark” for example, it worked.
But now my question is that how can we transfer data from Revit to SQLite? I am gonna export all Facility Management-related data such as replacement cost, replacement year, floor type, unit cost or any other information from Revit model and accommodate them into some pre-defined database and tables in SQLite Studio. Do you have any sample video to show the process?
And also any video to show how to visualize SQLite database in Google drive?
Before I used Flux to connect my Revit model to the cloud, and it was completely automated (Any change in Revit model would be automatically applied to the database through Dynamo), but Flux is dead now, as far as I know.

Thank you so much dear @Andrew_Hannell for your time and guidance

Regards
Mojtaba

Is anybody try to create SQLite dataBase from python list with sublists using Python code?