mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 18:57:17 +00:00
Add UI for pset overrides without the need to create a CSV.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user