mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 18:57:17 +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")
|
bpy.ops.bim.assign_class(obj=obj.name, ifc_class="IfcGrid")
|
||||||
grid = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
grid = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||||
if has_site_collection:
|
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")
|
axes_collection = bpy.data.collections.new("UAxes")
|
||||||
collection.children.link(axes_collection)
|
collection.children.link(axes_collection)
|
||||||
|
|||||||
@@ -98,13 +98,13 @@ class PieUpdateContainer(bpy.types.Operator):
|
|||||||
for obj in context.selected_objects:
|
for obj in context.selected_objects:
|
||||||
if not obj.BIMObjectProperties.ifc_definition_id:
|
if not obj.BIMObjectProperties.ifc_definition_id:
|
||||||
continue
|
continue
|
||||||
relating_structure = None
|
|
||||||
for collection in obj.users_collection:
|
for collection in obj.users_collection:
|
||||||
relating_structure_obj = bpy.data.objects.get(collection.name)
|
spatial_obj = bpy.data.objects.get(collection.name)
|
||||||
if not relating_structure_obj or not relating_structure_obj.BIMObjectProperties.ifc_definition_id:
|
if spatial_obj and spatial_obj.BIMObjectProperties.ifc_definition_id:
|
||||||
continue
|
bpy.ops.bim.assign_container(
|
||||||
relating_structure = relating_structure_obj
|
relating_structure=spatial_obj.BIMObjectProperties.ifc_definition_id, related_element=obj.name
|
||||||
bpy.ops.bim.assign_container(relating_structure=relating_structure.name, related_element=obj.name)
|
)
|
||||||
|
break
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -160,8 +160,12 @@ class AssignClass(bpy.types.Operator):
|
|||||||
for collection in obj.users_collection:
|
for collection in obj.users_collection:
|
||||||
if "Ifc" not in collection.name or collection.name == obj.name:
|
if "Ifc" not in collection.name or collection.name == obj.name:
|
||||||
continue
|
continue
|
||||||
bpy.ops.bim.assign_container(relating_structure=collection.name, related_element=obj.name)
|
spatial_obj = bpy.data.objects.get(collection.name)
|
||||||
break
|
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):
|
class UnassignClass(bpy.types.Operator):
|
||||||
|
|||||||
Reference in New Issue
Block a user