mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 11:06:51 +00:00
Update Load bSDD domains
This commit is contained in:
@@ -33,7 +33,13 @@ class LoadBSDDDomains(bpy.types.Operator):
|
|||||||
props = context.scene.BIMBSDDProperties
|
props = context.scene.BIMBSDDProperties
|
||||||
props.domains.clear()
|
props.domains.clear()
|
||||||
client = bsdd.Client()
|
client = bsdd.Client()
|
||||||
for domain in sorted(client.Domain(), key=lambda x: x["name"]):
|
|
||||||
|
if props.load_activated_domains:
|
||||||
|
domains = [d for d in client.Domain() if d["status"] == "Active"]
|
||||||
|
else:
|
||||||
|
domains = client.Domain()
|
||||||
|
|
||||||
|
for domain in sorted(domains, key=lambda x: x["name"]):
|
||||||
new = props.domains.add()
|
new = props.domains.add()
|
||||||
new.name = domain["name"]
|
new.name = domain["name"]
|
||||||
new.namespace_uri = domain["namespaceUri"]
|
new.namespace_uri = domain["namespaceUri"]
|
||||||
|
|||||||
@@ -63,4 +63,5 @@ class BIMBSDDProperties(PropertyGroup):
|
|||||||
active_classification_index: IntProperty(name="Active Classification Index")
|
active_classification_index: IntProperty(name="Active Classification Index")
|
||||||
keyword: StringProperty(name="Keyword")
|
keyword: StringProperty(name="Keyword")
|
||||||
should_filter_ifc_class: BoolProperty(name="Filter Active IFC Class", default=True)
|
should_filter_ifc_class: BoolProperty(name="Filter Active IFC Class", default=True)
|
||||||
|
load_activated_domains: BoolProperty(name="Load Activated Domains Only", default=True)
|
||||||
classification_psets: CollectionProperty(name="Classification Psets", type=BSDDPset)
|
classification_psets: CollectionProperty(name="Classification Psets", type=BSDDPset)
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ class BIM_PT_bsdd(Panel):
|
|||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
props = context.scene.BIMBSDDProperties
|
props = context.scene.BIMBSDDProperties
|
||||||
|
row = self.layout.row()
|
||||||
|
row.prop(props, "load_activated_domains")
|
||||||
|
|
||||||
if props.active_domain:
|
if props.active_domain:
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.label(text="Active: " + props.active_domain, icon="URL")
|
row.label(text="Active: " + props.active_domain, icon="URL")
|
||||||
@@ -48,6 +51,8 @@ class BIM_PT_bsdd(Panel):
|
|||||||
props,
|
props,
|
||||||
"active_domain_index",
|
"active_domain_index",
|
||||||
)
|
)
|
||||||
|
row = self.layout.row()
|
||||||
|
row.operator("bim.load_bsdd_domains", text="Reload bSDD Domains")
|
||||||
else:
|
else:
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.operator("bim.load_bsdd_domains")
|
row.operator("bim.load_bsdd_domains")
|
||||||
@@ -58,6 +63,7 @@ class BIM_UL_bsdd_domains(UIList):
|
|||||||
if item:
|
if item:
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.label(text=f"{item.name} ({item.organization_name_owner})")
|
row.label(text=f"{item.name} ({item.organization_name_owner})")
|
||||||
|
row.label(text=item.status)
|
||||||
op = row.operator("bim.set_active_bsdd_domain", text="", icon="RESTRICT_SELECT_OFF")
|
op = row.operator("bim.set_active_bsdd_domain", text="", icon="RESTRICT_SELECT_OFF")
|
||||||
op.name = item.name
|
op.name = item.name
|
||||||
op.uri = item.namespace_uri
|
op.uri = item.namespace_uri
|
||||||
|
|||||||
Reference in New Issue
Block a user