mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
@@ -245,6 +245,7 @@ if bpy is not None:
|
||||
operator.CleanWireframes,
|
||||
operator.LinkIfc,
|
||||
operator.SnapSpacesTogether,
|
||||
operator.CopyGrid,
|
||||
prop.StrProperty,
|
||||
prop.Attribute,
|
||||
prop.MaterialLayer,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from itertools import chain
|
||||
import os
|
||||
import bpy
|
||||
import bcf
|
||||
@@ -5198,3 +5199,22 @@ class SnapSpacesTogether(bpy.types.Operator):
|
||||
for v in polygon.vertices:
|
||||
obj.data.vertices[v].co += offset
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class CopyGrid(bpy.types.Operator):
|
||||
bl_idname = "bim.add_grid"
|
||||
bl_label = "Add Grid"
|
||||
|
||||
def execute(self, context):
|
||||
props = context.scene.DocProperties
|
||||
if props.active_drawing_index is None or len(props.drawings) == 0:
|
||||
return {"CANCELED"}
|
||||
drawing = props.drawings[props.active_drawing_index]
|
||||
collection = bpy.data.collections.get("IfcGroup/" + drawing.name)
|
||||
|
||||
for coll in bpy.data.collections:
|
||||
if coll.name.startswith('IfcGrid'):
|
||||
for obj in coll.all_objects:
|
||||
if obj.type == 'MESH':
|
||||
collection.objects.link(obj.copy())
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -2416,6 +2416,8 @@ class BIM_PT_annotation_utilities(Panel):
|
||||
row.operator("bim.clean_wireframes")
|
||||
row = layout.row(align=True)
|
||||
row.operator("bim.link_ifc")
|
||||
row = layout.row(align=True)
|
||||
row.operator("bim.add_grid")
|
||||
|
||||
row = layout.row(align=True)
|
||||
op = row.operator("bim.add_annotation", text="Dim", icon="ARROW_LEFTRIGHT")
|
||||
|
||||
Reference in New Issue
Block a user