Allow for psets to be assigned to types, and pset overrides

This commit is contained in:
Dion Moult
2019-09-10 20:11:37 +10:00
parent 2c84a07bdc
commit 9b7ea1e83c
2 changed files with 8 additions and 0 deletions
@@ -0,0 +1 @@
MainColor,Red
1 MainColor Red
+7
View File
@@ -424,6 +424,8 @@ class IfcParser():
'location': object.location,
'up_axis': object.matrix_world.to_quaternion() @ Vector((0, 0, 1)),
'forward_axis': object.matrix_world.to_quaternion() @ Vector((1, 0, 0)),
'psets': ['{}/{}'.format(key, object[key]) for key in
object.keys() if key[0:5] == 'Pset_'],
'class': self.get_ifc_class(object.name),
'representation': self.get_object_representation_name(object),
'attributes': self.get_object_attributes(object)
@@ -665,6 +667,11 @@ class IfcExporter():
representation_map = self.file.createIfcRepresentationMap(placement, representation)
product['attributes']['RepresentationMaps'] = [representation_map]
if product['psets']:
product['attributes'].update({ 'HasPropertySets':
[self.ifc_parser.psets[pset]['ifc'] for pset in
product['psets']] })
try:
product['ifc'] = self.file.create_entity(product['class'], **product['attributes'])
except RuntimeError as e: