mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-15 18:14:08 +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")
|
declaration = tool.Ifc.schema().declaration_by_name("IfcSystem")
|
||||||
declarations = ifcopenshell.util.schema.get_subtypes(declaration)
|
declarations = ifcopenshell.util.schema.get_subtypes(declaration)
|
||||||
version = tool.Ifc.get_schema()
|
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.
|
# We're only interested in systems for services. Not sure why IFC groups these together.
|
||||||
return [
|
return [
|
||||||
(c, c, get_entity_doc(version, c).get("description", ""))
|
(c, c, get_entity_doc(version, c).get("description", ""))
|
||||||
@@ -56,7 +59,7 @@ class SystemData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def total_systems(cls):
|
def total_systems(cls):
|
||||||
return len(tool.Ifc.get().by_type("IfcSystem"))
|
return len(tool.System.get_systems())
|
||||||
|
|
||||||
|
|
||||||
class ObjectSystemData:
|
class ObjectSystemData:
|
||||||
@@ -85,7 +88,7 @@ class ObjectSystemData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def total_systems(cls):
|
def total_systems(cls):
|
||||||
return len(tool.Ifc.get().by_type("IfcSystem"))
|
return len(tool.System.get_systems())
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def connected_elements(cls):
|
def connected_elements(cls):
|
||||||
|
|||||||
@@ -127,11 +127,17 @@ class System(blenderbim.core.tool.System):
|
|||||||
props.system_attributes.clear()
|
props.system_attributes.clear()
|
||||||
blenderbim.bim.helper.import_attributes2(system, props.system_attributes)
|
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
|
@classmethod
|
||||||
def import_systems(cls):
|
def import_systems(cls):
|
||||||
props = bpy.context.scene.BIMSystemProperties
|
props = bpy.context.scene.BIMSystemProperties
|
||||||
props.systems.clear()
|
props.systems.clear()
|
||||||
for system in tool.Ifc.get().by_type("IfcSystem"):
|
for system in cls.get_systems():
|
||||||
if system.is_a() in ["IfcStructuralAnalysisModel"]:
|
if system.is_a() in ["IfcStructuralAnalysisModel"]:
|
||||||
continue
|
continue
|
||||||
new = props.systems.add()
|
new = props.systems.add()
|
||||||
|
|||||||
Reference in New Issue
Block a user