mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 10:51:13 +00:00
@@ -245,6 +245,7 @@ if bpy is not None:
|
|||||||
operator.CleanWireframes,
|
operator.CleanWireframes,
|
||||||
operator.LinkIfc,
|
operator.LinkIfc,
|
||||||
operator.SnapSpacesTogether,
|
operator.SnapSpacesTogether,
|
||||||
|
operator.CopyGrid,
|
||||||
prop.StrProperty,
|
prop.StrProperty,
|
||||||
prop.Attribute,
|
prop.Attribute,
|
||||||
prop.MaterialLayer,
|
prop.MaterialLayer,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from itertools import chain
|
||||||
import os
|
import os
|
||||||
import bpy
|
import bpy
|
||||||
import bcf
|
import bcf
|
||||||
@@ -5198,3 +5199,22 @@ class SnapSpacesTogether(bpy.types.Operator):
|
|||||||
for v in polygon.vertices:
|
for v in polygon.vertices:
|
||||||
obj.data.vertices[v].co += offset
|
obj.data.vertices[v].co += offset
|
||||||
return {"FINISHED"}
|
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.operator("bim.clean_wireframes")
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.operator("bim.link_ifc")
|
row.operator("bim.link_ifc")
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.operator("bim.add_grid")
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
op = row.operator("bim.add_annotation", text="Dim", icon="ARROW_LEFTRIGHT")
|
op = row.operator("bim.add_annotation", text="Dim", icon="ARROW_LEFTRIGHT")
|
||||||
|
|||||||
Reference in New Issue
Block a user