mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 19:09:07 +00:00
Support custom attributes for products
This commit is contained in:
@@ -17,13 +17,15 @@ class IfcParser():
|
|||||||
collection_name_filter = []
|
collection_name_filter = []
|
||||||
product_index = 0
|
product_index = 0
|
||||||
for object in bpy.context.selected_objects:
|
for object in bpy.context.selected_objects:
|
||||||
|
attributes = { 'Name': self.get_ifc_name(object.name) }
|
||||||
|
attributes.update({key[3:]: object[key] for key in object.keys() if key[0:3] == 'Ifc'})
|
||||||
product_data = {
|
product_data = {
|
||||||
'ifc': None,
|
'ifc': None,
|
||||||
'class': self.get_ifc_class(object.name),
|
'class': self.get_ifc_class(object.name),
|
||||||
'raw': object,
|
'raw': object,
|
||||||
'relating_structure': None,
|
'relating_structure': None,
|
||||||
'representation': self.get_representation_reference(object.data.name),
|
'representation': self.get_representation_reference(object.data.name),
|
||||||
'attributes': { 'Name': self.get_ifc_name(object.name) }
|
'attributes': attributes
|
||||||
}
|
}
|
||||||
for collection in object.users_collection:
|
for collection in object.users_collection:
|
||||||
if self.is_a_spatial_structure_element(self.get_ifc_class(collection.name)):
|
if self.is_a_spatial_structure_element(self.get_ifc_class(collection.name)):
|
||||||
|
|||||||
Reference in New Issue
Block a user