Add UI for pset overrides without the need to create a CSV.

This commit is contained in:
Dion Moult
2020-01-15 17:17:03 +11:00
parent 71f836d013
commit af278b5724
9 changed files with 109 additions and 37 deletions
+15 -8
View File
@@ -1,6 +1,7 @@
import os
import json
import ifcopenshell
from pathlib import Path
cwd = os.path.dirname(os.path.realpath(__file__))
@@ -15,7 +16,10 @@ class IfcSchema():
'IfcParameterizedProfileDef'
]
self.elements = {}
self.property_file = ifcopenshell.open(os.path.join(self.schema_dir, 'IFC4_ADD2.ifc'))
self.property_files = []
property_paths = Path(self.schema_dir).glob('Pset_*.ifc')
for path in property_paths:
self.property_files.append(ifcopenshell.open(path))
self.psets = {}
self.qtos = {}
self.load()
@@ -29,10 +33,13 @@ class IfcSchema():
with open(os.path.join(self.schema_dir, 'ifc_types_IFC4.json')) as f:
self.type_map = json.load(f)
for property in self.property_file.by_type('IfcPropertySetTemplate'):
if property.Name[0:4] == 'Qto_':
# self.qtos.append({ })
pass
else:
self.psets[property.Name] = {
'HasPropertyTemplates': {p.Name: p for p in property.HasPropertyTemplates}}
for property_file in self.property_files:
for property in property_file.by_type('IfcPropertySetTemplate'):
if property.Name[0:4] == 'Qto_':
# self.qtos.append({ })
pass
else:
self.psets[property.Name] = {
'HasPropertyTemplates': {p.Name: p for p in property.HasPropertyTemplates}}
ifc = IfcSchema()