mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 20:00:02 +00:00
Implement COBie systems
This commit is contained in:
@@ -95,7 +95,14 @@ def get_components(ifc_file):
|
|||||||
|
|
||||||
|
|
||||||
def get_systems(ifc_file):
|
def get_systems(ifc_file):
|
||||||
return ifc_file.by_type("IfcSystem")
|
results = []
|
||||||
|
components = get_components(ifc_file)
|
||||||
|
systems = ifc_file.by_type("IfcSystem", include_subtypes=False) + ifc_file.by_type("IfcDistributionSystem")
|
||||||
|
for system in systems:
|
||||||
|
for element in ifcopenshell.util.system.get_system_elements(system):
|
||||||
|
if element in components:
|
||||||
|
results.append((system, element))
|
||||||
|
return results
|
||||||
|
|
||||||
|
|
||||||
def get_contact_data(ifc_file, element):
|
def get_contact_data(ifc_file, element):
|
||||||
@@ -515,15 +522,18 @@ def get_component_data(ifc_file, element):
|
|||||||
|
|
||||||
|
|
||||||
def get_system_data(ifc_file, element):
|
def get_system_data(ifc_file, element):
|
||||||
|
system, component = element
|
||||||
return {
|
return {
|
||||||
"key": element.Name,
|
"key": val(system.Name),
|
||||||
"Name": element.Name,
|
"Name": val(system.Name),
|
||||||
"Description": element.Description,
|
"CreatedBy": get_created_by(system),
|
||||||
"Category": get_classification(element),
|
"CreatedOn": get_created_on(system),
|
||||||
"AuthorOrganizationName": get_owner_name(element),
|
"Category": get_category(system),
|
||||||
"AuthorDate": get_owner_creation_date(element),
|
"ComponentNames": val(component.Name),
|
||||||
"ModelSoftware": get_external_system(element),
|
"ExternalSystem": get_external_system(system),
|
||||||
"ModelID": element.GlobalId,
|
"ExternalObject": system.is_a(),
|
||||||
|
"ExternalIdentifier": system.GlobalId,
|
||||||
|
"Description": val(system.Description) or val(system.Name),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user