mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
Minor fix for previous commit
This commit is contained in:
@@ -31,7 +31,11 @@ def add_object(self, context):
|
||||
bpy.ops.bim.assign_class(obj=obj.name, ifc_class="IfcGrid")
|
||||
grid = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||
if has_site_collection:
|
||||
bpy.ops.bim.assign_container(relating_structure=grandchild.name, related_element=obj.name)
|
||||
site_obj = bpy.data.objects.get(grandchild.name)
|
||||
if site_obj and site_obj.BIMObjectProperties.ifc_definition_id:
|
||||
bpy.ops.bim.assign_container(
|
||||
relating_structure=site_obj.BIMObjectProperties.ifc_definition_id, related_element=obj.name
|
||||
)
|
||||
|
||||
axes_collection = bpy.data.collections.new("UAxes")
|
||||
collection.children.link(axes_collection)
|
||||
|
||||
@@ -98,13 +98,13 @@ class PieUpdateContainer(bpy.types.Operator):
|
||||
for obj in context.selected_objects:
|
||||
if not obj.BIMObjectProperties.ifc_definition_id:
|
||||
continue
|
||||
relating_structure = None
|
||||
for collection in obj.users_collection:
|
||||
relating_structure_obj = bpy.data.objects.get(collection.name)
|
||||
if not relating_structure_obj or not relating_structure_obj.BIMObjectProperties.ifc_definition_id:
|
||||
continue
|
||||
relating_structure = relating_structure_obj
|
||||
bpy.ops.bim.assign_container(relating_structure=relating_structure.name, related_element=obj.name)
|
||||
spatial_obj = bpy.data.objects.get(collection.name)
|
||||
if spatial_obj and spatial_obj.BIMObjectProperties.ifc_definition_id:
|
||||
bpy.ops.bim.assign_container(
|
||||
relating_structure=spatial_obj.BIMObjectProperties.ifc_definition_id, related_element=obj.name
|
||||
)
|
||||
break
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
@@ -160,8 +160,12 @@ class AssignClass(bpy.types.Operator):
|
||||
for collection in obj.users_collection:
|
||||
if "Ifc" not in collection.name or collection.name == obj.name:
|
||||
continue
|
||||
bpy.ops.bim.assign_container(relating_structure=collection.name, related_element=obj.name)
|
||||
break
|
||||
spatial_obj = bpy.data.objects.get(collection.name)
|
||||
if spatial_obj and spatial_obj.BIMObjectProperties.ifc_definition_id:
|
||||
bpy.ops.bim.assign_container(
|
||||
relating_structure=spatial_obj.BIMObjectProperties.ifc_definition_id, related_element=obj.name
|
||||
)
|
||||
break
|
||||
|
||||
|
||||
class UnassignClass(bpy.types.Operator):
|
||||
|
||||
Reference in New Issue
Block a user