mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 23:19:57 +00:00
@@ -5525,9 +5525,18 @@ class CopyGrid(bpy.types.Operator):
|
|||||||
drawing = props.drawings[props.active_drawing_index]
|
drawing = props.drawings[props.active_drawing_index]
|
||||||
collection = bpy.data.collections.get("IfcGroup/" + drawing.name)
|
collection = bpy.data.collections.get("IfcGroup/" + drawing.name)
|
||||||
|
|
||||||
for coll in bpy.data.collections:
|
existing = [obj for obj in collection.objects if obj.name.startswith('IfcGridAxis')]
|
||||||
if coll.name.startswith('IfcGrid'):
|
for obj in existing:
|
||||||
for obj in coll.all_objects:
|
collection.objects.unlink(obj)
|
||||||
if obj.type == 'MESH':
|
|
||||||
collection.objects.link(obj.copy())
|
source = [obj
|
||||||
|
for coll in bpy.data.collections
|
||||||
|
if coll.name.startswith('IfcGrid')
|
||||||
|
for obj in coll.all_objects
|
||||||
|
if obj.type == 'MESH']
|
||||||
|
for obj in source:
|
||||||
|
dstobj = obj.copy()
|
||||||
|
dstobj.data = dstobj.data.copy()
|
||||||
|
collection.objects.link(dstobj)
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|||||||
Reference in New Issue
Block a user