ifc2sql - clarify how output works in docs, add a suffix to temp file

This commit is contained in:
Andrej730
2024-09-24 14:08:43 +05:00
parent 21dd5054e6
commit 810f42ea24
+5 -3
View File
@@ -93,8 +93,10 @@ class Patcher:
.. code:: python
# Convert to SQLite
ifcpatch.execute({"input": "input.ifc", "file": model, "recipe": "Ifc2Sql", "arguments": ["sqlite"]})
# Convert to SQLite, SQLite databse will be saved to a temporary file.
sqlite_temp_filepath = ifcpatch.execute(
{"input": "input.ifc", "file": model, "recipe": "Ifc2Sql", "arguments": ["sqlite"]}
)
"""
self.src = src
self.file = file
@@ -117,7 +119,7 @@ class Patcher:
self.schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(self.file.schema)
if self.sql_type == "sqlite":
tmp = tempfile.NamedTemporaryFile(delete=False)
tmp = tempfile.NamedTemporaryFile(delete=False, suffix=".ifcsqlite")
db_file = tmp.name
self.db = sqlite3.connect(db_file)
self.c = self.db.cursor()