mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Added IfcZone to systems UI in IFC2X3 #3905
In IFC2X3 IfcZone is a subtype of IfcGroup but not subtype of IfcSystem (it become one after IFC4), therefore IfcZone wasn't presented anywhere in BBIM UI. It's a bit confusing though to include IfcZone in systems when it's not actually a IfcSystem but having it in IfcGroups would be confusing too.
This commit is contained in:
@@ -47,6 +47,9 @@ class SystemData:
|
||||
declaration = tool.Ifc.schema().declaration_by_name("IfcSystem")
|
||||
declarations = ifcopenshell.util.schema.get_subtypes(declaration)
|
||||
version = tool.Ifc.get_schema()
|
||||
if version == "IFC2X3":
|
||||
declarations += [tool.Ifc.schema().declaration_by_name("IfcZone")]
|
||||
|
||||
# We're only interested in systems for services. Not sure why IFC groups these together.
|
||||
return [
|
||||
(c, c, get_entity_doc(version, c).get("description", ""))
|
||||
@@ -56,7 +59,7 @@ class SystemData:
|
||||
|
||||
@classmethod
|
||||
def total_systems(cls):
|
||||
return len(tool.Ifc.get().by_type("IfcSystem"))
|
||||
return len(tool.System.get_systems())
|
||||
|
||||
|
||||
class ObjectSystemData:
|
||||
@@ -85,7 +88,7 @@ class ObjectSystemData:
|
||||
|
||||
@classmethod
|
||||
def total_systems(cls):
|
||||
return len(tool.Ifc.get().by_type("IfcSystem"))
|
||||
return len(tool.System.get_systems())
|
||||
|
||||
@classmethod
|
||||
def connected_elements(cls):
|
||||
|
||||
@@ -127,11 +127,17 @@ class System(blenderbim.core.tool.System):
|
||||
props.system_attributes.clear()
|
||||
blenderbim.bim.helper.import_attributes2(system, props.system_attributes)
|
||||
|
||||
@classmethod
|
||||
def get_systems(cls):
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
return tool.Ifc.get().by_type("IfcSystem") + tool.Ifc.get().by_type("IfcZone")
|
||||
return tool.Ifc.get().by_type("IfcSystem")
|
||||
|
||||
@classmethod
|
||||
def import_systems(cls):
|
||||
props = bpy.context.scene.BIMSystemProperties
|
||||
props.systems.clear()
|
||||
for system in tool.Ifc.get().by_type("IfcSystem"):
|
||||
for system in cls.get_systems():
|
||||
if system.is_a() in ["IfcStructuralAnalysisModel"]:
|
||||
continue
|
||||
new = props.systems.add()
|
||||
|
||||
Reference in New Issue
Block a user