mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
ifc2sql - clarify how output works in docs, add a suffix to temp file
This commit is contained in:
@@ -93,8 +93,10 @@ class Patcher:
|
|||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
# Convert to SQLite
|
# Convert to SQLite, SQLite databse will be saved to a temporary file.
|
||||||
ifcpatch.execute({"input": "input.ifc", "file": model, "recipe": "Ifc2Sql", "arguments": ["sqlite"]})
|
sqlite_temp_filepath = ifcpatch.execute(
|
||||||
|
{"input": "input.ifc", "file": model, "recipe": "Ifc2Sql", "arguments": ["sqlite"]}
|
||||||
|
)
|
||||||
"""
|
"""
|
||||||
self.src = src
|
self.src = src
|
||||||
self.file = file
|
self.file = file
|
||||||
@@ -117,7 +119,7 @@ class Patcher:
|
|||||||
self.schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(self.file.schema)
|
self.schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(self.file.schema)
|
||||||
|
|
||||||
if self.sql_type == "sqlite":
|
if self.sql_type == "sqlite":
|
||||||
tmp = tempfile.NamedTemporaryFile(delete=False)
|
tmp = tempfile.NamedTemporaryFile(delete=False, suffix=".ifcsqlite")
|
||||||
db_file = tmp.name
|
db_file = tmp.name
|
||||||
self.db = sqlite3.connect(db_file)
|
self.db = sqlite3.connect(db_file)
|
||||||
self.c = self.db.cursor()
|
self.c = self.db.cursor()
|
||||||
|
|||||||
Reference in New Issue
Block a user