mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
ifcopenshell.sqlite - add mvd_str
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
import bpy
|
import bpy
|
||||||
import os
|
import os
|
||||||
|
import ifcopenshell
|
||||||
import bonsai.bim
|
import bonsai.bim
|
||||||
import bonsai.tool as tool
|
import bonsai.tool as tool
|
||||||
from bonsai.bim.helper import prop_with_search, draw_attributes
|
from bonsai.bim.helper import prop_with_search, draw_attributes
|
||||||
@@ -259,10 +260,10 @@ class BIM_PT_project(Panel):
|
|||||||
def draw_editable_file_info(self, context):
|
def draw_editable_file_info(self, context):
|
||||||
pprops = self.props
|
pprops = self.props
|
||||||
|
|
||||||
if tool.Ifc.get():
|
if ifc_file := tool.Ifc.get():
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text="IFC Schema", icon="FILE_CACHE")
|
row.label(text="IFC Schema", icon="FILE_CACHE")
|
||||||
row.label(text=tool.Ifc.get().schema)
|
row.label(text=ifc_file.schema)
|
||||||
|
|
||||||
if pprops.is_editing:
|
if pprops.is_editing:
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
@@ -283,7 +284,10 @@ class BIM_PT_project(Panel):
|
|||||||
else:
|
else:
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text="IFC MVD", icon="FILE_HIDDEN")
|
row.label(text="IFC MVD", icon="FILE_HIDDEN")
|
||||||
mvd = "".join(tool.Ifc.get().wrapped_data.header.file_description.description)
|
if isinstance(ifc_file, ifcopenshell.sqlite):
|
||||||
|
mvd = ifc_file.mvd_str
|
||||||
|
else:
|
||||||
|
mvd = "".join(ifc_file.wrapped_data.header.file_description.description)
|
||||||
if "[" in mvd:
|
if "[" in mvd:
|
||||||
mvd = mvd.split("[")[1][0:-1]
|
mvd = mvd.split("[")[1][0:-1]
|
||||||
row.label(text=mvd)
|
row.label(text=mvd)
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ except ImportError as e:
|
|||||||
|
|
||||||
|
|
||||||
class sqlite(file):
|
class sqlite(file):
|
||||||
|
mvd_str: str
|
||||||
|
"""As in `header.file_description.description`."""
|
||||||
|
|
||||||
def __init__(self, filepath: str):
|
def __init__(self, filepath: str):
|
||||||
"""
|
"""
|
||||||
Open existing sqlite IFC database.
|
Open existing sqlite IFC database.
|
||||||
@@ -79,6 +82,7 @@ class sqlite(file):
|
|||||||
assert False, "SQLite schema not supported."
|
assert False, "SQLite schema not supported."
|
||||||
|
|
||||||
self._schema = row[1]
|
self._schema = row[1]
|
||||||
|
self.mvd_str = row[2]
|
||||||
self.ifc_schema = ifcopenshell.schema_by_name(self.schema)
|
self.ifc_schema = ifcopenshell.schema_by_name(self.schema)
|
||||||
|
|
||||||
self.cursor.execute("SELECT ifc_id, ifc_class FROM id_map")
|
self.cursor.execute("SELECT ifc_id, ifc_class FROM id_map")
|
||||||
|
|||||||
Reference in New Issue
Block a user