mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
Minor fix
This commit is contained in:
+24
-16
@@ -216,7 +216,7 @@ class Parser:
|
|||||||
continue
|
continue
|
||||||
self.zones[element.Name + space.Name] = {
|
self.zones[element.Name + space.Name] = {
|
||||||
"Name": element.Name,
|
"Name": element.Name,
|
||||||
"AuthorOrganizationName": "Cox Architecture",
|
"AuthorOrganizationName": element.OwnerHistory.OwningUser.TheOrganization.Name,
|
||||||
"AuthorDate": ifcopenshell.util.date.ifc2datetime(
|
"AuthorDate": ifcopenshell.util.date.ifc2datetime(
|
||||||
element.OwnerHistory.CreationDate
|
element.OwnerHistory.CreationDate
|
||||||
).isoformat(),
|
).isoformat(),
|
||||||
@@ -229,13 +229,13 @@ class Parser:
|
|||||||
|
|
||||||
def get_systems(self):
|
def get_systems(self):
|
||||||
for discipline, ifc in self.files.items():
|
for discipline, ifc in self.files.items():
|
||||||
#if discipline == "arch":
|
# if discipline == "arch":
|
||||||
# continue
|
# continue
|
||||||
for element in ifc.by_type("IfcSystem"):
|
for element in ifc.by_type("IfcSystem"):
|
||||||
name = element.Name
|
name = element.Name
|
||||||
self.systems[name] = {
|
self.systems[name] = {
|
||||||
"Name": name,
|
"Name": name,
|
||||||
"AuthorOrganizationName": "Fredon",
|
"AuthorOrganizationName": element.OwnerHistory.OwningUser.TheOrganization.Name,
|
||||||
"AuthorDate": ifcopenshell.util.date.ifc2datetime(element.OwnerHistory.CreationDate).isoformat(),
|
"AuthorDate": ifcopenshell.util.date.ifc2datetime(element.OwnerHistory.CreationDate).isoformat(),
|
||||||
"Category": None,
|
"Category": None,
|
||||||
"ModelSoftware": element.OwnerHistory.OwningApplication.ApplicationFullName,
|
"ModelSoftware": element.OwnerHistory.OwningApplication.ApplicationFullName,
|
||||||
@@ -255,10 +255,17 @@ class Parser:
|
|||||||
|
|
||||||
psets = ifcopenshell.util.element.get_psets(element)
|
psets = ifcopenshell.util.element.get_psets(element)
|
||||||
|
|
||||||
|
# Hack
|
||||||
category = None
|
category = None
|
||||||
if "Data" in psets and "COBie.Type.Category" in psets["Data"]:
|
if ifc_file == "arch":
|
||||||
if ":" in psets["Data"]["COBie.Type.Category"]:
|
#if "Data" in psets and "COBie.Type.Category" in psets["Data"]:
|
||||||
category = psets["Data"]["COBie.Type.Category"].replace(" : ", ":")
|
# if ":" in psets["Data"]["COBie.Type.Category"]:
|
||||||
|
# category = psets["Data"]["COBie.Type.Category"].replace(" : ", ":")
|
||||||
|
if "Data" in psets and "Classification.Uniclass.Pr.Number" in psets["Data"]:
|
||||||
|
category = f"{psets['Data']['Classification.Uniclass.Pr.Number']}:{psets['Data']['Classification.Uniclass.Pr.Description']}"
|
||||||
|
elif ifc_file == "hyd":
|
||||||
|
if "Data" in psets and "Classification.Uniclass.Pr.Number" in psets["Data"]:
|
||||||
|
category = f"{psets['Data']['Classification.Uniclass.Pr.Number']}:{psets['Data']['Classification.Uniclass.Pr.Description']}"
|
||||||
|
|
||||||
self.types[name] = {
|
self.types[name] = {
|
||||||
"Name": name,
|
"Name": name,
|
||||||
@@ -281,7 +288,6 @@ class Parser:
|
|||||||
}
|
}
|
||||||
|
|
||||||
def get_components(self):
|
def get_components(self):
|
||||||
org_map = {"arch": "Cox Architecture", "arch": "Bates Smart", "elec": "Fredon", "fire": "Premier Fire"}
|
|
||||||
for discipline, ifc in self.files.items():
|
for discipline, ifc in self.files.items():
|
||||||
self.get_components_from_file(discipline)
|
self.get_components_from_file(discipline)
|
||||||
|
|
||||||
@@ -297,15 +303,17 @@ class Parser:
|
|||||||
|
|
||||||
space_name = None
|
space_name = None
|
||||||
|
|
||||||
# space = element.ContainedInStructure[0].RelatingStructure
|
# Nasty hack
|
||||||
# if space.is_a("IfcSpace"):
|
if ifc_file == "arch":
|
||||||
# space_name = space.Name
|
psets = ifcopenshell.util.element.get_psets(element)
|
||||||
|
if "Data" in psets and "COBie.Component.Space" in psets["Data"]:
|
||||||
psets = ifcopenshell.util.element.get_psets(element)
|
space_name = psets["Data"]["COBie.Component.Space"]
|
||||||
if "Data" in psets and "COBie.Component.Space" in psets["Data"]:
|
if space_name not in self.spaces:
|
||||||
space_name = psets["Data"]["COBie.Component.Space"]
|
space_name = None
|
||||||
if space_name not in self.spaces:
|
else:
|
||||||
space_name = None
|
space = element.ContainedInStructure[0].RelatingStructure
|
||||||
|
if space.is_a("IfcSpace"):
|
||||||
|
space_name = space.Name
|
||||||
|
|
||||||
self.components[name] = {
|
self.components[name] = {
|
||||||
"Name": name,
|
"Name": name,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import ifcopenshell.api
|
import ifcopenshell.api
|
||||||
|
import ifcopenshell.util.unit
|
||||||
import ifcopenshell.util.element
|
import ifcopenshell.util.element
|
||||||
import ifcopenshell.util.placement
|
import ifcopenshell.util.placement
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user