mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 00:49:59 +00:00
Assign product types using a property, not by parenting for scalability.
This commit is contained in:
@@ -379,9 +379,10 @@ class IfcParser():
|
|||||||
product['attributes'].update(attribute_override)
|
product['attributes'].update(attribute_override)
|
||||||
product.update(metadata_override)
|
product.update(metadata_override)
|
||||||
|
|
||||||
if obj.parent \
|
type_product = obj.BIMObjectProperties.type_product
|
||||||
and self.is_a_type(self.get_ifc_class(obj.parent.name)):
|
if type_product \
|
||||||
reference = self.get_type_product_reference(obj.parent.name)
|
and self.is_a_type(self.get_ifc_class(type_product.name)):
|
||||||
|
reference = self.get_type_product_reference(type_product.name)
|
||||||
self.rel_defines_by_type.setdefault(reference, []).append(self.product_index)
|
self.rel_defines_by_type.setdefault(reference, []).append(self.product_index)
|
||||||
|
|
||||||
if product['has_boundary_condition']:
|
if product['has_boundary_condition']:
|
||||||
@@ -924,6 +925,7 @@ class IfcParser():
|
|||||||
results.append(type_product)
|
results.append(type_product)
|
||||||
library['rel_declares_type_products'].append(index)
|
library['rel_declares_type_products'].append(index)
|
||||||
|
|
||||||
|
# TODO: this should use properties
|
||||||
for key in obj.keys():
|
for key in obj.keys():
|
||||||
if key[0:3] == 'Doc':
|
if key[0:3] == 'Doc':
|
||||||
self.rel_associates_document_type.setdefault(
|
self.rel_associates_document_type.setdefault(
|
||||||
@@ -949,6 +951,8 @@ class IfcParser():
|
|||||||
elif self.is_structural(obj) and obj.type == 'EMPTY':
|
elif self.is_structural(obj) and obj.type == 'EMPTY':
|
||||||
names.append('Model/Reference/GRAPH_VIEW/{}'.format(obj.name))
|
names.append('Model/Reference/GRAPH_VIEW/{}'.format(obj.name))
|
||||||
return names
|
return names
|
||||||
|
if not obj.data:
|
||||||
|
return names
|
||||||
name = self.get_ifc_representation_name(obj.data.name)
|
name = self.get_ifc_representation_name(obj.data.name)
|
||||||
for context in self.ifc_export_settings.context_tree:
|
for context in self.ifc_export_settings.context_tree:
|
||||||
for subcontext in context['subcontexts']:
|
for subcontext in context['subcontexts']:
|
||||||
|
|||||||
@@ -420,6 +420,7 @@ class BoundaryCondition(PropertyGroup):
|
|||||||
class BIMObjectProperties(PropertyGroup):
|
class BIMObjectProperties(PropertyGroup):
|
||||||
global_ids: CollectionProperty(name="GlobalIds", type=GlobalId)
|
global_ids: CollectionProperty(name="GlobalIds", type=GlobalId)
|
||||||
attributes: CollectionProperty(name="Attributes", type=Attribute)
|
attributes: CollectionProperty(name="Attributes", type=Attribute)
|
||||||
|
type_product: PointerProperty(name='Type Product', type=bpy.types.Object)
|
||||||
psets: CollectionProperty(name="Psets", type=Pset)
|
psets: CollectionProperty(name="Psets", type=Pset)
|
||||||
applicable_attributes: EnumProperty(items=getApplicableAttributes, name="Attribute Names")
|
applicable_attributes: EnumProperty(items=getApplicableAttributes, name="Attribute Names")
|
||||||
documents: CollectionProperty(name="Documents", type=Document)
|
documents: CollectionProperty(name="Documents", type=Document)
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ class BIM_PT_object(Panel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(props, 'attributes')
|
row.prop(props, 'attributes')
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(props, 'type_product')
|
||||||
|
|
||||||
layout.label(text="Property Sets:")
|
layout.label(text="Property Sets:")
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(context.scene.BIMProperties, "pset_name")
|
row.prop(context.scene.BIMProperties, "pset_name")
|
||||||
|
|||||||
Reference in New Issue
Block a user